Introduction

Tech Support

Testing in Sandbox

Moving to Production

Versioning

Authentication

Static IP list

Errors

Supported Languages

Pagination

Date & Time

Business Account

Workspace

Balance

Transaction

Cash Receivables

Invoice

Dynamic Brcode

Deposit

Boleto

Boleto Holmes

Split

Split Receiver

Split Profile

Cash Subscription

Invoice Pull Subscription

Invoice Pull Request

Card Receivables

Merchant Session

Merchant Purchase

Merchant Card

Merchant Installment

Bill Payments

Transfer

Brcode Payment

Boleto Payment

Utility Payment

Tax Payment

Darf Payment

Payment Preview

Payment Request

Others

Webhook

Event

Event Attempt

Pix Key

Institutions

Public Key

API Reference

This is our second API version. It is another small step towards launching the product we want to create for you, but it's a giant leap for the brazilian financial market. We created the first banking API in Brazil and we are proud of it.

Our API is RESTFul. This means we use predictable, resource-oriented URLs to do banking operations. The API itself speaks exclusively in JSON, including errors, but our SDK libraries convert responses to appropriate language-specific objects.

Want to check our OpenAPI 3.1 specification? You can download our yaml file right here.

You can also try our Postman collection. Download it here.

BASE URL - Production
https://api.starkbank.com
BASE URL - Sandbox
https://sandbox.api.starkbank.com
CLIENT LIBRARIES

Python

pip install starkbank

Javascript

npm install starkbank

PHP

composer require starkbank/sdk

Java

compile "com.starkbank:sdk:{latest-version}"

Ruby

gem install starkbank

Elixir

{:starkbank, "~> {latest-version}"}

C#

Install-Package starkbank

Go

go get -u github.com/starkbank/sdk-go

Clojure

[starkbank/sdk "{latest-version}"]

Curl

Tech Support

If you have any questions about our API or SDKs, feel free to email us. We will respond to you quickly, pinky promise.

We are here to help you integrate with us ASAP. We also love feedback, so don't be shy about sharing your thoughts with us.

CONTACT US
help@starkbank.com

Testing in Sandbox

In order to send any request to Stark Bank, you first need to create a digital account with us. We call our accounts workspaces. Feel free to test our services in Sandbox by creating your workspace here (no need to contact us):

Create a Workspace in Sandbox

Your initial balance is zero. You can add balance by creating Boletos, as 90% of the created Boletos in the Sandbox environment will be paid automatically within one hour. So, just create a few boletos and wait around a bit to load your balance.

BASE URL - Sandbox
https://sandbox.api.starkbank.com

Moving to Production

Sandbox and Production share the same code but are isolated from each other as they are running in separate servers and access different databases. Switching to Production requires you to change the base url and the credentials only. The SDKs select the base url according to the environment you choose.

Note 1: Since we will be talking about real money here, we strongly recommend integrating in Sandbox first.

Note 2: The response times are different in each environment as we emulate the results in Sandbox, while in Production we depend on other financial institutions to operate. For example, if you create a new boleto in Sandbox, we will process its payment and credit within one hour, while in Production the credit will only be available in D+1 after the payment.

You can request an account in Production here:

Create a Workspace in Production
BASE URL - Production
https://api.starkbank.com

Versioning

We avoid breaking changes at all costs and we won't let your application stop working because of a change we made. We are always adding features and making improvements to our API, but whenever we make a significant change to an endpoint, we will launch a new API version. Also, whenever the API is upgraded, we will add a new log to our changelog

We consider the following changes to be backward-compatible:

  • Adding new API resources;
  • Adding new optional request parameters;
  • Making a mandatory request parameter optional;
  • Adding new properties to existing API responses;
  • Changing the order of properties in existing API responses;
  • Adding new events to webhooks (that means your webhook listener should gracefully handle unfamiliar event types).
Current API Version
v2

Authentication

At Stark Bank, we do not use static API keys or access tokens.

Instead, all API requests are authenticated using ECDSA digital signatures with the secp256k1 curve and SHA-256 digest.

Each request is signed locally on your server using your private key, which is never transmitted. The signature is sent with the request, and we verify it using your registered public key.

Our SDKs automatically handle request signing.

Credential Types:

Projects: Bound to a specific Workspace, recommended for most integrations, and only a workspace admin can register.

Organizations: Bound to your company’s Tax ID, can manage multiple Workspaces, and only a legal representative can register.

Setup:

1. Generate a private and public keys, learn how.

2. Upload your public key in our Web Banking (Sandbox or Production).

3. Configure your SDK with your Project ID or Organization ID and your private key.

Security:

1. Keep your private key secure at all times. Never share it with anyone — including Stark Bank — and never hard-code it in your source code. Store it in a Hardware Security Module (HSM) whenever possible. Otherwise, keep it encrypted, such as in an environment variable or secure database.

2. Restrict API access by configuring allowed IP addresses when registering your public key.

Python

import starkbank

# Example key only — replace with your own.
# Never hardcode private keys in source. Store them in an HSM,
# or at minimum in an encrypted KMS.
private_key_content = """
-----BEGIN EC PARAMETERS-----
BgUrgQQACg==
-----END EC PARAMETERS-----
-----BEGIN EC PRIVATE KEY-----
MHQCAQEEIMCwW74H6egQkTiz87WDvLNm7fK/cA+ctA2vg/bbHx3woAcGBSuBBAAK
oUQDQgAE0iaeEHEgr3oTbCfh8U2L+r7zoaeOX964xaAnND5jATGpD/tHec6Oe9U1
IF16ZoTVt1FzZ8WkYQ3XomRD4HS13A==
-----END EC PRIVATE KEY-----
"""

# for project users:
user = starkbank.Project(
    environment="sandbox",
    id="5656565656565656",
    private_key=private_key_content
)

# or, for organization users:
user = starkbank.Organization(
    environment="sandbox",
    id="4545454545454545",
    private_key=private_key_content
)

starkbank.user = user
  

Javascript

const starkbank = require('starkbank');

// Example key only — replace with your own.
// Never hardcode private keys in source. Store them in an HSM,
// or at minimum in an encrypted KMS.
let privateKeyContent = `
-----BEGIN EC PARAMETERS-----
BgUrgQQACg==
-----END EC PARAMETERS-----
-----BEGIN EC PRIVATE KEY-----
MHQCAQEEIMCwW74H6egQkTiz87WDvLNm7fK/cA+ctA2vg/bbHx3woAcGBSuBBAAK
oUQDQgAE0iaeEHEgr3oTbCfh8U2L+r7zoaeOX964xaAnND5jATGpD/tHec6Oe9U1
IF16ZoTVt1FzZ8WkYQ3XomRD4HS13A==
-----END EC PRIVATE KEY-----
`

// for project users:
let user = new starkbank.Project({
    environment: 'sandbox',
    id: '5656565656565656',
    privateKey: privateKeyContent
});

// or, for organization users:
let user = new starkbank.Organization({
    environment: 'sandbox',
    id: '4545454545454545',
    privateKey: privateKeyContent
});

starkbank.user = user;
  

PHP

use StarkBank\Project;
use StarkBank\Organization;
use StarkBank\Settings;

// Example key only — replace with your own.
// Never hardcode private keys in source. Store them in an HSM,
// or at minimum in an encrypted KMS.
$privateKeyContent = "
-----BEGIN EC PARAMETERS-----
BgUrgQQACg==
-----END EC PARAMETERS-----
-----BEGIN EC PRIVATE KEY-----
MHQCAQEEIMCwW74H6egQkTiz87WDvLNm7fK/cA+ctA2vg/bbHx3woAcGBSuBBAAK
oUQDQgAE0iaeEHEgr3oTbCfh8U2L+r7zoaeOX964xaAnND5jATGpD/tHec6Oe9U1
IF16ZoTVt1FzZ8WkYQ3XomRD4HS13A==
-----END EC PRIVATE KEY-----
";

// for project users:
$user = new Project([
    "environment" => "sandbox",
    "id" => "5656565656565656",
    "privateKey" => $privateKeyContent
]);

// or, for organization users:
$user = new Organization([
    "environment" => "sandbox",
    "id" => "4545454545454545",
    "privateKey" => $privateKeyContent
]);

Settings::setUser($user);
  

Java

import com.starkbank.*;

// Example key only — replace with your own.
// Never hardcode private keys in source. Store them in an HSM,
// or at minimum in an encrypted KMS.
String privateKeyContent = """
-----BEGIN EC PARAMETERS-----
BgUrgQQACg==
-----END EC PARAMETERS-----
-----BEGIN EC PRIVATE KEY-----
MHQCAQEEIMCwW74H6egQkTiz87WDvLNm7fK/cA+ctA2vg/bbHx3woAcGBSuBBAAK
oUQDQgAE0iaeEHEgr3oTbCfh8U2L+r7zoaeOX964xaAnND5jATGpD/tHec6Oe9U1
IF16ZoTVt1FzZ8WkYQ3XomRD4HS13A==
-----END EC PRIVATE KEY-----
""";

// for project users:
Project user = new Project(
    "sandbox",
    "5656565656565656",
    privateKeyContent
);

// or, for organization users:
Organization user = new Organization(
    "sandbox",
    "4545454545454545",
    privateKeyContent
);

Settings.user = user;
  

Ruby

require('starkbank')

# Example key only — replace with your own.
# Never hardcode private keys in source. Store them in an HSM,
# or at minimum in an encrypted KMS.
private_key_content = '
-----BEGIN EC PARAMETERS-----
BgUrgQQACg==
-----END EC PARAMETERS-----
-----BEGIN EC PRIVATE KEY-----
MHQCAQEEIMCwW74H6egQkTiz87WDvLNm7fK/cA+ctA2vg/bbHx3woAcGBSuBBAAK
oUQDQgAE0iaeEHEgr3oTbCfh8U2L+r7zoaeOX964xaAnND5jATGpD/tHec6Oe9U1
IF16ZoTVt1FzZ8WkYQ3XomRD4HS13A==
-----END EC PRIVATE KEY-----
'

# for project:
user = StarkBank::Project.new(
    environment: 'sandbox',
    id: '5656565656565656',
    private_key: private_key_content
)

# or, for organization users:
user = StarkBank::Organization.new(
    environment: 'sandbox',
    id: '4545454545454545',
    private_key: private_key_content
)

StarkBank.user = user
  

Elixir

# file config/config.exs

import Config

# Example key only — replace with your own.
# Never hardcode private keys in source. Store them in an HSM,
# or at minimum in an encrypted KMS.
private_key_content = "
-----BEGIN EC PARAMETERS-----
BgUrgQQACg==
-----END EC PARAMETERS-----
-----BEGIN EC PRIVATE KEY-----
MHQCAQEEIMCwW74H6egQkTiz87WDvLNm7fK/cA+ctA2vg/bbHx3woAcGBSuBBAAK
oUQDQgAE0iaeEHEgr3oTbCfh8U2L+r7zoaeOX964xaAnND5jATGpD/tHec6Oe9U1
IF16ZoTVt1FzZ8WkYQ3XomRD4HS13A==
-----END EC PRIVATE KEY-----
"

# for project users:
config :starkbank,
  project: [
    environment: :sandbox,
    id: "5656565656565656",
    private_key: private_key_content
  ]

# or, for organization users:
config :starkbank,
  organization: [
    environment: :sandbox,
    id: "4545454545454545",
    private_key: private_key_content
  ]
  

C#

// Example key only — replace with your own.
// Never hardcode private keys in source. Store them in an HSM,
// or at minimum in an encrypted KMS.
string privateKeyContent = "-----BEGIN EC PARAMETERS-----
BgUrgQQACg==
-----END EC PARAMETERS-----
-----BEGIN EC PRIVATE KEY-----
MHQCAQEEIMCwW74H6egQkTiz87WDvLNm7fK/cA+ctA2vg/bbHx3woAcGBSuBBAAK
oUQDQgAE0iaeEHEgr3oTbCfh8U2L+r7zoaeOX964xaAnND5jATGpD/tHec6Oe9U1
IF16ZoTVt1FzZ8WkYQ3XomRD4HS13A==
-----END EC PRIVATE KEY-----";

// for project users:
StarkBank.Project user = new StarkBank.Project(
    environment: "sandbox",
    id: "5656565656565656",
    privateKey: privateKeyContent
);

// or, for organization users:
StarkBank.Organization user = new StarkBank.Organization(
    environment: "sandbox",
    id: "4545454545454545",
    privateKey: privateKeyContent
);

StarkBank.Settings.User = user;
  

Go

import (
    "github.com/starkbank/core-go/starkcore/user/project"
    "github.com/starkbank/core-go/starkcore/user/organization"
    "github.com/starkbank/sdk-go/starkbank"
)

// Example key only — replace with your own.
// Never hardcode private keys in source. Store them in an HSM,
// or at minimum in an encrypted KMS.
var privateKeyContent =
"-----BEGIN EC PRIVATE KEY-----
MHQCAQEEILChZrjrrtFnyCLhcxm/hp+9ljWSmG7Wv9HRugf+FnhkoAcGBSuBBAAK
oUQDQgAEpIAM/tMqXEfLeR93rRHiFcpDB9I18MrnCJyTVk0MdD1J9wgEbRfvAZEL
YcEGhTFYp2X3B7K7c4gDDCr0Pu1L3A==
-----END EC PRIVATE KEY-----"

// for project:
var user = project.Project{
  Id:          "5656565656565656",
  PrivateKey:  privateKeyContent,
  Environment: "sandbox",
}

// or, for organization users:
var user = organization.Organization{
  Id:          "4545454545454545",
  PrivateKey:  privateKeyContent,
  Environment: "sandbox",
}

starkbank.User = user
  

Clojure

(ns my-lib.core
  (:use starkbank.core))

; Example key only — replace with your own.
; Never hardcode private keys in source. Store them in an HSM,
; or at minimum in an encrypted KMS.
(def private-key-content "-----BEGIN EC PARAMETERS-----
BgUrgQQACg==
-----END EC PARAMETERS-----
-----BEGIN EC PRIVATE KEY-----
MHQCAQEEIMCwW74H6egQkTiz87WDvLNm7fK/cA+ctA2vg/bbHx3woAcGBSuBBAAK
oUQDQgAE0iaeEHEgr3oTbCfh8U2L+r7zoaeOX964xaAnND5jATGpD/tHec6Oe9U1
IF16ZoTVt1FzZ8WkYQ3XomRD4HS13A==
-----END EC PRIVATE KEY-----")

; for project users:
(def user (starkbank.user/project
    "sandbox"
    "5656565656565656"
    private-key-content))

; or, for organization users:
(def user (starkbank.user/organization
    "sandbox"
    "4545454545454545"
    private-key-content))

(starkbank.settings/user user)
  

Curl

--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}'
  

Do it yourself

Just in case your are unable to use our SDKs, in every request we pass three custom headers:

Access-Id, Access-Time, and Access-Signature.

Here is a pseudo-code explaining how to make authenticated requests:

# Set your user Id
accessId = "project/12345"
accessId = "organization/12345"
accessId = "organization/12345/workspace/67890"

# Get current Unix Time
accessTime = 1584041509

# Get you json content in string format for POST/PUT/PATCH requests
# or empty string for GET/DELETE requests.
bodyString = ""

# Build the message in this format:
message = accessId + ":" + accessTime + ":" + bodyString

# Load your private key from its pem string
privateKey = PrivateKey.fromPem(...)

# Use ECDSA to sign the message
signature = ECDSA.sign(message, privateKey)

# Convert the signature to base 64
accessSignature = signature.toBase64()

# You are now ready to send the request
request = Request.get(
    url="https://sandbox.api.starkbank.com/v2/transfer",
    body=bodyString,
    headers={
        "Access-Id" : accessId,
        "Access-Time" : accessTime,
        "Access-Signature": accessSignature
    }
)
            

Feeling adventurous? Check out our Digital Signature libraries.

CUSTOM HEADERS
Access-Id
Static string that identifies the user:

project/{projectId} for projects;

organization/{organizationId} for organizations;

organization/{organizationId}/workspace/{workspaceId} for organizations operating inside a Workspace;
Access-Time
Current Unix-Time: the number of seconds since 1 January 1970.
Access-Signature
Base64-encoded ECDSA signature
Access-Id Example
project/12345
Access-Time Example
1584041509
Access-Signature Example
MEYCIQC5wiR/fEmwJHscoQ1a4gn9w/qiYQlr8qsdo95MsfgFNwIhAIi4jJ3bzhg+6QEu8g5qK0SNSzIi9JwRuDuP2NZYpLP3

Static IP list

To ensure the integrity and safety of our requests to your services, we recommend adding our static IP addresses to your firewall ingress rules. The following IP addresses are currently being used:

Production
- 35.199.76.124
- 34.85.188.162
Sandbox
- 35.247.226.240
- 35.245.182.229

Errors

We like standards. Unfortunately, not all of our possible errors could fit in the HTTP status standard. Since we believe numbers are not descriptive enough, we prefer to use strings as error codes. In order to be compatible with request libraries, though, we use the HTTP status in the summary shown to the right.

HTTP STATUS CODE SUMMARY
StatusDescription
200Everything went right
400Your input is incorrect. We will send you a json explaining what went wrong.
500Something went wrong on our side. Our engineering team will be notified and act to fix the problem ASAP.
418Geek test. Discover the easter egg.
ERROR SAMPLE
{
    "errors": [
        {
            "code": "invalidEmail",
            "message": "Your email address should look like “person@domain.com”."
        },
        {
            "code": "invalidName",
            "message": "Your name must have at least 6 characters."
        }
    ]
}

Supported Languages

Our API returns messages in two different languages: US English (default language) and Brazilian Portuguese. To select one of them, just add the optional header key Accept-Language to your request with "en-US" or "pt-BR" as value. If you use anything else, messages will be returned in English.

Accept-Language Header
CodeLanguage
en-USUS English (default)
pt-BRBrazilian Portuguese

Pagination

We use query cursors to do pagination. They allow you to retrieve query results in manageable batches, and are recommended over using integer offsets for pagination.

Therefore, we return a cursor string in the GET results. You must send the cursor back in the following query string in order to get the results from the next page. The cursor will be null if there are no more results to be retrieved.

To the right you will find a pseudo-code showing how to handle cursors in our API.

Note: All paged lists have at most 100 objects. Above that, you should use query cursors to get more elements. Our SDKs will handle this for you, though, so you don't have to worry about cursors and batches when using them.

Example: Handling cursors
path = "https://sandbox.api.starkbank.com/v2/transfer"

response = requests.get(path)
transferList = response["transfers"]
cursor = response["cursor"]

print(cursor)  # CkYKFAoHY3JlYXRlZBIJCMWGnoWVoukCEipqE2l-YXBpLW1zLWNoYXJnZS1zYnhyEwsSBkNoYXJnZRiAgICC28rtCAwYACAB

nextResponse = request.get(path + "?cursor=" + cursor)
transferList += nextResponse["transfers"]
nextCursor = nextResponse["cursor"]

...

Date & Time

All dates returned by our API will be in UTC ISO format. That means no matter where you are, you will always receive UTC times and should handle conversions to local time on your end whenever needed.

Example
2018-12-29T18:27:12.343531+00:00

Workspace

Workspaces are bank accounts. They have independent balances, statements, operations and permissions. The only property that is shared between your workspaces is the link they have to your organization, which carries your basic information, such as tax ID, name, etc...

The main reason for automating the creation of multiple Workspaces is to use our infrastructure to divide your own customers into different buckets, setting them up with isolated balances and statements.

The Workspace object

Attributes

id STRING

Unique identifier for the workspace.

allowedTaxIds LIST OF STRINGS

Tax IDs allowed to send Deposits to this workspace. If empty, all are allowed.

created STRING

Creation datetime of the workspace. Example: "2020-04-23T23:00:00.000000+00:00".

name STRING

Display name of the workspace shown in the Web Banking interface.

organizationId STRING

ID of the organization that owns this workspace.

pictureUrl STRING

URL of the workspace profile picture.

status STRING

Current workspace status. Options: "active", "blocked".

username STRING

Unique URL-safe identifier for the workspace. This is part of the Workspace Web Banking URL.

Create a Workspace

Here you can create a brand new Workspace.

Note: Only Organization credentials are able to create Workspaces.

Parameters

name REQUIRED

This string will show up to identify your Workspace when you log into it at our Web Banking. Example: 'My Workspace'

username REQUIRED

This string uniquely identifies the Workspace in our entire database. It is also part of the Workspace Web Banking URL and must, therefore, be URL-safe. For example, if a Workspace in Sandbox has the 'my-workspace' username, its URL would be "https://my-workspace.sandbox.starkbank.com"

allowedTaxIds OPTIONAL

List of tax IDs that will be allowed to send Deposits to this Workspace. If empty, all are allowed. Example:

[
    "012.345.678-90",
    "20.018.183/0001-80"
]
ENDPOINT
POST /v2/workspace
REQUEST

Python

import starkbank

workspace = starkbank.workspace.create(
    username="iron-bank-123",
    name="Iron Bank #123"
)

print(workspace)

Javascript

const starkbank = require('starkbank');

(async() => {
    let workspace = await starkbank.workspace.create({
        username: 'iron-bank-123',
        name: 'Iron Bank #123'
    });

    console.log(workspace);
})();

PHP

$workspace = StarkBank\\Workspace::create([
    "username" => "iron-bank-123",
    "name" => "Iron Bank #123"
]);

print_r($workspace);

Java

import com.starkbank.*;
import java.util.HashMap;

HashMap<String, Object> data = new HashMap<>();
data.put("username", "my-workspace");
data.put("name", "Iron Bank #123");
Workspace workspace = Workspace.create(data);

System.out.println(workspace);

Ruby

require('starkbank')

workspace = StarkBank::Workspace.create(
    username: 'iron-bank-123',
    name: 'Iron Bank #123'
)

puts workspace

Elixir

workspace = StarkBank.Workspace.create!(
    username: "iron-bank-123",
    name: "Iron Bank #123"
)

workspace |> IO.inspect

C#

using System;

StarkBank.Workspace workspace = StarkBank.Workspace.Create(
    username: "iron-bank-123",
    name: "Iron Bank #123"
);

Go

package main

import (
    "fmt"
    "github.com/starkbank/sdk-go/starkbank/workspace"
)

func main() {

    workspace, err := workspace.Create(
        workspace.Workspace{
            Username: "iron-bank-123",
            Name:     "Iron Bank #123",
        }, nil)
    if err.Errors != nil {
        for _, e := range err.Errors {
            fmt.Printf("code: %s, message: %s", e.Code, e.Message)
        }
    }

    fmt.Printf("%+v", workspace)
}

Clojure

(def workspace
  (starkbank.workspace/create
    {
      :username "iron-bank-123"
      :name "Iron Bank #123"
    }))
(dorun (map println workspace))

Curl

curl --location --request POST '{{baseUrl}}/v2/workspace' \r
--header 'Access-Id: {{accessId}}' \r
--header 'Access-Time: {{accessTime}}' \r
--header 'Access-Signature: {{accessSignature}}' \r
--header 'Content-Type: application/json' \r
--data-raw '{
    "username": "iron-bank-123",
    "name": "Iron Bank #123"
}'
RESPONSE

Python

  Workspace(
    id=6225875037061120,
    username=iron-bank-123,
    name=Iron Bank #123,
    allowed_tax_ids=[],
    status=active,
    organization_id=5656565656565656,
    picture_url=https://storage.googleapis.com/api-ms-workspace-sbx.appspot.com/pictures/workspace/6341320293482496.png?20230314201348,
    created=2020-04-23 23:00:00.000000
)

Javascript

Workspace {
    id: '6225875037061120',
    username: 'iron-bank-123',
    name: 'Iron Bank #123',
    allowedTaxIds: []
    status: 'active',
    organizationId: '5656565656565656',
    pictureUrl: 'https://storage.googleapis.com/api-ms-workspace-sbx.appspot.com/pictures/workspace/6341320293482496.png?20230314201348',
    created: '2020-04-23T23:00:00.000000+00:00'
}

PHP

  StarkBank\\Workspace Object
(
    [id] => 6225875037061120
    [username] => iron-bank-123
    [name] => Iron Bank #123
    [allowedTaxIds] => Array
        (
        )

    [status] => active
    [organizationId] => 5656565656565656
    [pictureUrl] => https://storage.googleapis.com/api-ms-workspace-sbx.appspot.com/pictures/workspace/6341320293482496.png?20230314201348
    [created] => DateTime Object
    (
        [date] => 2020-04-23 23:00:00.000000
        [timezone_type] => 1
        [timezone] => +00:00
    )

)

Java

Workspace({
  "id": "6225875037061120",
  "username": "iron-bank-123",
  "name": "Iron Bank #123",
  "allowedTaxIds": [],
  "status": "active",
  "organizationId": "5656565656565656",
  "pictureUrl": "https://storage.googleapis.com/api-ms-workspace-sbx.appspot.com/pictures/workspace/6341320293482496.png?20230314201348",
  "created": "2020-04-23T23:00:00+00:00"
})

Ruby

workspace(
  id: 6225875037061120,
  username: iron-bank-123,
  name: Iron Bank #123,
  allowed_tax_ids: [],
  status: active,
  organization_id: 5656565656565656,
  picture_url: https://storage.googleapis.com/api-ms-workspace-sbx.appspot.com/pictures/workspace/6341320293482496.png?20230314201348,
  created: 2020-04-23T23:00:00+00:00
)

Elixir

  %StarkBank.Workspace{
    id: "6225875037061120",
    username: "iron-bank-123",
    name: "Iron Bank #123",
    allowed_tax_ids: [],
    status: "active",
    organization_id: "5656565656565656",
    picture_url: "https://storage.googleapis.com/api-ms-workspace-sbx.appspot.com/pictures/workspace/6341320293482496.png?20230314201348",
    created: ~U[2020-04-23 23:00:00.000000Z]
}

C#

  Workspace(
    Username: iron-bank-123,
    Name: Iron Bank #123,
    ID: 6225875037061120,
    AllowedTaxIds: {  },
    Status: active,
    OrganizationId: 5656565656565656,
    PictureUrl: https://storage.googleapis.com/api-ms-workspace-sbx.appspot.com/pictures/workspace/6341320293482496.png?20230314201348,
    Created: 04/23/2020 23:00:00
)

Go

  {
    Id:6225875037061120
    Username:iron-bank-123
    Name:Iron Bank #123
    AllowedTaxIds:[]
    Status:active
    OrganizationId:5656565656565656
    PictureUrl:https://storage.googleapis.com/api-ms-workspace-sbx.appspot.com/pictures/workspace/6341320293482496.png?20230314201348
    Created:2020-04-23 23:00:00.000000 +0000 +0000
}

Clojure

  {:id "6225875037061120",
 :username "iron-bank-123",
 :name "Iron Bank #123"}

Curl

  {
    "message": "Workspace successfully created",
    "workspace": {
        "id": "6225875037061120",
        "username": "iron-bank-123",
        "name": "Iron Bank #123",
        "allowedTaxIds": []
        "status": "active",
        "organizationId": "5656565656565656",
        "pictureUrl": "https://storage.googleapis.com/api-ms-workspace-sbx.appspot.com/pictures/workspace/6341320293482496.png?20230314201348",
        "created": "2020-04-23T23:00:00.000000+00:00"
    }
}

List Workspaces

Get a list of Workspaces your credentials have access to in chunks of at most 100. If you need smaller chunks, use the limit parameter.

Parameters

cursor OPTIONAL

String used to get the next batch of results. Our SDKs handle this for you.

fields OPTIONAL

List of strings to filter response JSON keys. Not available in the SDKs.

ids OPTIONAL

List of IDs of the Workspaces to be retrieved.

limit OPTIONAL

Number of results per cursor. Max = 100.

username OPTIONAL

Workspace username to be searched.

ENDPOINT
GET /v2/workspace
REQUEST

Python

import starkbank

workspaces = starkbank.workspace.query()

for workspace in workspaces:
    print(workspace)

Javascript

const starkbank = require('starkbank');

(async() => {
    let workspaces = await starkbank.workspace.query();

    for await (let workspace of workspaces) {
        console.log(workspace);
    }
})();

PHP

  workspaces = StarkBank\\Workspace::query();

foreach($workspaces as $workspace){
    print_r($workspace);
}

Java

import com.starkbank.*;
import com.starkbank.utils.Generator;

Generator<Workspace> workspaces = Workspace.query();

for (Workspace workspace : workspaces){
    System.out.println(workspace);
}

Ruby

require('starkbank')

workspaces = StarkBank::Workspace.query()

workspaces.each do |workspace|
    puts workspace
end

Elixir

workspaces = StarkBank.Workspace.query!()

for workspace <- workspaces do
    workspace |> IO.inspect
end

C#

using System;
using System.Collections.Generic;

IEnumerable<StarkBank.Workspace> workspaces = StarkBank.Workspace.Query();

foreach(StarkBank.Workspace workspace in workspaces)
{
    Console.WriteLine(workspace);
}

Go

package main

import (
    "fmt"
    "github.com/starkbank/sdk-go/starkbank/workspace"
)

func main() {

    workspaces, errorChannel := workspace.Query(nil, nil)

    loop:
    for {
        select {
        case err := <-errorChannel:
            if err.Errors != nil {
                for _, e := range err.Errors {
                    fmt.Printf("code: %s, message: %s", e.Code, e.Message)
                }
            }
        case workspace, ok := <-workspaces:
            if !ok {
                break loop
            }
            fmt.Printf("%+v", workspace)
        }
    }
}

Clojure

  def workspaces (starkbank.workspace/query))
(dorun (map println workspaces))

Curl

curl --location --request GET '{{baseUrl}}/v2/workspace' \r
--header 'Access-Id: {{accessId}}' \r
--header 'Access-Time: {{accessTime}}' \r
--header 'Access-Signature: {{accessSignature}}'
RESPONSE

Python

Workspace(
    id=6225875037061120,
    username=iron-bank-123,
    name=Iron Bank #123,
    allowed_tax_ids=[],
    status=active,
    organization_id=5656565656565656
    picture_url=https://storage.googleapis.com/api-ms-workspace-sbx.appspot.com/pictures/workspace/6341320293482496.png?20230314201348,
    created=2020-04-23 23:00:00.000000,
)

Javascript

Workspace {
    id: '6225875037061120',
    username: 'iron-bank-123',
    name: 'Iron Bank #123',
    allowedTaxIds: []
    status: 'active',
    organizationId: '5656565656565656'
    pictureUrl: 'https://storage.googleapis.com/api-ms-workspace-sbx.appspot.com/pictures/workspace/6341320293482496.png?20230314201348',
    created: '2020-04-23T23:00:00.000000+00:00'
}

PHP

StarkBank\\Workspace Object
(
    [id] => 6225875037061120
    [username] => iron-bank-123
    [name] => Iron Bank #123
    [allowedTaxIds] => Array
        (
        )

    [status] => active,
    [organizationId] => 5656565656565656
    [pictureUrl] => https://storage.googleapis.com/api-ms-workspace-sbx.appspot.com/pictures/workspace/6341320293482496.png?20230314201348
    [created] => DateTime Object
    (
        [date] => 2020-04-23 23:00:00.000000
        [timezone_type] => 1
        [timezone] => +00:00
    )

)

Java

Workspace({
  "id": "6225875037061120",
  "username": "iron-bank-123",
  "name": "Iron Bank #123",
  "allowedTaxIds": [],
  "status": "active",
  "organizationId": "5656565656565656",
  "pictureUrl": "https://storage.googleapis.com/api-ms-workspace-sbx.appspot.com/pictures/workspace/6341320293482496.png?20230314201348",
  "created": "2020-04-23T23:00:00+00:00"
})

Ruby

workspace(
  id: 6225875037061120,
  username: iron-bank-123,
  name: Iron Bank #123,
  allowed_tax_ids: [],
  status: active,
  organization_id: 5656565656565656,
  picture_url: https://storage.googleapis.com/api-ms-workspace-sbx.appspot.com/pictures/workspace/6341320293482496.png?20230314201348,
  created: 2020-04-23T23:00:00+00:00
)

Elixir

  StarkBank.Workspace{
    id: "6225875037061120",
    username: "iron-bank-123",
    name: "Iron Bank #123",
    allowed_tax_ids: [],
    status: "active",
    organization_id: "5656565656565656",
    picture_url: "https://storage.googleapis.com/api-ms-workspace-sbx.appspot.com/pictures/workspace/6341320293482496.png?20230314201348",
    created: ~U[2020-04-23 23:00:00.000000Z],
}

C#

Workspace(
    Username: iron-bank-123,
    Name: Iron Bank #123,
    ID: 6225875037061120,
    AllowedTaxIds: {  },
    Status: active,
    OrganizationId: 5656565656565656,
    PictureUrl: https://storage.googleapis.com/api-ms-workspace-sbx.appspot.com/pictures/workspace/6341320293482496.png?20230314201348,
    Created: 04/23/2020 23:00:00,
)

Go

{
    Id:6225875037061120
    Username:iron-bank-123
    Name:Iron Bank #123
    AllowedTaxIds:[]
    Status:active
    OrganizationId:5656565656565656
    PictureUrl:https://storage.googleapis.com/api-ms-workspace-sbx.appspot.com/pictures/workspace/6341320293482496.png?20230314201348
    Created:2020-04-23 23:00:00.000000 +0000 +0000
}

Clojure

{:id "6225875037061120",
 :username "iron-bank-123",
 :name "Iron Bank #123"}

Curl

{
    "cursor": null,
    "workspaces": [
        {
            "id": "6225875037061120",
            "username": "iron-bank-123",
            "name": "Iron Bank #123",
            "allowedTaxIds": []
            "status": "active",
            "organizationId": "5656565656565656",
            "pictureUrl": "https://storage.googleapis.com/api-ms-workspace-sbx.appspot.com/pictures/workspace/6341320293482496.png?20230314201348",
            "created": "2020-04-23T23:00:00.000000+00:00"
        }
    ]
}

Get a Workspace

Get a single workspace by its id.

Parameters

id REQUIRED

Id of the workspace entity.

fields OPTIONAL

List of strings to filter response JSON keys. Not available in the SDKs.

ENDPOINT
GET /v2/workspace/:id
REQUEST

Python

import starkbank

workspace = starkbank.workspace.get("6225875037061120")

print(workspace)

Javascript

const starkbank = require('starkbank');

(async() => {
    let workspace = await starkbank.workspace.get('6225875037061120');
    console.log(workspace);
})();

PHP

$workspace = StarkBank\\Workspace::get("6225875037061120");

print_r($workspace);

Java

import com.starkbank.*;

Workspace workspace = Workspace.get("6225875037061120");

System.out.println(workspace);

Ruby

require('starkbank')

workspace = StarkBank::Workspace.get('6225875037061120')

puts workspace

Elixir

workspace = StarkBank.Workspace.get!("6225875037061120")

workspace |> IO.inspect

C#

using System;

StarkBank.Workspace workspace = StarkBank.Workspace.Get("6225875037061120");

Console.WriteLine(workspace);

Go

package main

import (
    "fmt"
    "github.com/starkbank/sdk-go/starkbank/workspace"
)

func main() {

    workspace, err := workspace.Get("6225875037061120", nil)
    if err.Errors != nil {
        for _, e := range err.Errors {
            fmt.Printf("code: %s, message: %s", e.Code, e.Message)
        }
    }

    fmt.Printf("%+v", workspace)
}

Clojure

(def workspace (starkbank.workspace/get "6225875037061120"))
(println workspace)

Curl

curl --location --request GET '{{baseUrl}}/v2/workspace/6225875037061120' \r
--header 'Access-Id: {{accessId}}' \r
--header 'Access-Time: {{accessTime}}' \r
--header 'Access-Signature: {{accessSignature}}'
RESPONSE

Python

Workspace(
    id=6225875037061120,
    username=iron-bank-123,
    name=Iron Bank #123,
    allowed_tax_ids=[],
    status=active,
    organization_id=5656565656565656
    picture_url=https://storage.googleapis.com/api-ms-workspace-sbx.appspot.com/pictures/workspace/6341320293482496.png?20230314201348,
    created=2020-04-23 23:00:00.000000
)

Javascript

Workspace {
    id: '6225875037061120',
    username: 'iron-bank-123',
    name: 'Iron Bank #123',
    allowedTaxIds: []
    status: 'active',
    organizationId: '5656565656565656'
    pictureUrl: 'https://storage.googleapis.com/api-ms-workspace-sbx.appspot.com/pictures/workspace/6341320293482496.png?20230314201348',
    created: '2020-04-23T23:00:00.000000+00:00'
}

PHP

StarkBank\\Workspace Object
(
    [id] => 6225875037061120
    [username] => iron-bank-123,
    [name] => Iron Bank #123,
    [allowedTaxIds] => Array
        (
        )

    [status] => active,
    [organizationId] => 5656565656565656,
    [pictureUrl] => https://storage.googleapis.com/api-ms-workspace-sbx.appspot.com/pictures/workspace/6341320293482496.png?20230314201348
    [created] => DateTime Object
    (
        [date] => 2020-04-23 23:00:00.000000
        [timezone_type] => 1
        [timezone] => +00:00
    )

)

Java

Workspace({
  "id": "6225875037061120",
  "username": "iron-bank-123",
  "name": "Iron Bank #123",
  "allowedTaxIds": [],
  "status": "active",
  "organizationId": "5656565656565656",
  "pictureUrl": "https://storage.googleapis.com/api-ms-workspace-sbx.appspot.com/pictures/workspace/6341320293482496.png?20230314201348",
  "created": "2020-04-23T23:00:00+00:00"
})

Ruby

workspace(
  id: 6225875037061120,
  username: iron-bank-123,
  name: Iron Bank #123,
  allowed_tax_ids: [],
  status: active
  organization_id: 5656565656565656,
  picture_url: https://storage.googleapis.com/api-ms-workspace-sbx.appspot.com/pictures/workspace/6341320293482496.png?20230314201348,
  created: 2020-04-23T23:00:00+00:00
)

Elixir

%StarkBank.Workspace{
    id: "6225875037061120",
    username: "iron-bank-123",
    name: "Iron Bank #123",
    allowed_tax_ids: [],
    status: "active",
    organization_id: "5656565656565656",
    picture_url: "https://storage.googleapis.com/api-ms-workspace-sbx.appspot.com/pictures/workspace/6341320293482496.png?20230314201348",
    created: ~U[2020-04-23 23:00:00.000000Z]
}

C#

Workspace(
    Username: iron-bank-123,
    Name: Iron Bank #123,
    ID: 6225875037061120,
    AllowedTaxIds: {  },
    Status: active,
    OrganizationId: 5656565656565656,
    PictureUrl: https://storage.googleapis.com/api-ms-workspace-sbx.appspot.com/pictures/workspace/6341320293482496.png?20230314201348,
    Created: 04/23/2020 23:00:00
)

Go

  {
    Id:6225875037061120
    Username:iron-bank-123
    Name:Iron Bank #123
    AllowedTaxIds:[]
    Status:active
    OrganizationId:5656565656565656
    PictureUrl:https://storage.googleapis.com/api-ms-workspace-sbx.appspot.com/pictures/workspace/6341320293482496.png?20230314201348
    Created:2020-04-23 23:00:00.000000 +0000 +0000
}

Clojure

{:id "6225875037061120",
 :username "iron-bank-123",
 :name "Iron Bank #123"}

Curl

  {
    "workspace": {
        "id": "6225875037061120",
        "username": "iron-bank-123",
        "name": "Iron Bank #123",
        "allowedTaxIds": []
        "status": "active",
        "organizationId": "5656565656565656",
        "pictureUrl": "https://storage.googleapis.com/api-ms-workspace-sbx.appspot.com/pictures/workspace/6341320293482496.png?20230314201348",
        "created": "2020-04-23T23:00:00.000000+00:00"
    }
}

Update a Workspace

Update a workspace by passing its id and the fields you want to update.

Parameters

id REQUIRED

Id of the workspace.

allowedTaxIds OPTIONAL

List of tax IDs that will be allowed to send Deposits to this Workspace. If empty, all are allowed. Example:

[
    "012.345.678-90",
    "20.018.183/0001-80"
]

name OPTIONAL

Full name that identifies the Workspace. This name will appear when people access the Workspace on our platform, for example. Example: 'Stark Bank Workspace'

picture OPTIONAL

Binary buffer of the picture. Example: open("path/to/picture.png", "rb").read()

pictureType CONDITIONALLY REQUIRED

Picture mime type. This parameter will be required if the picture parameter is informed. Example: 'image/png' or 'image/jpeg'

status OPTIONAL

You can block or activate a specific Workspace. Example: 'active' or 'blocked'

username OPTIONAL

Simplified name to define the workspace URL. This name must be unique across all Stark Bank Workspaces. Example: 'starkbank-workspace'

ENDPOINT
PATCH /v2/workspace/:id
REQUEST

Python

import starkbank

picture = open("path/to/picture.png", "rb").read()

workspace = starkbank.workspace.update(
    "6225875037061120",
    username="new-username",
    name="New Name",
    allowed_tax_ids=["012.345.678-90"],
    picture=picture,
    picture_type="image/png",
    status="blocked",
)

print(workspace)

Javascript

const starkbank = require('starkbank');
const fs = require('fs');

(async() => {
    let file = fs.readFileSync('/path/to/file.png');

    let workspace = await starkbank.workspace.update('6225875037061120', {
        username: 'new-username',
        name: 'New Name',
        picture: file,
        pictureType: 'image/png',
        status: 'blocked',
        allowedTaxIds: ['012.345.678-90']
    });
    console.log(workspace);
})();

PHP

use StarkBank\\Workspace;

$file = file_get_contents("/path/to/file.png");

$workspace = Workspace::update(
    "6225875037061120",
    [
        "username" => "new-username",
        "name" => "New Name",
        "status" => "blocked",
        "picture" => file,
        "pictureType" => "image/png",
        "allowedTaxIds" => ["012.345.678-90"]
    ]
);

print_r($workspace);

Java

import com.starkbank.*;

File file = new File("/path/to/file.png");
byte[] fileBytes = Files.readAllBytes(file.toPath());

HashMap<String, Object> patchData = new HashMap<>();
patchData.put("username", "new-username");
patchData.put("name", "New Name");
patchData.put("status", "blocked");
patchData.put("picture", file);
patchData.put("pictureType", "image/png");
patchData.put("allowedTaxIds", new String[]{"012.345.678-90"});

Workspace workspace = Workspace.update("6225875037061120", patchData);

System.out.println(workspace);

Ruby

require('starkbank')

file = open('/path/to/file.png', 'rb')
image = file.read
file.close

workspace = StarkBank::Workspace.update(
    "6225875037061120",
    username: 'new-username',
    name: 'New Name',
    status: 'blocked'
    picture: image,
    picture_type: 'image/png',
    allowed_tax_ids: %w[012.345.678-90]
)

puts(workspace)

Elixir

{:ok, image} = File.read("/path/to/file.png")

workspace = StarkBank.Workspace.update(
    "6225875037061120",
    username: "new-username",
    status: "blocked",
    name: "New Name"
    picture: image,
    picture_type: "image/png",
    subscriptions: ["012.345.678-90"]
) |> IO.inspect

C#

byte[] image = File.ReadAllBytes("/path/to/file.png");

Workspace workspace = Workspace.Update(
    "6225875037061120",
    username: "new-username",
    name: "New Name",
    status: "blocked",
    picture: image,
    pictureType: "image/png",
    allowedTaxIds: new List<string> { "012.345.678-90" }
);

Console.WriteLine(workspace);

Go

package main

import (
    "fmt"
    "github.com/starkbank/sdk-go/starkbank/invoice"
)

func main() {

    file, _ := ioutil.ReadFile("file.png")

    var patchData = map[string]interface{}{}
    patchData["username"] = "new-username"
    patchData["name"] = "New Name"
    patchData["status"] = "blocked"
    patchData["picture"] = file
    patchData["picture_type"] = "image/png"
    patchData["allowedTaxIds"] = []string{"012.345.678-90"}

    workspace, err := Workspace.Update("6225875037061120", patchData, nil)
    if err.Errors != nil {
        for _, e := range err.Errors {
            fmt.Printf("code: %s, message: %s", e.Code, e.Message)
        }
    }

    fmt.Printf("%+v", workspace)
}

Clojure

Not yet available. Please contact us if you need this SDK.

Curl

curl --location --request PATCH '{{baseUrl}}/v2/workspace/6225875037061120' \r
--header 'Access-Id: {{accessId}}' \r
--header 'Access-Time: {{accessTime}}' \r
--header 'Access-Signature: {{accessSignature}}' \r
--header 'Content-Type: application/json' \r
--data-raw '{
    "username": "new-username",
    "name": "New Name",
    "status": "blocked",
    "allowedTaxIds": ["012.345.678-90"]
}'
RESPONSE

Python

Workspace(
    id=6225875037061120,
    username=new-username,
    name=New Name,
    allowed_tax_ids=['012.345.678-90'],
    status=blocked,
    organization_id=5656565656565656,
    picture_url=https://storage.googleapis.com/api-ms-workspace-sbx.appspot.com/pictures/workspace/6341320293482496.png?20230314201348,
    created=2020-04-23 23:00:00.000000
)

Javascript

Workspace {
    id: '6225875037061120',
    username: 'new-username',
    name: 'New Name',
    allowedTaxIds: ['012.345.678-90'],
    status: 'blocked',
    organizationId: '5656565656565656',
    pictureUrl: 'https://storage.googleapis.com/api-ms-workspace-sbx.appspot.com/pictures/workspace/6341320293482496.png?20230314201348',
    created: '2020-04-23T23:00:00.000000+00:00'
}

PHP

StarkBank\\Workspace Object
(
    [id] => 6225875037061120
    [username] => new-username
    [name] => New Name
    [allowedTaxIds] => Array
        (
            [0] => 012.345.678-90
        )

    [status] => blocked
    [organizationId] => 5656565656565656
    [pictureUrl] => https://storage.googleapis.com/api-ms-workspace-sbx.appspot.com/pictures/workspace/6341320293482496.png?20230314201348
    [created] => DateTime Object
    (
        [date] => 2020-04-23 23:00:00.000000
        [timezone_type] => 1
        [timezone] => +00:00
    )

)

Java

Workspace({
    "username": "new-username",
    "name": "New Name",
    "allowedTaxIds": ['012.345.678-90'],
    "status": "blocked",
    "organizationId": "5656565656565656",
    "pictureUrl": "https://storage.googleapis.com/api-ms-workspace-sbx.appspot.com/pictures/workspace/6341320293482496.png?20230314201348",
    "created": "2020-04-23T23:00:00+00:00"
    "id": "6225875037061120"
})

Ruby

workspace(
    id: 6225875037061120,
    username: new-username,
    name: New Name,
    allowed_tax_ids: ['012.345.678-90'],
    status: blocked,
    organization_id: 5656565656565656,
    picture_url: https://storage.googleapis.com/api-ms-workspace-sbx.appspot.com/pictures/workspace/6341320293482496.png?20230314201348,
    created: 2020-04-23T23:00:00+00:00
)

Elixir

  StarkBank.Workspace{
    id: "6225875037061120",
    username: "new-username",
    name: "New Name",
    allowed_tax_ids: ['012.345.678-90'],
    status: "blocked",
    organization_id: "5656565656565656",
    picture_url: "https://storage.googleapis.com/api-ms-workspace-sbx.appspot.com/pictures/workspace/6341320293482496.png?20230314201348",
    created: ~U[2020-04-23 23:00:00.000000Z]
}

C#

Workspace(
    Username: new-username,
    AllowedTaxIds: { 012.345.678-90 },
    Name: New Name,
    Status: blocked,
    OrganizationId: 5656565656565656,
    PictureUrl: https://storage.googleapis.com/api-ms-workspace-sbx.appspot.com/pictures/workspace/6341320293482496.png?20230314201348,
    Created: 04/23/2020 23:00:00
    ID: 6225875037061120
)

Go

{
    Id: 6225875037061120
    Username: new-username
    Name: New Name
    AllowedTaxIds: ['012.345.678-90'],
    Status: blocked
    OrganizationId: 5656565656565656
    PictureUrl: https://storage.googleapis.com/api-ms-workspace-sbx.appspot.com/pictures/workspace/6341320293482496.png?20230314201348
    Created:2020-04-23 23:00:00.000000 +0000 +0000
}

Clojure

Not yet available. Please contact us if you need this SDK.

Curl

{
    "workspace": {
        "allowedTaxIds": ["012.345.678-90"],
        "created": "2020-04-23T23:00:00.000000+00:00"
        "id": "6225875037061120",
        "name": "New Name",
        "organizationId": "5656565656565656",
        "pictureUrl": "https://storage.googleapis.com/api-ms-workspace-sbx.appspot.com/pictures/workspace/6341320293482496.png?20230314201348",
        "status": "blocked",
        "username": "new-username"
    }
}

Balance

The balance entity holds the total funds available in your workspace and can be calculated as the sum of its transactions (cash-in + cash-out).

Therefore, you can also interpret Transactions as balance change logs.

The Balance object

Attributes

id STRING

Unique identifier for the balance.

amount INTEGER

Current balance amount in cents of reais.

currency STRING

Currency code of the balance. Example: "BRL".

updated STRING

Last update datetime of the balance. Example: "2020-04-23T23:00:00.000000+00:00".

Get the Balance

Get the current balance in your workspace.

ENDPOINT
GET /v2/balance
REQUEST

Python

import starkbank

balance = starkbank.balance.get()

print(balance)
  

Javascript

const starkbank = require('starkbank');

(async() => {
    let balance = await starkbank.balance.get();

    console.log(balance);
})();
  

PHP

$balance = StarkBank\Balance::get();

print_r($balance);
  

Java

import com.starkbank.*;

Balance balance = Balance.get();

System.out.println(balance);
  

Ruby

require('starkbank')

balance = StarkBank::Balance.get()

puts balance
  

Elixir

balance = StarkBank.Balance.get!()

balance |> IO.inspect
  

C#

using System;

StarkBank.Balance balance = StarkBank.Balance.Get();

Console.WriteLine(balance);
  

Go

package main

import (
    "fmt"
    "github.com/starkbank/sdk-go/starkbank/balance"
)

func main() {

    balance, err := balance.Get(nil)

    if err.Errors != nil {
        for _, e := range err.Errors {
            fmt.Printf("code: %s, message: %s", e.Code, e.Message)
        }
    }

    fmt.Printf("%+v", balance)
}
  

Clojure

(def balance (starkbank.balance/get))

(println balance)
  

Curl

curl --location --request GET '{{baseUrl}}/v2/balance' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}'
  
RESPONSE

Python

Balance(
    amount=5419070393,
    currency=BRL,
    id=5083989094170624,
    updated=2020-04-24 17:44:48.912604
)
  

Javascript

Balance {
    id: '5083989094170624',
    amount: 5419070393,
    currency: 'BRL',
    updated: '2020-04-24T17:44:48.912604+00:00'
}
  

PHP

StarkBank\Balance Object
(
    [id] => 5083989094170624
    [amount] => 5419070393
    [currency] => BRL
    [updated] => DateTime Object
        (
            [date] => 2020-04-24 17:44:48.912604
            [timezone_type] => 1
            [timezone] => +00:00
        )

)
  

Java

Balance({
    "amount": 5419070393,
    "currency": "BRL",
    "updated": "2020-04-24T17:44:48.912604+00:00",
    "id": "5083989094170624"
})
  

Ruby

balance(
    id: 5083989094170624,
    amount: 5419070393,
    currency: BRL,
    updated: 2020-04-24T17:44:48+00:00
)
  

Elixir

%StarkBank.Balance{
    amount: 5419070393,
    currency: "BRL",
    id: "5083989094170624",
    updated: ~U[2020-04-24 17:44:48.912604Z]
}
  

C#

Balance(
    Amount: 5419070393,
    Currency: BRL,
    Updated: 04/24/2020 17:44:048,
    ID: 5083989094170624
)
  

Go

{
    Id:5083989094170624
    Amount:5419070393
    Currency:BRL
    Updated:2020-04-24 17:44:48.912604 +0000 +0000
}
  

Clojure

{:id "5083989094170624",
 :amount 5419070393,
 :currency "BRL",
 :updated "2020-04-24T17:44:48.912604+00:00"}
  

Curl

{
    "cursor": null,
    "balances": [
        {
            "id": "5083989094170624",
            "amount": 5419070393,
            "currency": "BRL",
            "updated": "2020-04-24T17:44:48.912604+00:00",
        }
    ]
}
  

Transaction

Since Stark Bank is centralized, we have a private ledger to keep track of all transactions. It's important to understand that every financial operation in Stark Bank generates a transaction that is registered in our ledger.

You may directly generate a Transaction when you transfer money between workspaces in Stark Bank. Other times, we generate the Transaction for you, when you make a Transfer, pay a Boleto or receive money from a paid Boleto, for example.

The Transaction object

Attributes

id STRING

Unique identifier for the transaction.

amount INTEGER

Transaction amount in cents of reais. Negative values represent cash-out.

balance INTEGER

Balance in cents of reais after the transaction was processed.

created STRING

Creation datetime of the transaction. Example: "2020-04-23T23:00:00.000000+00:00".

description STRING

Description of the transaction.

externalId STRING

Unique external identifier for the transaction.

fee INTEGER

Fee charged by the transaction in cents of reais.

receiverId STRING

ID of the workspace that received the amount.

senderId STRING

ID of the workspace that sent the amount.

source STRING

Reference to the operation that generated this transaction. Example: transfer/1234567890

tags LIST OF STRINGS

Tags associated with the transaction.

List Transactions

Your bank statement is the list of all transactions registered in your private ledger.

We return it paged.

Parameters

after OPTIONAL

Filter entities created after this date.

before OPTIONAL

Filter entities created before this date.

cursor OPTIONAL

String used to get the next batch of results. Our SDKs handle this for you.

externalIds OPTIONAL

Filter transactions that carry the specified external IDs.

fields OPTIONAL

List of strings to filter response JSON keys. Not available in the SDKs.

ids OPTIONAL

List of strings to get specific entities by ids.

limit OPTIONAL

Number of results per cursor. Max = 100.

tags OPTIONAL

Filter entities that contain the specified tags.

ENDPOINT
GET /v2/transaction
REQUEST

Python

import starkbank

transactions = starkbank.transaction.query(
    after="2020-04-01",
    before="2020-04-30"
)

for transaction in transactions:
    print(transaction)
  

Javascript

const starkbank = require('starkbank');

(async() => {
    let transactions = await starkbank.transaction.query({
        after: '2020-04-01',
        before: '2020-04-30'
    });

    for await (let transaction of transactions) {
        console.log(transaction);
    }
})();
  

PHP

$transactions = StarkBank\Transaction::query([
  "after" => "2020-04-01",
  "before" => "2020-04-30"
]);

foreach($transactions as $transaction){
    print_r($transaction);
}
  

Java

import com.starkbank.*;
import com.starkbank.utils.Generator;
import java.util.HashMap;

HashMap<String, Object> params = new HashMap<>();
params.put("after", "2020-04-01");
params.put("before", "2020-04-30");
Generator<Transaction> transactions = Transaction.query(params);

for (Transaction transaction : transactions){
    System.out.println(transaction);
}
  

Ruby

require('starkbank')

transactions = StarkBank::Transaction.query(
    after: '2020-04-01',
    before: '2020-04-30'
)

transactions.each do |transaction|
    puts transaction
end
  

Elixir

transactions = StarkBank.Transaction.query!(
    after: "2020-04-01",
    before: "2020-04-30"
)

for transaction <- transactions do
    transaction |> IO.inspect
end
  

C#

using System;
using System.Collections.Generic;

IEnumerable<StarkBank.Transaction> transactions = StarkBank.Transaction.Query(
    after: new DateTime(2020, 4, 1),
    before: new DateTime(2020, 4, 30)
);

foreach(StarkBank.Transaction transaction in transactions)
{
    Console.WriteLine(transaction);
}
  

Go

package main

import (
    "fmt"
    "time"
    "github.com/starkbank/sdk-go/starkbank/transaction"
)

func main() {

    var params = map[string]interface{}{}
    params["after"] = time.Date(2020, 4, 1, 0, 0, 0, 0, time.UTC)
    params["before"] = time.Date(2020, 4, 30, 0, 0, 0, 0, time.UTC)

    transactions, errorChannel := transaction.Query(params, nil)

    loop:
    for {
        select {
        case err := <-errorChannel:
            if err.Errors != nil {
                for _, e := range err.Errors {
                    fmt.Printf("code: %s, message: %s", e.Code, e.Message)
                }
            }
        case transaction, ok := <-transactions:
            if !ok {
                break loop
            }
            fmt.Printf("%+v", transaction)
        }
    }
}
  

Clojure

(def transactions
(starkbank.transaction/query
    {
      :after "2020-04-01"
      :before "2020-04-30"
    }))
(dorun (map println transactions))
  

Curl

curl --location --request GET '{{baseUrl}}/v2/transaction?after=2020-04-01&before=2020-04-30' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}'
  
RESPONSE

Python

Transaction(
    amount=-10000,
    created=2020-04-24 17:44:49.066074,
    description=A Lannister always pays his debts,
    external_id=my_unique_id,
    fee=0,
    id=5185595898855424,
    receiver_id=5651751147405312,
    sender_id=5083989094170624,
    source=self,
    balance=1567891,
    tags=['lannister', 'debts']
)
  

Javascript

Transaction {
    id: '5185595898855424',
    amount: -10000,
    description: 'A Lannister always pays his debts',
    externalId: 'my_unique_id',
    receiverId: 5651751147405312,
    tags: [ 'lannister', 'debts' ],
    fee: 0,
    created: '2020-04-24T17:44:49.941477+00:00',
    source: 'self',
    balance: 1567891,
    senderId: 5083989094170624
}
  

PHP

StarkBank\Transaction Object
(
    [id] => 5185595898855424
    [amount] => -10000
    [description] => A Lannister always pays his debts
    [externalId] => my_unique_id
    [receiverId] => 5651751147405312
    [senderId] => 5083989094170624
    [tags] => Array
        (
            [0] => lannister
            [1] => debts
        )

    [fee] => 0
    [created] => DateTime Object
        (
            [date] => 2020-04-24 17:44:49.045400
            [timezone_type] => 1
            [timezone] => +00:00
        )

    [source] => self
    [balance] => 1567891
)
  

Java

Transaction({
    "amount": -10000,
    "description": "A Lannister always pays his debts",
    "externalId": "my_unique_id",
    "receiverId": "5651751147405312",
    "senderId": "5083989094170624",
    "tags": ["lannister", "debts"],
    "fee": 0,
    "created": "2020-04-24T17:44:49.315403+00:00",
    "source": "self",
    "balance": 1567891,
    "id": "5185595898855424"
})
  

Ruby

transaction(
    id: 5185595898855424,
    amount: -10000,
    description: A Lannister always pays his debts,
    external_id: my_unique_id,
    receiverId: 5651751147405312,
    senderId: 5083989094170624,
    tags: ["lannister", "debts"],
    fee: 0,
    source: self,
    balance: 1567891,
    created: 2020-04-24T17:44:49+00:00
)
  

Elixir

%StarkBank.Transaction{
    amount: -10000,
    created: "2020-04-24T17:44:49.498971+00:00",
    description: "A Lannister always pays his debts",
    external_id: "my_unique_id",
    fee: 0,
    id: "5185595898855424",
    receiver_id: "5651751147405312",
    sender_id: "5083989094170624",
    source: "self",
    balance: 1567891,
    tags: ["lannister", "debts"]
}
  

C#

Transaction(
    Amount: -10000,
    ExternalID: my_unique_id,
    ReceiverID: 5651751147405312,
    SenderID: 5083989094170624,
    Tags: { lannister, debts },
    Fee: 0,
    Description: A Lannister always pays his debts,
    Source: self,
    Balance: 1567891,
    Created: 04/24/2020 17:44:49,
    ID: 5185595898855424
)
  

Go

{
    Id:5185595898855424
    Amount:-10000
    Description:A Lannister always pays his debts
    ExternalId:my_unique_id
    ReceiverId:5651751147405312
    Tags:[lannister debts]
    SenderId:5083989094170624
    Source:self
    Fee:0
    Balance:1567891
    Created:2020-04-24 17:44:49.628546 +0000 +0000
}
  

Clojure

{:description "A Lannister always pays his debts",
 :amount -10000,
 :fee 0,
 :tags ["lannister" "debts"],
 :created "2020-04-24T17:44:49.045400+00:00",
 :source "self",
 :external-id "my_unique_id",
 :balance 1567891,
 :id "5185595898855424",
 :sender-id "5083989094170624",
 :receiver-id "5651751147405312"}
  

Curl

{
    "cursor": null,
    "transactions": [
        {
            "id": "5185595898855424",
            "description": "A Lannister always pays his debts",
            "created": "2020-04-24T17:44:49.249976+00:00",
            "tags": ["lannister", "debts"],
            "source": "self",
            "amount": -10000,
            "externalId": "my_unique_id",
            "receiverId": "5651751147405312",
            "senderId": "5083989094170624",
            "fee": 0,
            "balance": 1567891
        },
    }
}
  

Get a Transaction

Get a single transaction by its id.

Parameters

id REQUIRED

Id of the transaction entity.

fields OPTIONAL

List of strings to filter response JSON keys. Not available in the SDKs.

ENDPOINT
GET /v2/transaction/:id
REQUEST

Python

import starkbank

transaction = starkbank.transaction.get("5185595898855424")

print(transaction)
  

Javascript

const starkbank = require('starkbank');

(async() => {
    let transaction = await starkbank.transaction.get('5185595898855424');
    console.log(transaction);
})();
  

PHP

$transaction = StarkBank\Transaction::get("5185595898855424");

print_r($transaction);
  

Java

import com.starkbank.*;

Transaction transaction = Transaction.get("5185595898855424");

System.out.println(transaction);
  

Ruby

transaction = StarkBank::Transaction.get('5185595898855424')

puts transaction
  

Elixir

transaction = StarkBank.Transaction.get!("5185595898855424")

transaction |> IO.inspect
  

C#

using System;

StarkBank.Transaction transaction = StarkBank.Transaction.Get("5185595898855424");

Console.WriteLine(transaction);
  

Go

package main

import (
    "fmt"
    "github.com/starkbank/sdk-go/starkbank/transaction"
)

func main() {

    transaction, err := transaction.Get("5185595898855424", nil)
    if err.Errors != nil {
        for _, e := range err.Errors {
            fmt.Printf("code: %s, message: %s", e.Code, e.Message)
        }
    }

    fmt.Println(transaction)
}
  

Clojure

(def transaction (starkbank.transaction/get "5185595898855424"))
(println transaction)
  

Curl

curl --location --request GET '{{baseUrl}}/v2/transaction/5185595898855424' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}'
  
RESPONSE

Python

Transaction(
    amount=-10000,
    created=2020-04-24 17:44:49.066074,
    description=A Lannister always pays his debts,
    external_id=my_unique_id,
    fee=0,
    id=5185595898855424,
    receiver_id=5651751147405312,
    sender_id=5083989094170624,
    source=self,
    balance=1567891,
    tags=['lannister', 'debts']
)
  

Javascript

Transaction {
    id: '5185595898855424',
    amount: -10000,
    description: 'A Lannister always pays his debts',
    externalId: 'my_unique_id',
    receiverId: 5651751147405312,
    tags: [ 'lannister', 'debts' ],
    fee: 0,
    created: '2020-04-24T17:44:49.941477+00:00',
    source: 'self',
    balance: 1567891,
    senderId: 5083989094170624
}
  

PHP

StarkBank\Transaction Object
(
    [id] => 5185595898855424
    [amount] => -10000
    [description] => A Lannister always pays his debts
    [externalId] => my_unique_id
    [receiverId] => 5651751147405312
    [senderId] => 5083989094170624
    [tags] => Array
        (
            [0] => lannister
            [1] => debts
        )

    [fee] => 0
    [created] => DateTime Object
        (
            [date] => 2020-04-24 17:44:49.045400
            [timezone_type] => 1
            [timezone] => +00:00
        )

    [source] => self
    [balance] => 1567891
)
  

Java

Transaction({
    "amount": -10000,
    "description": "A Lannister always pays his debts",
    "externalId": "my_unique_id",
    "receiverId": "5651751147405312",
    "senderId": "5083989094170624",
    "tags": ["lannister", "debts"],
    "fee": 0,
    "created": "2020-04-24T17:44:49.315403+00:00",
    "source": "self",
    "balance": 1567891,
    "id": "5185595898855424"
})
  

Ruby

transaction(
    id: 5185595898855424,
    amount: -10000,
    description: A Lannister always pays his debts,
    external_id: my_unique_id,
    receiverId: 5651751147405312,
    senderId: 5083989094170624,
    tags: ["lannister", "debts"],
    fee: 0,
    source: self,
    balance: 1567891,
    created: 2020-04-24T17:44:49+00:00
)
  

Elixir

%StarkBank.Transaction{
    amount: -10000,
    created: "2020-04-24T17:44:49.498971+00:00",
    description: "A Lannister always pays his debts",
    external_id: "my_unique_id",
    fee: 0,
    id: "5185595898855424",
    receiver_id: "5651751147405312",
    sender_id: "5083989094170624",
    source: "self",
    balance: 1567891,
    tags: ["lannister", "debts"]
}
  

C#

Transaction(
    Amount: -10000,
    ExternalID: my_unique_id,
    ReceiverID: 5651751147405312,
    SenderID: 5083989094170624,
    Tags: { lannister, debts },
    Fee: 0,
    Description: A Lannister always pays his debts,
    Source: self,
    Balance: 1567891,
    Created: 04/24/2020 17:44:49,
    ID: 5185595898855424
)
  

Go

{
    Id:5185595898855424
    Amount:-10000
    Description:A Lannister always pays his debts
    ExternalId:my_unique_id
    ReceiverId:5651751147405312
    Tags:[lannister debts]
    SenderId:5083989094170624
    Source:self
    Fee:0
    Balance:1567891
    Created:2020-04-24 17:44:49.628546 +0000 +0000
}
  

Clojure

{:description "A Lannister always pays his debts",
 :amount -10000,
 :fee 0,
 :tags ["lannister" "debts"],
 :created "2020-04-24T17:44:49.045400+00:00",
 :source "self",
 :external-id "my_unique_id",
 :balance 1567891,
 :id "5185595898855424",
 :sender-id "5083989094170624",
 :receiver-id "5651751147405312"}
  

Curl

{
    "transaction": {
        "id": "5185595898855424",
        "description": "A Lannister always pays his debts",
        "created": "2020-04-24T17:44:49.249976+00:00",
        "tags": ["lannister", "debts"],
        "source": "self",
        "amount": -10000,
        "externalId": "my_unique_id",
        "receiverId": "5651751147405312",
        "senderId": "5083989094170624",
        "fee": 0,
        "balance": 1567891
    }
}
  

Invoice

The Invoice resource is used to request payments from customers.

Your customer can pay it by scanning the Pix QR Code or making a deposit to the indicated account number.

You can set custom fields as fine, interest, overdue date and expiration date, for a complete charge method, much better than boleto.

If you're used to our Boleto resource, you will feel pretty familiar with the Invoice flow. In this section, we will teach you how to create and manage your Pix invoices.

You can also split the Invoice between different receivers, you need to create a Split Receiver, and add the receiver into the Splits array.

Invoice Status

Each Invoice has a status that can change over time according to its life cycle:

invoice-status

Invoice Logs

Every time either you or Stark Bank makes a change to an Invoice, we create a log. Logs are pretty useful for understanding the life cycle of each Invoice and the changes that happened to it. Here you can see the flow of possible logs: invoice-log

A paid Invoice can be either partially or fully reversed back to its payer. Multiple reversals can be made for the same invoice and each time, the following flow of logs will occur: invoice-log-reversal

The Invoice object

Attributes

id STRING

Unique id for the invoice.

amount INTEGER

Amount in cents that was received. Example: 100 (R$1.00).

brcode STRING

BR Code for the invoice Pix payment.

created STRING

Creation datetime. Example: "2020-04-23T23:00:00.000000+00:00".

descriptions LIST OF OBJECTS

List of description objects with key and value.

discountAmount INTEGER

Discount amount in cents.

discounts LIST OF OBJECTS

List of discount objects with percentage and due.

due STRING

Payment due datetime. Example: "2020-04-23T23:00:00.000000+00:00".

expiration INTEGER

Time in seconds from due datetime until expiration.

fee INTEGER

Fee charged in cents.

fine FLOAT

Percentage charged if paid after due datetime.

fineAmount INTEGER

Fine amount in cents.

interest FLOAT

Monthly percentage charged if paid after due datetime.

interestAmount INTEGER

Interest amount in cents.

link STRING

Public URL to the invoice page.

name STRING

Payer full name.

nominalAmount INTEGER

Invoice amount in cents without fine or interest.

pdf STRING

Public URL to the invoice PDF.

rules LIST OF OBJECTS

List of rule objects with key and value.

splits LIST OF OBJECTS

List of Split objects with receiverId and amount.

status STRING

Current invoice status. Options: "created", "paid", "canceled", "overdue", "expired".

tags LIST OF STRINGS

Tags associated with the invoice.

taxId STRING

Payer CPF or CNPJ.

transactionIds LIST OF STRINGS

Ledger transaction IDs linked to the invoice.

updated STRING

Last update datetime. Example: "2020-04-23T23:00:00.000000+00:00".

Create Invoices

Use this route to create up to 100 new invoices at a time.

NOTE: If you create an invoice with amount zero, we will accept any amount paid by your customer. Otherwise we will only accept the amount specified in the invoice.

Parameters

amount REQUIRED

A non-negative integer that represents the amount in cents to be invoiced. When the invoice is paid, this parameter is updated with the amount actually paid. Example: 100 (R$1.00)

name REQUIRED

Payer full name. Example: "Anthony Edward Stark"

taxId REQUIRED

Payer CPF (11 digits formatted or unformatted) or CNPJ (14 digits formatted or unformatted). Example: 012.345.678-90

descriptions OPTIONAL

List of up to 15 descriptions containing information to help the customer understand why he is being charged. For each description, you can add a title key and a description value. Example:

[
    {
        "key": "Product A",
        "value": "R$10,00"
    },
    {
        "key": "Taxes",
        "value": "R$100,00"
    }
]

discounts OPTIONAL

List of up to 5 discounts specifying the discount percentage and the limit date up to when the discount is valid. Example:

[
    {
        "percentage": 5,
        "due": "2020-11-25T17:59:26.000000+00:00"
    },
    {
        "percentage": 10.5,
        "due": "2020-10-25T17:59:26.000000+00:00"
    }
]

due OPTIONAL

Requested payment due datetime in ISO format. Example: "2020-11-25T17:59:26.000000+00:00". Default value: 2 days after creation.

expiration OPTIONAL

Time in seconds counted from the due datetime until the invoice expires. After expiration, the invoice cannot be paid anymore. Default value: 5097600 (59 days)

fine OPTIONAL

Percentage of the invoice amount charged if customer pays after the due datetime. Default value = 2.00 (2%)

interest OPTIONAL

Monthly interest, in percentage, charged if customer pays after the due datetime. Default value = 1.00 (1%)

rules OPTIONAL

List of rules for modifying invoice behavior. Example:

[
    {
        "key": "allowedTaxIds",
        "value": [
            "012.345.678-90",
            "45.059.493/0001-73"
        ]
    }
]

splits OPTIONAL

Array of Split objects to indicate payment receivers. Example:

[
    {
        "receiverId": "5742447426535424",
        "amount": 100
    },
    {
        "receiverId": "5743243941642240",
        "amount": 200
    }
]

tags OPTIONAL

Array of strings to tag the entity for future queries. All tags will be converted to lowercase.

ENDPOINT
POST /v2/invoice
REQUEST

Python

import starkbank
from datetime import datetime

invoices = starkbank.invoice.create([
    starkbank.Invoice(
        amount=400000,
        descriptions=[{'key': 'Arya', 'value': 'Not today'}],
        discounts=[{'percentage': 10, 'due': datetime(2021, 3, 12, 15, 23, 26, 689377)}],
        due=datetime(2021, 5, 12, 15, 23, 26, 689377),
        expiration=123456789,
        fine=2.5,
        interest=1.3,
        name="Arya Stark",
        tags=['War supply', 'Invoice #1234'],
        tax_id="012.345.678-90",
        rules=[
            {
                'key': 'allowedTaxIds',
                'value': [
                    '012.345.678-90',
                    '45.059.493/0001-73'
                ]
            }
        ],
        splits=[
            Split(amount=3000, receiverId="5742447426535424"), Split(amount=5000, receiverId="5743243941642240")
        ]
    )
])

for invoice in invoices:
    print(invoice)
  

Javascript

const starkbank = require('starkbank');

(async() => {
    let invoices = await starkbank.invoice.create([{
        amount: 400000,
        due: '2021-05-12T15:23:37.585+00:00',
        taxId: '012.345.678-90',
        name: 'Arya Stark',
        expiration: 123456789,
        fine: 2.5,
        interest: 1.3,
        discounts: [
            {
                'percentage': 10,
                'due': '2021-03-12T15:23:26.249976+00:00'
            }
        ],
        tags: ['War supply', 'Invoice #1234'],
        descriptions: [
            {
                'key': 'Arya',
                'value': 'Not today'
            }
        ],
        rules: [
            {
                'key': 'allowedTaxIds',
                'value': [
                    '012.345.678-90',
                    '45.059.493/0001-73'
                ]
            }
        ]
    }]);

    for (let invoice of invoices) {
        console.log(invoice);
    }
})();
  

PHP

use StarkBank\Invoice;

$invoices = [
    new Invoice([
        "amount" => 400000,
        "due" => "2021-05-12T18:00:00.000000+00:00",
        "taxId" => "012.345.678-90",
        "name" => "Arya Stark",
        "expiration" => 123456789,
        "fine" => 2.5,
        "interest" => 1.3,
        "discounts" => [
            [
                "percentage" => 10,
                "due" => "2021-03-12T18:00:00.000000+00:00"
            ]
        ],
        "tags" => [
            'War supply',
            'Invoice #1234'
        ],
        "descriptions" => [
            [
                "key" => "Arya",
                "value" => "Not today"
            ]
        ],
        "rules" => [
            {
                "key" => "allowedTaxIds",
                "value" => [
                    "012.345.678-90",
                    "45.059.493/0001-73"
                ]
            }
        ]
    ])
];

$invoice = Invoice::create($invoices);

print_r($invoice);
  

Java

import com.starkbank.*;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

List<HashMap<String, Object>> descriptions = new ArrayList<>();
HashMap<String, Object> data = new HashMap<>();
data.put("key", "Arya");
data.put("value", "Not today");
descriptions.add(data);

List<HashMap<String, Object>> rules = new ArrayList<>();
HashMap<String, Object> data = new HashMap<>();
data.put("key", "allowedTaxIds");
data.put("value", new String[]{"012.345.678-90", "45.059.493/0001-73"});
rules.add(data);

List<HashMap<String, Object>> discounts = new ArrayList<>();
HashMap<String, Object> data = new HashMap<>();
data.put("percentage", 10);
data.put("due", "2021-03-12T17:59:26.000000+00:00");
discounts.add(data);

List<Invoice> invoices = new ArrayList<>();
HashMap<String, Object> data = new HashMap<>();
data.put("amount", 400000);
data.put("due", "2021-05-12T17:59:26.000000+00:00");
data.put("taxId", "012.345.678-90");
data.put("name", "Arya Stark");
data.put("expiration", 123456789);
data.put("discounts", discounts);
data.put("descriptions", descriptions);
data.put("rules", rules);
data.put("fine", 2.5);
data.put("interest", 1.3);
data.put("tags", new String[]{"War supply", "Invoice #1234"});

invoices.add(new Invoice(data));
invoices = Invoice.create(invoices);

for (Invoice invoice : invoices) {
    System.out.println(invoice);
}
  

Ruby

require('starkbank')

invoices = StarkBank::Invoice.create(
    [
        StarkBank::Invoice.new(
            amount: 400000,
            descriptions: 
                [
                    {
                        key: 'Arya', 
                        value: 'Not today'
                    }
                ],
            discounts: 
                [
                    {
                        percentage: 10, 
                        due: '2020-04-25'
                    }
                ],
            rules:
                [
                    {
                        key: 'allowedTaxIds',
                        value: [
                            '012.345.678-90',
                            '45.059.493/0001-73'
                        ]
                    }
                ],
            tags: ['War supply', 'Invoice #1234'],
            due: Time.now + 24 * 3600,
            name: 'Arya Stark',
            tax_id: '012.345.678-90', 
            fine: 2.5,
            interest: 1.3,
            expiration: 123456789,
        )
    ]
)

invoices.each do |invoice|
    puts invoice
end
  

Elixir

invoice = StarkBank.Invoice.create!(
    [
        %StarkBank.Invoice{
            amount: 400000,
            due: String.replace(DateTime.to_iso8601(DateTime.add(DateTime.utc_now(), 30*24*60*60, :second)), "Z", "+00:00"),
            tax_id: "012.345.678-90",
            name: "Arya Stark",
            expiration: 123456789,
            fine: 2.5,
            interest: 1.3,
            discounts: [
                %{
                    percentage: 10,
                    due: String.replace(DateTime.to_iso8601(DateTime.add(DateTime.utc_now(), 10*24*60*60, :second)), "Z", "+00:00"),
                }
            ],
            rules: [
                %{
                    key: "allowedTaxIds",
                    value: [
                        "012.345.678-90",
                        "45.059.493/0001-73"
                    ]
                }
            ],
            tags: [
                "War Supply",
                "Invoice #1234"
            ],
            descriptions: [
                %{
                    key: "Arya",
                    value: "Not today"
                }
            ]
        }
    ]
) |> IO.inspect()
  

C#

using System;
using System.Collections.Generic;

List<StarkBank.Invoice> invoices = StarkBank.Invoice.Create(
    new List<StarkBank.Invoice> {
        new StarkBank.Invoice(
            amount: 400000,
            descriptions: new List<Dictionary<string, object>>() {
                new Dictionary<string, object> {
                    {"key", "Arya"},
                    {"value", "Not today"}
                }
            },
            discounts: new List<Dictionary<string, object>>() {
                new Dictionary<string, object> {
                    {"percentage", 10},
                    {"due", new DateTime(2021, 03, 12, 20, 30, 0)}
                }
            },
            rules: new List<Dictionary<string, object>>() {
                new Dictionary<string, object> {
                    {"key", "allowedTaxIds"},
                    {"value", new List<string> { "012.345.678-90", "45.059.493/0001-73" }}
                }
            },
            due: new DateTime(2021, 05, 12, 20, 30, 0),
            expiration: 123456789,
            fine: 2.5,
            interest: 1.3,
            name: "Arya Stark",
            tags: new List<string> { "New sword", "Invoice #1234" },
            taxID: "012.345.678-90"
        )
    }
);

foreach (StarkBank.Invoice invoice in invoices)
{
    Console.WriteLine(invoice);
}
  

Go

package main

import (
    "fmt"
    "github.com/starkbank/sdk-go/starkbank/invoice"
    "time"
)

func main() {

    due := time.Date(2021, 05, 12, 0, 0, 0, 0, time.UTC)

    descriptions := make([]map[string]interface{}, 1)
	var data = map[string]interface{}{}
	data["key"] = "Arya"
	data["value"] = "Not today"
	descriptions[0] = data

    discounts := make([]map[string]interface{}, 1)
	var dataDiscount = map[string]interface{}{}
	dataDiscount["percentage"] = 5
	dataDiscount["due"] = time.Date(2021, 03, 12, 0, 0, 0, 0, time.UTC)
	discounts[0] = dataDiscount

    invoices, err := invoice.Create(
        []invoice.Invoice{
            {
                Amount:       400000,
                Name:         "Arya Stark",
                TaxId:        "012.345.678-90",
                Descriptions: descriptions,
                Discounts:    discounts,
                Due:          &due,
                Fine:         2.5,
                Interest:     1.3,
                Expiration:   123456789,
                Tags:         []string{"War supply", "Invoice #1234"},
            },
        }, nil)
    if err.Errors != nil {
        for _, e := range err.Errors {
            fmt.Printf("code: %s, message: %s", e.Code, e.Message)
        }
    }

    for _, invoice := range invoices {
        fmt.Printf("%+v", invoice)
    }
}
  

Clojure

(def invoices (starkbank.invoice/create
[{
    :amount 400000
    :due "2021-05-12T19:32:35.418698+00:00"
    :tax-id "012.345.678-90"
    :name "Arya Stark",
    :expiration 123456789,
    :fine 2.5,
    :interest 1.3,
    :discounts [
        {
            :percentage 5
            :due "2021-03-12T19:32:35.418698+00:00"
        }
    ]
    :descriptions [
        {
            :key "Arya"
            :value "Not Today"
        }
    ],
    :rules [
        {
            :key "allowedTaxIds",
            :value [
                "012.345.678-90",
                "45.059.493/0001-73"
            ]
        }
    ],
    :tags [
        "War supply",
        "Invoice #1234"
    ]
}]))

(doseq [invoice invoices]
    (println invoice)
)
  

Curl

curl --location --request POST '{{baseUrl}}/v2/invoice' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}' 
--header 'Content-Type: application/json' 
--data-raw '{
    "invoices": [
        {
            "amount": 400000,
            "due": "2021-05-12T17:59:26.000000+00:00",
            "expiration": 123456789,
            "name": "Arya Stark",
            "taxId": "012.345.678-90",
            "fine": 2.5,
            "interest": 1.3,
            "tags": [
                "War supply",
                "Invoice #1234"
            ]
            "descriptions": [
                {
                    "key": "Arya",
                    "value": "Not today"
                }
            ],
            "rules": [
                {
                    "key": "allowedTaxIds",
                    "value": [
                        "012.345.678-90",
                        "45.059.493/0001-73"
                    ]
                }
            ],
            "discounts": [
                {
                    "percentage": 10,
                    "due": "2021-03-12T17:59:26.000000+00:00"
                }
            ],
            "splits": [
                {
                    "receiverId": "5742447426535424",
                    "amount": 3000
                },
                {
                    "receiverId": "5743243941642240",
                    "amount": 5000
                }
            ]
        }
    ]
}'
  
RESPONSE

Python

Invoice(
    amount=400000,
    brcode=00020101021226600014br.gov.bcb.pix2538invoice-h.sandbox.starkbank.com/57301741758054405204000053039865802BR5910NightKing6010Winterfell62280524invoice/573017417580544063046B79,
    created=2020-10-26 17:10:57.261868,
    descriptions=[{'key': 'Arya', 'value': 'Not today'}],
    discount_amount=0,
    discounts=[{'percentage': 10.0, 'due': '2021-03-12T18:23:26+00:00'}],
    due=2021-05-12 15:23:26,
    expiration=123456789,
    fee=0,
    pdf=https://invoice-h.sandbox.starkbank.com/pdf/851ff545535c40ba88e24a05accb9978,
    link=https://invoice-h.sandbox.starkbank.com/invoicelink/851ff545535c40ba88e24a05accb9978,
    fine=2.5,
    fine_amount=0,
    id=4600131349381120,
    interest=1.3,
    interest_amount=0,
    name=Arya Stark,
    nominal_amount=400000,
    status=created,
    tags=['War supply', 'Invoice #1234'],
    transaction_ids=[],
    tax_id=012.345.678-90,
    updated=2020-10-26 17:10:57.261877,
    splits=[
        Split(
            amount=3000,
            created=None,
            external_id=None,
            id=None,
            receiver_id=5742447426535424,
            scheduled=None,
            source=None,
            status=None,
            tags=None,
            updated=None
        ),
        Split(
            amount=5000,
            created=None,
            external_id=None,
            id=None,
            receiver_id=5743243941642240,
            scheduled=None,
            source=None,
            status=None,
            tags=None,
            updated=None
        )
    ]
)
  

Javascript

Invoice {
  id: '4600131349381120',
  amount: 400000,
  due: '2021-05-12T16:27:37.585000+00:00',
  taxId: '012.345.678-90',
  name: 'Arya Stark',
  expiration: 123456789,
  fine: 2.5,
  interest: 1.3,
  discounts: [ { percentage: 10, due: '2021-03-12T14:16:10.639000+00:00' } ],
  tags: [ 'war supply', 'invoice #1234' ],
  transactionIds: [  ],
  descriptions: [ { key: 'Arya', value: 'Not today' } ],
  fee: 0,
  pdf: 'https://invoice-h.sandbox.starkbank.com/pdf/851ff545535c40ba88e24a05accb9978',
  link: 'https://invoice-h.sandbox.starkbank.com/invoicelink/851ff545535c40ba88e24a05accb9978',
  nominalAmount: 400000,
  fineAmount: 0,
  interestAmount: 0,
  discountAmount: 0,
  brcode: '00020101021226600014br.gov.bcb.pix2538invoice-h.sandbox.starkbank.com/57301741758054405204000053039865802BR5910NightKing6010Winterfell62280524invoice/573017417580544063046B79',
  status: 'created',
  created: '2020-10-26T17:10:57.606357+00:00',
  updated: '2020-10-26T17:10:57.606367+00:00'
}
  

PHP

StarkBank\Invoice Object
(
    [id] => 4600131349381120
    [amount] => 400000
    [due] => DateTime Object
        (
            [date] => 2021-05-12 18:00:00.000000
            [timezone_type] => 1
            [timezone] => +00:00
        )

    [taxId] => 012.345.678-90
    [name] => Arya Stark
    [expiration] => 123456789
    [fee] => 0
    [pdf] => https://invoice-h.sandbox.starkbank.com/pdf/851ff545535c40ba88e24a05accb9978
    [link] => https://invoice-h.sandbox.starkbank.com/invoicelink/851ff545535c40ba88e24a05accb9978
    [fine] => 2.5
    [interest] => 1.3
    [discounts] => Array
        (
            [0] => Array
                (
                    [percentage] => 10
                    [due] => 2021-03-12T21:00:00+00:00
                )

        )

    [tags] => Array
        (
            [0] => war supply
            [1] => invoice #1234
        )

    [transactionIds] => Array
        (
        )

    [descriptions] => Array
        (
            [0] => Array
                (
                    [key] => Arya
                    [value] => Not today
                )

        )

    [nominalAmount] => 400000
    [fineAmount] => 0
    [interestAmount] => 0
    [discountAmount] => 0
    [brcode] => 00020101021226600014br.gov.bcb.pix2538invoice-h.sandbox.starkbank.com/57301741758054405204000053039865802BR5910NightKing6010Winterfell62280524invoice/573017417580544063046B79
    [status] => created
    [created] => DateTime Object
        (
            [date] => 2020-10-26 17:10:43.241309
            [timezone_type] => 1
            [timezone] => +00:00
        )

    [updated] => DateTime Object
        (
            [date] => 2020-10-26 17:10:43.241320
            [timezone_type] => 1
            [timezone] => +00:00
        )

)
  

Java

Invoice({
    "amount": 400000,
    "due": "2021-05-12T15:23:26.000000+00:00",
    "taxId": "012.345.678-90",
    "name": "Arya Stark",
    "expiration": 123456789,
    "fee": 0,
    "pdf": "https://invoice-h.sandbox.starkbank.com/pdf/851ff545535c40ba88e24a05accb9978",
    "link": "https://invoice-h.sandbox.starkbank.com/invoicelink/851ff545535c40ba88e24a05accb9978",
    "fine": 2.5,
    "interest": 1.3,
    "descriptions": [
        {
            "key": "Arya",
            "value": "Not today"
        }
    ]
    "discounts": [],
    "tags": ["war supply", "invoice #1234"],
    "transactionIds": [],
    "nominalAmount": 400000,
    "fineAmount": 0,
    "interestAmount": 0,
    "discountAmount": 0,
    "brcode": "00020101021226600014br.gov.bcb.pix2538invoice-h.sandbox.starkbank.com/57301741758054405204000053039865802BR5910NightKing6010Winterfell62280524invoice/573017417580544063046B79",
    "status": "created",
    "created": "2020-10-26T17:32:00.997116+00:00",
    "updated": "2020-10-26T17:32:00.997126+00:00",
    "id": "4600131349381120"
})
  

Ruby

invoice(
    id: 4600131349381120,
    amount: 400000,
    due: 2021-05-12T11:00:20+00:00,
    tax_id: 012.345.678-90,
    name: Arya Stark,
    expiration: 123456789,
    fee: 0,
    pdf: https://invoice-h.sandbox.starkbank.com/pdf/851ff545535c40ba88e24a05accb9978,
    link: https://invoice-h.sandbox.starkbank.com/invoicelink/851ff545535c40ba88e24a05accb9978,
    fine: 2.5,
    interest: 1.3,
    discounts: [
        (
            percentage: 5,
            due: 2021-03-12T14:00:21+00:00
        )
    ],
    tags: ["war supply", "invoice #1234"],
    transaction_ids: [],
    descriptions: [
        (
            key: Arya,
            value: Not today
        )
    ],
    nominal_amount: 23571,
    fine_amount: 0,
    interest_amount: 0,
    discount_amount: 0,
    brcode: 00020101021226860014br.gov.bcb.pix2564invoice-h.sandbox.starkbank.com/0e272677d4924d1fa3520cfda61b0f6f5204000053039865802BR5933Matheus Coelho Ferraz 418128448406009Sao Paulo62200516643401702073958463047661,
    status: created,
    updated: 2020-10-26T14:00:21+00:00,
    created: 2020-10-26T14:00:21+00:00
)
  

Elixir

%StarkBank.Invoice{
    amount: 400000,
    brcode: "00020101021226600014br.gov.bcb.pix2538invoice-h.sandbox.starkbank.com/57301741758054405204000053039865802BR5910NightKing6010Winterfell62280524invoice/573017417580544063046B79",
    created: ~U[2020-10-26 18:36:18.116954Z],
    descriptions: [
        %{"key" => "Arya", "value" => "Not today"}
    ],
    discount_amount: 0,
    discounts: [
        %{"due" => "2020-11-23T21:36:18.223000+00:00", "percentage" => 10.0}
    ],
    due: "2020-05-12T18:36:18.219000+00:00",
    expiration: 123456789,
    fee: 0,
    pdf: "https://invoice-h.sandbox.starkbank.com/pdf/851ff545535c40ba88e24a05accb9978",
    link: "https://invoice-h.sandbox.starkbank.com/invoicelink/851ff545535c40ba88e24a05accb9978",
    fine: 2.5,
    fine_amount: 0,
    id: "4600131349381120",
    interest: 1.3,
    interest_amount: 0,
    name: "Arya Stark",
    nominal_amount: 400000,
    status: "created",
    tags: ["war supply", "invoice #1234"],
    transaction_ids: [],
    tax_id: "012.345.678-90",
    updated: ~U[2020-10-26 18:36:18.116976Z]
}
  

C#

Invoice(
    Name: Arya Stark,
    TaxID: 012.345.678-90,
    Due: 12/05/2021 20:30:00,
    Expiration: 123456789,
    Fee: 0,
    Pdf: https://invoice-h.sandbox.starkbank.com/pdf/851ff545535c40ba88e24a05accb9978,
    Link: https://invoice-h.sandbox.starkbank.com/invoicelink/851ff545535c40ba88e24a05accb9978,
    Fine: 2,5,
    Interest: 1,3,
    Descriptions: { { { key, Arya }, { value, Not today } } },
    Discounts: { { { percentage, 10 }, { due, 30/05/2021 23:30:00 } } },
    Tags: { war supply, invoice #1234 },
    TransactionIds: {  },
    Amount: 400000,
    NominalAmount: 400000,
    FineAmount: 0,
    InterestAmount: 0,
    DiscountAmount: 0,
    Brcode: 00020101021226600014br.gov.bcb.pix2538invoice-h.sandbox.starkbank.com/57301741758054405204000053039865802BR5910NightKing6010Winterfell62280524invoice/573017417580544063046B79,
    Status: created,
    Created: 26/10/2020 12:56:53,
    Updated: 26/10/2020 12:56:53,
    ID: 4600131349381120
    )
  

Go

{
    Id:4600131349381120 
    Amount:400000 
    Name:Arya Stark
    TaxId:012.345.678-90
    Due:2021-05-12 16:54:53.5521 +0000 +0000 
    Expiration:123456789 
    Fine:2.5 
    Interest:1.3 
    Discounts:[map[due:2023-02-16T16:20:16.621546+00:00 percentage:5]]
    Tags:[war supply invoice #1234] 
    Descriptions:[map[key:Arya value:Not today]]
    Pdf:https://invoice-h.sandbox.starkbank.com/pdf/851ff545535c40ba88e24a05accb9978 
    Link:https://invoice-h.sandbox.starkbank.com/invoicelink/851ff545535c40ba88e24a05accb9978 
    NominalAmount:400000 
    FineAmount:0 
    InterestAmount:0 
    DiscountAmount:0 
    Brcode:00020101021226600014br.gov.bcb.pix2538invoice-h.sandbox.starkbank.com/57301741758054405204000053039865802BR5910NightKing6010Winterfell62280524invoice/573017417580544063046B79 
    Status:created 
    Fee:0 
    TransactionIds:[] 
    Created:2020-10-26 17:10:54.16799 +0000 +0000 
    Updated:2020-10-26 17:10:54.24204 +0000 +0000
}
  

Clojure

{
    :amount 400000, 
    :interest-amount 0, 
    :fee 0, 
    :tags [war supply invoice #1234], 
    :transaction-ids [], 
    :updated 2020-10-26T06:09:07.540753+00:00, 
    :name Iron Bank S.A., 
    :expiration 123456789, 
    :tax-id 012.345.678-90, 
    :pdf https://invoice-h.sandbox.starkbank.com/pdf/851ff545535c40ba88e24a05accb9978, 
    :link https://invoice-h.sandbox.starkbank.com/invoicelink/851ff545535c40ba88e24a05accb9978, 
    :nominal-amount 400000, 
    :created 2020-10-26T06:09:07.540724+00:00, 
    :discounts [
        {
            :percentage 5.0, 
            :due 2021-03-12T22:32:35.418698+00:00
        } 
    ], 
    :due 2021-05-12T19:32:35.418698+00:00,
    :status created,
    :interest 1.3, 
    :id 4600131349381120,
    :fine 2.5,
    :fine-amount 0,
    :discount-amount 0,
    :brcode 00020101021226600014br.gov.bcb.pix2538invoice-h.sandbox.starkbank.com/57301741758054405204000053039865802BR5910NightKing6010Winterfell62280524invoice/573017417580544063046B79,
    :descriptions [
        {
            :key Product X,
            :value big
        }
    ]
}
  

Curl

{
    "message": "Invoice(s) successfully created",
    "invoices": [
        {
            "id": "4600131349381120",
            "status": "created",
            "amount": 400000,
            "nominalAmount": 400000,
            "fineAmount": 0,
            "interestAmount": 0,
            "discountAmount": 0,
            "expiration": 123456789,
            "discounts": [
                {
                    "percentage": 5.0
                    "due": 2021-03-12T01:50:50.264656+00:00
                }
            ],
            "descriptions": [
                {
                    "key": "Arya"
                    "value": "Not today"
                }
            ],
            "name": "Arya Stark",
            "taxId": "012.345.678-90",
            "fee": 0,
            "pdf": "https://invoice-h.sandbox.starkbank.com/pdf/851ff545535c40ba88e24a05accb9978",
            "link": "https://invoice-h.sandbox.starkbank.com/invoicelink/851ff545535c40ba88e24a05accb9978",
            "fine": 2.5,
            "interest": 1.3,
            "tags": [
                "War supply",
                "Invoice #1234"
            ],
            "transactionIds": [],
            "brcode": "00020101021226600014br.gov.bcb.pix2538invoice-h.sandbox.starkbank.com/57301741758054405204000053039865802BR5910NightKing6010Winterfell62280524invoice/573017417580544063046B79",
            "created": "2020-10-26T01:50:50.264656+00:00",
            "updated": "2020-10-26T01:50:50.264656+00:00",
            "due": "2020-05-12T17:59:26.000000+00:00",
            "splits": [
                {
                    "amount": 3000,
                    "receiverId": "5742447426535424",
                ),
                {
                    "amount": 5000,
                    "receiverId": "5743243941642240",
                }
            ]
        }
    ]
}
  

List Invoices

Get a list of invoices in chunks of at most 100. If you need smaller chunks, use the limit parameter.

Parameters

after OPTIONAL

Filter entities created after this date.

before OPTIONAL

Filter entities created before this date.

cursor OPTIONAL

String used to get the next batch of results. Our SDKs handle this for you.

fields OPTIONAL

List of strings to filter response JSON keys. Not available in the SDKs.

ids OPTIONAL

List of strings to get specific entities by ids.

limit OPTIONAL

Number of results per cursor. Max = 100.

status OPTIONAL

Filter invoices by the specified status.

tags OPTIONAL

Filter entities that contain the specified tags.

transactionIds OPTIONAL

List of transaction IDs linked to the desired invoices.

ENDPOINT
GET /v2/invoice
REQUEST

Python

import starkbank

invoices = starkbank.invoice.query(
    after="2020-10-1",
    before="2020-10-30",
    limit=10
)

for invoice in invoices:
    print(invoice)
  

Javascript

const starkbank = require('starkbank');

(async() => {
    let invoices = await starkbank.invoice.query({
        after: '2020-10-01',
        before: '2020-10-30',
    });

    for await (let invoice of invoices) {
        console.log(invoice);
    }
})();
  

PHP

use StarkBank\Invoice;

 $invoices = iterator_to_array(
    Invoice::query([
        "before" => "2020-10-30T18:00:00.000000+00:00",
        "after" => "2020-10-01T18:00:00.000000+00:00"
        ]
    ));

foreach ($invoices as $invoice) {
    print_r($invoice);
}
  

Java

import com.starkbank.*;
import com.starkbank.utils.Generator;
import java.util.HashMap;

HashMap<String, Object> params = new HashMap<>();
params.put("after", "2020-10-01");
params.put("before", "2020-10-30");
Generator<Invoice> invoices = Invoice.query(params);

for (Invoice invoice : invoices){
    System.out.println(invoice);
}
  

Ruby

require('starkbank')

invoices = StarkBank::Invoice.query(
    after: '2020-10-01',
    before: '2020-10-30'
)
    
invoices.each do |invoice|
    puts invoice
end
  

Elixir

invoices = StarkBank.Invoice.query!(
    after: "2020-10-01",
    before: "2020-10-30"
) |> Enum.take(1) |> IO.inspect
  

C#

IEnumerable<StarkBank.Invoice> invoices = StarkBank.Invoice.Query(
    after: new DateTime(2020, 10, 1),
    before: new DateTime(2020, 10, 30)
);
    
foreach (StarkBank.Invoice invoice in invoices)
{
    Console.WriteLine(invoice);
}
  

Go

package main

import (
    "fmt"
    "time"
    "github.com/starkbank/sdk-go/starkbank/invoice"
)

func main() {

    var params = map[string]interface{}{}
    params["after"] = time.Date(2020, 10, 1, 0, 0, 0, 0, time.UTC)
    params["before"] = time.Date(2020, 10, 30, 0, 0, 0, 0, time.UTC)

    invoices, errorChannel := invoice.Query(params, nil)

    loop:
    for {
        select {
        case err := <-errorChannel:
            if err.Errors != nil {
                for _, e := range err.Errors {
                    fmt.Printf("code: %s, message: %s", e.Code, e.Message)
                }
            }
        case invoice, ok := <-invoices:
            if !ok {
                break loop
            }
            fmt.Printf("%+v", invoice)
        }
    }
}
  

Clojure

(def invoices (starkbank.invoice/query 
    {
    :after "2020-10-01"
    :before "2020-10-30"
    }))

(doseq [invoice invoices]
    (println invoice))
  

Curl

curl --location --request GET '{{baseUrl}}/v2/invoice?after=2020-10-01&before=2020-10-30' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}'
  
RESPONSE

Python

Invoice(
    amount=400000,
    brcode=00020101021226600014br.gov.bcb.pix2538invoice-h.sandbox.starkbank.com/57301741758054405204000053039865802BR5910NightKing6010Winterfell62280524invoice/573017417580544063046B79,
    created=2020-10-26 17:10:57.261868,
    descriptions=[{'key': 'Arya', 'value': 'Not today'}],
    discount_amount=0,
    discounts=[{'percentage': 10.0, 'due': '2021-03-12T18:23:26+00:00'}],
    due=2021-05-12 15:23:26,
    expiration=123456789,
    fee=0,
    pdf=https://invoice-h.sandbox.starkbank.com/pdf/851ff545535c40ba88e24a05accb9978,
    link=https://invoice-h.sandbox.starkbank.com/invoicelink/851ff545535c40ba88e24a05accb9978,
    fine=2.5,
    fine_amount=0,
    id=4600131349381120,
    interest=1.3,
    interest_amount=0,
    name=Arya Stark,
    nominal_amount=400000,
    status=created,
    tags=['War supply', 'Invoice #1234'],
    transaction_ids=[],
    tax_id=012.345.678-90,
    updated=2020-10-26 17:10:57.261877
)
  

Javascript

Invoice {
    id: '4600131349381120',
    amount: 400000,
    due: '2021-05-12T16:27:37.585000+00:00',
    taxId: '012.345.678-90',
    name: 'Arya Stark',
    expiration: 123456789,
    fine: 2.5,
    interest: 1.3,
    discounts: [ { percentage: 10, due: '2021-03-12T14:16:10.639000+00:00' } ],
    tags: [ 'war supply', 'invoice #1234' ],
    transactionIds: [  ],
    descriptions: [ { key: 'Arya', value: 'Not today' } ],
    fee: 0,
    pdf: 'https://invoice-h.sandbox.starkbank.com/pdf/851ff545535c40ba88e24a05accb9978',
    link: 'https://invoice-h.sandbox.starkbank.com/invoicelink/851ff545535c40ba88e24a05accb9978',
    nominalAmount: 400000,
    fineAmount: 0,
    interestAmount: 0,
    discountAmount: 0,
    brcode: '00020101021226600014br.gov.bcb.pix2538invoice-h.sandbox.starkbank.com/57301741758054405204000053039865802BR5910NightKing6010Winterfell62280524invoice/573017417580544063046B79',
    status: 'created',
    created: '2020-10-26T17:10:57.606357+00:00',
    updated: '2020-10-26T17:10:57.606367+00:00'
    }
  

PHP

StarkBank\Invoice Object
(
    [id] => 4600131349381120
    [amount] => 400000
    [due] => DateTime Object
        (
            [date] => 2021-05-12 18:00:00.000000
            [timezone_type] => 1
            [timezone] => +00:00
        )

    [taxId] => 012.345.678-90
    [name] => Arya Stark
    [expiration] => 123456789
    [fee] => 0
    [pdf] => https://invoice-h.sandbox.starkbank.com/pdf/851ff545535c40ba88e24a05accb9978
    [link] => https://invoice-h.sandbox.starkbank.com/invoicelink/851ff545535c40ba88e24a05accb9978
    [fine] => 2.5
    [interest] => 1.3
    [discounts] => Array
        (
            [0] => Array
                (
                    [percentage] => 10
                    [due] => 2021-03-12T21:00:00+00:00
                )

        )

    [tags] => Array
        (
            [0] => war supply
            [1] => invoice #1234
        )

    [transactionIds] => Array
        (
        )

    [descriptions] => Array
        (
            [0] => Array
                (
                    [key] => Arya
                    [value] => Not today
                )

        )

    [nominalAmount] => 400000
    [fineAmount] => 0
    [interestAmount] => 0
    [discountAmount] => 0
    [brcode] => 00020101021226600014br.gov.bcb.pix2538invoice-h.sandbox.starkbank.com/57301741758054405204000053039865802BR5910NightKing6010Winterfell62280524invoice/573017417580544063046B79
    [status] => created
    [created] => DateTime Object
        (
            [date] => 2020-10-26 17:10:43.241309
            [timezone_type] => 1
            [timezone] => +00:00
        )

    [updated] => DateTime Object
        (
            [date] => 2020-10-26 17:10:43.241320
            [timezone_type] => 1
            [timezone] => +00:00
        )

)
  

Java

Invoice({
    "amount": 400000,
    "due": "2021-05-12T15:23:26.000000+00:00",
    "taxId": "012.345.678-90",
    "name": "Arya Stark",
    "expiration": 123456789,
    "fee": 0,
    "pdf": "https://invoice-h.sandbox.starkbank.com/pdf/851ff545535c40ba88e24a05accb9978",
    "link": "https://invoice-h.sandbox.starkbank.com/invoicelink/851ff545535c40ba88e24a05accb9978",
    "fine": 2.5,
    "interest": 1.3,
    "descriptions": [
        {
            "key": "Arya",
            "value": "Not today"
        }
    ]
    "discounts": [],
    "tags": ["war supply", "invoice #1234"],
    "transactionIds": [],
    "nominalAmount": 400000,
    "fineAmount": 0,
    "interestAmount": 0,
    "discountAmount": 0,
    "brcode": "00020101021226600014br.gov.bcb.pix2538invoice-h.sandbox.starkbank.com/57301741758054405204000053039865802BR5910NightKing6010Winterfell62280524invoice/573017417580544063046B79",
    "status": "created",
    "created": "2020-10-26T17:32:00.997116+00:00",
    "updated": "2020-10-26T17:32:00.997126+00:00",
    "id": "4600131349381120"
})
  

Ruby

invoice(
    id: 4600131349381120,
    amount: 400000,
    due: 2021-05-12T11:00:20+00:00,
    tax_id: 012.345.678-90,
    name: Arya Stark,
    expiration: 123456789,
    fee: 0,
    pdf: https://invoice-h.sandbox.starkbank.com/pdf/851ff545535c40ba88e24a05accb9978,
    link: https://invoice-h.sandbox.starkbank.com/invoicelink/851ff545535c40ba88e24a05accb9978,
    fine: 2.5,
    interest: 1.3,
    discounts: [
        (
            percentage: 5,
            due: 2021-03-12T14:00:21+00:00
        )
    ],
    tags: ["war supply", "invoice #1234"],
    transaction_ids: [],
    descriptions: [
        (
            key: Arya,
            value: Not today
        )
    ],
    nominal_amount: 23571,
    fine_amount: 0,
    interest_amount: 0,
    discount_amount: 0,
    brcode: 00020101021226860014br.gov.bcb.pix2564invoice-h.sandbox.starkbank.com/0e272677d4924d1fa3520cfda61b0f6f5204000053039865802BR5933Matheus Coelho Ferraz 418128448406009Sao Paulo62200516643401702073958463047661,
    status: created,
    updated: 2020-10-26T14:00:21+00:00,
    created: 2020-10-26T14:00:21+00:00
)
  

Elixir

%StarkBank.Invoice{
    amount: 400000,
    brcode: "00020101021226600014br.gov.bcb.pix2538invoice-h.sandbox.starkbank.com/57301741758054405204000053039865802BR5910NightKing6010Winterfell62280524invoice/573017417580544063046B79",
    created: ~U[2020-10-26 18:36:18.116954Z],
    descriptions: [
        %{"key" => "Arya", "value" => "Not today"}
    ],
    discount_amount: 0,
    discounts: [
        %{"due" => "2020-11-23T21:36:18.223000+00:00", "percentage" => 10.0}
    ],
    due: "2020-05-12T18:36:18.219000+00:00",
    expiration: 123456789,
    fee: 0,
    pdf: "https://invoice-h.sandbox.starkbank.com/pdf/851ff545535c40ba88e24a05accb9978",
    link: "https://invoice-h.sandbox.starkbank.com/invoicelink/851ff545535c40ba88e24a05accb9978",
    fine: 2.5,
    fine_amount: 0,
    id: "4600131349381120",
    interest: 1.3,
    interest_amount: 0,
    name: "Arya Stark",
    nominal_amount: 400000,
    status: "created",
    tags: ["war supply", "invoice #1234"],
    transaction_ids: [],
    tax_id: "012.345.678-90",
    updated: ~U[2020-10-26 18:36:18.116976Z]
}
  

C#

Invoice(
    Name: Arya Stark,
    TaxID: 012.345.678-90,
    Due: 12/05/2021 20:30:00,
    Expiration: 123456789,
    Fee: 0,
    Pdf: https://invoice-h.sandbox.starkbank.com/pdf/851ff545535c40ba88e24a05accb9978,
    Link: https://invoice-h.sandbox.starkbank.com/invoicelink/851ff545535c40ba88e24a05accb9978,
    Fine: 2,5,
    Interest: 1,3,
    Descriptions: { { { key, Arya }, { value, Not today } } },
    Discounts: { { { percentage, 10 }, { due, 30/05/2021 23:30:00 } } },
    Tags: { war supply, invoice #1234 },
    TransactionIds: {  },
    Amount: 400000,
    NominalAmount: 400000,
    FineAmount: 0,
    InterestAmount: 0,
    DiscountAmount: 0,
    Brcode: 00020101021226600014br.gov.bcb.pix2538invoice-h.sandbox.starkbank.com/57301741758054405204000053039865802BR5910NightKing6010Winterfell62280524invoice/573017417580544063046B79,
    Status: created,
    Created: 26/10/2020 12:56:53,
    Updated: 26/10/2020 12:56:53,
    ID: 4600131349381120
    )
  

Go

{
    Id:4600131349381120 
    Amount:400000 
    Name:Arya Stark
    TaxId:012.345.678-90
    Due:2021-05-12 16:54:53.5521 +0000 +0000 
    Expiration:123456789 
    Fine:2.5 
    Interest:1.3 
    Discounts:[map[due:2023-02-16T16:20:16.621546+00:00 percentage:5]]
    Tags:[war supply invoice #1234] 
    Descriptions:[map[key:Arya value:Not today]]
    Pdf:https://invoice-h.sandbox.starkbank.com/pdf/851ff545535c40ba88e24a05accb9978 
    Link:https://invoice-h.sandbox.starkbank.com/invoicelink/851ff545535c40ba88e24a05accb9978 
    NominalAmount:400000 
    FineAmount:0 
    InterestAmount:0 
    DiscountAmount:0 
    Brcode:00020101021226600014br.gov.bcb.pix2538invoice-h.sandbox.starkbank.com/57301741758054405204000053039865802BR5910NightKing6010Winterfell62280524invoice/573017417580544063046B79 
    Status:created 
    Fee:0 
    TransactionIds:[] 
    Created:2020-10-26 17:10:54.16799 +0000 +0000 
    Updated:2020-10-26 17:10:54.24204 +0000 +0000
}
  

Clojure

{
    :amount 400000, 
    :interest-amount 0, 
    :fee 0, 
    :tags [war supply invoice #1234], 
    :transaction-ids [], 
    :updated 2020-10-26T06:09:07.540753+00:00, 
    :name Iron Bank S.A., 
    :expiration 123456789, 
    :tax-id 012.345.678-90, 
    :pdf https://invoice-h.sandbox.starkbank.com/pdf/851ff545535c40ba88e24a05accb9978, 
    :link https://invoice-h.sandbox.starkbank.com/invoicelink/851ff545535c40ba88e24a05accb9978, 
    :nominal-amount 400000, 
    :created 2020-10-26T06:09:07.540724+00:00, 
    :discounts [
        {
            :percentage 5.0, 
            :due 2021-03-12T22:32:35.418698+00:00
        } 
    ], 
    :due 2021-05-12T19:32:35.418698+00:00,
    :status created,
    :interest 1.3, 
    :id 4600131349381120,
    :fine 2.5,
    :fine-amount 0,
    :discount-amount 0,
    :brcode 00020101021226600014br.gov.bcb.pix2538invoice-h.sandbox.starkbank.com/57301741758054405204000053039865802BR5910NightKing6010Winterfell62280524invoice/573017417580544063046B79,
    :descriptions [
        {
            :key Product X,
            :value big
        }
    ]
}
  

Curl

{
    "cursor": null,
    "invoices": [
        {
            "id": "4600131349381120",
            "status": "created",
            "amount": 400000,
            "nominalAmount": 400000,
            "fineAmount": 0,
            "interestAmount": 0,
            "discountAmount": 0,
            "expiration": 123456789,
            "discounts": [
                {
                    "percentage": 5.0
                    "due": 2021-03-12T01:50:50.264656+00:00
                }
            ],
            "descriptions": [
                {
                    "key": "Arya"
                    "value": "Not today"
                }
            ],
            "name": "Arya Stark",
            "taxId": "012.345.678-90",
            "fee": 0,
            "pdf": "https://invoice-h.sandbox.starkbank.com/pdf/851ff545535c40ba88e24a05accb9978",
            "link": "https://invoice-h.sandbox.starkbank.com/invoicelink/851ff545535c40ba88e24a05accb9978",
            "fine": 2.5,
            "interest": 1.3,
            "tags": [
                "War supply",
                "Invoice #1234"
            ],
            "transactionIds": [],
            "brcode": "00020101021226600014br.gov.bcb.pix2538invoice-h.sandbox.starkbank.com/57301741758054405204000053039865802BR5910NightKing6010Winterfell62280524invoice/573017417580544063046B79",
            "created": "2020-10-26T01:50:50.264656+00:00",
            "updated": "2020-10-26T01:50:50.264656+00:00",
            "due": "2020-05-12T17:59:26.000000+00:00",
        }
    ]
}
  

Get an Invoice

Get a single invoice by its id.

Parameters

id REQUIRED

Id of the invoice entity

fields OPTIONAL

List of strings to filter response JSON keys. Not available in the SDKs.

ENDPOINT
GET /v2/invoice/:id
REQUEST

Python

import starkbank

invoice = starkbank.invoice.get("4600131349381120")

print(invoice)
  

Javascript

const starkbank = require('starkbank');

(async() => {
    let invoice = await starkbank.invoice.get('4600131349381120');
    console.log(invoice);
})();
  

PHP

use StarkBank\Invoice;

$invoice = Invoice::get("4600131349381120");

print_r($invoice);
  

Java

import com.starkbank.*;

Invoice invoice = Invoice.get("4600131349381120");

System.out.println(invoice);
  

Ruby

require('starkbank')

invoice = StarkBank::Invoice.get('6434017020739584')

puts invoice
  

Elixir

invoice = StarkBank.Invoice.get!("4600131349381120")
|> IO.inspect
  

C#

using System;

StarkBank.Invoice invoice = StarkBank.Invoice.Get("4600131349381120");

Console.WriteLine(invoice);
  

Go

package main

import (
    "fmt"
    "github.com/starkbank/sdk-go/starkbank/invoice"
)

func main() {

    invoice, err := invoice.Get("4600131349381120", nil)
    if err.Errors != nil {
        for _, e := range err.Errors {
            fmt.Printf("code: %s, message: %s", e.Code, e.Message)
        }
    }

    fmt.Printf("%+v", invoice)
}
  

Clojure

(def invoice (starkbank.invoice/get "4600131349381120"))

(println invoice)
  

Curl

curl --location --request GET '{{baseUrl}}/v2/invoice/4600131349381120' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}'
  
RESPONSE

Python

Invoice(
    amount=400000,
    brcode=00020101021226600014br.gov.bcb.pix2538invoice-h.sandbox.starkbank.com/57301741758054405204000053039865802BR5910NightKing6010Winterfell62280524invoice/573017417580544063046B79,
    created=2020-10-26 17:10:57.261868,
    descriptions=[{'key': 'Arya', 'value': 'Not today'}],
    discount_amount=0,
    discounts=[{'percentage': 10.0, 'due': '2021-03-12T18:23:26+00:00'}],
    due=2021-05-12 15:23:26,
    expiration=123456789,
    fee=0,
    pdf=https://invoice-h.sandbox.starkbank.com/pdf/851ff545535c40ba88e24a05accb9978,
    link=https://invoice-h.sandbox.starkbank.com/invoicelink/851ff545535c40ba88e24a05accb9978,
    fine=2.5,
    fine_amount=0,
    id=4600131349381120,
    interest=1.3,
    interest_amount=0,
    name=Arya Stark,
    nominal_amount=400000,
    status=created,
    tags=['War supply', 'Invoice #1234'],
    transaction_ids=[],
    tax_id=012.345.678-90,
    updated=2020-10-26 17:10:57.261877
)
  

Javascript

Invoice {
    id: '4600131349381120',
    amount: 400000,
    due: '2021-05-12T16:27:37.585000+00:00',
    taxId: '012.345.678-90',
    name: 'Arya Stark',
    expiration: 123456789,
    fine: 2.5,
    interest: 1.3,
    discounts: [ { percentage: 10, due: '2021-03-12T14:16:10.639000+00:00' } ],
    tags: [ 'war supply', 'invoice #1234' ],
    transactionIds: [  ],
    descriptions: [ { key: 'Arya', value: 'Not today' } ],
    fee: 0,
    pdf: 'https://invoice-h.sandbox.starkbank.com/pdf/851ff545535c40ba88e24a05accb9978',
    link: 'https://invoice-h.sandbox.starkbank.com/invoicelink/851ff545535c40ba88e24a05accb9978',
    nominalAmount: 400000,
    fineAmount: 0,
    interestAmount: 0,
    discountAmount: 0,
    brcode: '00020101021226600014br.gov.bcb.pix2538invoice-h.sandbox.starkbank.com/57301741758054405204000053039865802BR5910NightKing6010Winterfell62280524invoice/573017417580544063046B79',
    status: 'created',
    created: '2020-10-26T17:10:57.606357+00:00',
    updated: '2020-10-26T17:10:57.606367+00:00'
}
  

PHP

StarkBank\Invoice Object
(
    [id] => 4600131349381120
    [amount] => 400000
    [due] => DateTime Object
        (
            [date] => 2021-05-12 18:00:00.000000
            [timezone_type] => 1
            [timezone] => +00:00
        )

    [taxId] => 012.345.678-90
    [name] => Arya Stark
    [expiration] => 123456789
    [fee] => 0
    [pdf] => https://invoice-h.sandbox.starkbank.com/pdf/851ff545535c40ba88e24a05accb9978
    [link] => https://invoice-h.sandbox.starkbank.com/invoicelink/851ff545535c40ba88e24a05accb9978
    [fine] => 2.5
    [interest] => 1.3
    [discounts] => Array
        (
            [0] => Array
                (
                    [percentage] => 10
                    [due] => 2021-03-12T21:00:00+00:00
                )

        )

    [tags] => Array
        (
            [0] => war supply
            [1] => invoice #1234
        )

    [transactionIds] => Array
        (
        )

    [descriptions] => Array
        (
            [0] => Array
                (
                    [key] => Arya
                    [value] => Not today
                )

        )

    [nominalAmount] => 400000
    [fineAmount] => 0
    [interestAmount] => 0
    [discountAmount] => 0
    [brcode] => 00020101021226600014br.gov.bcb.pix2538invoice-h.sandbox.starkbank.com/57301741758054405204000053039865802BR5910NightKing6010Winterfell62280524invoice/573017417580544063046B79
    [status] => created
    [created] => DateTime Object
        (
            [date] => 2020-10-26 17:10:43.241309
            [timezone_type] => 1
            [timezone] => +00:00
        )

    [updated] => DateTime Object
        (
            [date] => 2020-10-26 17:10:43.241320
            [timezone_type] => 1
            [timezone] => +00:00
        )

)
  

Java

Invoice({
    "amount": 400000,
    "due": "2021-05-12T15:23:26.000000+00:00",
    "taxId": "012.345.678-90",
    "name": "Arya Stark",
    "expiration": 123456789,
    "fee": 0,
    "pdf": "https://invoice-h.sandbox.starkbank.com/pdf/851ff545535c40ba88e24a05accb9978",
    "link": "https://invoice-h.sandbox.starkbank.com/invoicelink/851ff545535c40ba88e24a05accb9978",
    "fine": 2.5,
    "interest": 1.3,
    "descriptions": [
        {
            "key": "Arya",
            "value": "Not today"
        }
    ]
    "discounts": [],
    "tags": ["war supply", "invoice #1234"],
    "transactionIds": [],
    "nominalAmount": 400000,
    "fineAmount": 0,
    "interestAmount": 0,
    "discountAmount": 0,
    "brcode": "00020101021226600014br.gov.bcb.pix2538invoice-h.sandbox.starkbank.com/57301741758054405204000053039865802BR5910NightKing6010Winterfell62280524invoice/573017417580544063046B79",
    "status": "created",
    "created": "2020-10-26T17:32:00.997116+00:00",
    "updated": "2020-10-26T17:32:00.997126+00:00",
    "id": "4600131349381120"
})    
  

Ruby

invoice(
    id: 4600131349381120,
    amount: 400000,
    due: 2021-05-12T11:00:20+00:00,
    tax_id: 012.345.678-90,
    name: Arya Stark,
    expiration: 123456789,
    fee: 0,
    pdf: https://invoice-h.sandbox.starkbank.com/pdf/851ff545535c40ba88e24a05accb9978,
    link: https://invoice-h.sandbox.starkbank.com/invoicelink/851ff545535c40ba88e24a05accb9978,
    fine: 2.5,
    interest: 1.3,
    discounts: [
        (
            percentage: 5,
            due: 2021-03-12T14:00:21+00:00
        )
    ],
    tags: ["war supply", "invoice #1234"],
    transaction_ids: [],
    descriptions: [
        (
            key: Arya,
            value: Not today
        )
    ],
    nominal_amount: 23571,
    fine_amount: 0,
    interest_amount: 0,
    discount_amount: 0,
    brcode: 00020101021226860014br.gov.bcb.pix2564invoice-h.sandbox.starkbank.com/0e272677d4924d1fa3520cfda61b0f6f5204000053039865802BR5933Matheus Coelho Ferraz 418128448406009Sao Paulo62200516643401702073958463047661,
    status: created,
    updated: 2020-10-26T14:00:21+00:00,
    created: 2020-10-26T14:00:21+00:00
)
  

Elixir

%StarkBank.Invoice{
    amount: 400000,
    brcode: "00020101021226600014br.gov.bcb.pix2538invoice-h.sandbox.starkbank.com/57301741758054405204000053039865802BR5910NightKing6010Winterfell62280524invoice/573017417580544063046B79",
    created: ~U[2020-10-26 18:36:18.116954Z],
    descriptions: [
        %{"key" => "Arya", "value" => "Not today"}
    ],
    discount_amount: 0,
    discounts: [
        %{"due" => "2020-11-23T21:36:18.223000+00:00", "percentage" => 10.0}
    ],
    due: "2020-05-12T18:36:18.219000+00:00",
    expiration: 123456789,
    fee: 0,
    pdf: "https://invoice-h.sandbox.starkbank.com/pdf/851ff545535c40ba88e24a05accb9978",
    link: "https://invoice-h.sandbox.starkbank.com/invoicelink/851ff545535c40ba88e24a05accb9978",
    fine: 2.5,
    fine_amount: 0,
    id: "4600131349381120",
    interest: 1.3,
    interest_amount: 0,
    name: "Arya Stark",
    nominal_amount: 400000,
    status: "created",
    tags: ["war supply", "invoice #1234"],
    transaction_ids: [],
    tax_id: "012.345.678-90",
    updated: ~U[2020-10-26 18:36:18.116976Z]
}
  

C#

Invoice(
    Name: Arya Stark,
    TaxID: 012.345.678-90,
    Due: 12/05/2021 20:30:00,
    Expiration: 123456789,
    Fee: 0,
    Pdf: https://invoice-h.sandbox.starkbank.com/pdf/851ff545535c40ba88e24a05accb9978,
    Link: https://invoice-h.sandbox.starkbank.com/invoicelink/851ff545535c40ba88e24a05accb9978,
    Fine: 2,5,
    Interest: 1,3,
    Descriptions: { { { key, Arya }, { value, Not today } } },
    Discounts: { { { percentage, 10 }, { due, 30/05/2021 23:30:00 } } },
    Tags: { war supply, invoice #1234 },
    TransactionIds: {  },
    Amount: 400000,
    NominalAmount: 400000,
    FineAmount: 0,
    InterestAmount: 0,
    DiscountAmount: 0,
    Brcode: 00020101021226600014br.gov.bcb.pix2538invoice-h.sandbox.starkbank.com/57301741758054405204000053039865802BR5910NightKing6010Winterfell62280524invoice/573017417580544063046B79,
    Status: created,
    Created: 26/10/2020 12:56:53,
    Updated: 26/10/2020 12:56:53,
    ID: 4600131349381120
)
  

Go

{
    Id:4600131349381120 
    Amount:400000 
    Name:Arya Stark
    TaxId:012.345.678-90
    Due:2021-05-12 16:54:53.5521 +0000 +0000 
    Expiration:123456789 
    Fine:2.5 
    Interest:1.3 
    Discounts:[map[due:2023-02-16T16:20:16.621546+00:00 percentage:5]]
    Tags:[war supply invoice #1234] 
    Descriptions:[map[key:Arya value:Not today]]
    Pdf:https://invoice-h.sandbox.starkbank.com/pdf/851ff545535c40ba88e24a05accb9978 
    Link:https://invoice-h.sandbox.starkbank.com/invoicelink/851ff545535c40ba88e24a05accb9978 
    NominalAmount:400000 
    FineAmount:0 
    InterestAmount:0 
    DiscountAmount:0 
    Brcode:00020101021226600014br.gov.bcb.pix2538invoice-h.sandbox.starkbank.com/57301741758054405204000053039865802BR5910NightKing6010Winterfell62280524invoice/573017417580544063046B79 
    Status:created 
    Fee:0 
    TransactionIds:[] 
    Created:2020-10-26 17:10:54.16799 +0000 +0000 
    Updated:2020-10-26 17:10:54.24204 +0000 +0000
}
  

Clojure

{
    :amount 400000, 
    :interest-amount 0, 
    :fee 0, 
    :tags [war supply invoice #1234], 
    :transaction-ids [], 
    :updated 2020-10-26T06:09:07.540753+00:00, 
    :name Iron Bank S.A., 
    :expiration 123456789, 
    :tax-id 012.345.678-90, 
    :pdf https://invoice-h.sandbox.starkbank.com/pdf/851ff545535c40ba88e24a05accb9978, 
    :link https://invoice-h.sandbox.starkbank.com/invoicelink/851ff545535c40ba88e24a05accb9978, 
    :nominal-amount 400000, 
    :created 2020-10-26T06:09:07.540724+00:00, 
    :discounts [
        {
            :percentage 5.0, 
            :due 2021-03-12T22:32:35.418698+00:00
        } 
    ], 
    :due 2021-05-12T19:32:35.418698+00:00,
    :status created,
    :interest 1.3, 
    :id 4600131349381120,
    :fine 2.5,
    :fine-amount 0,
    :discount-amount 0,
    :brcode 00020101021226600014br.gov.bcb.pix2538invoice-h.sandbox.starkbank.com/57301741758054405204000053039865802BR5910NightKing6010Winterfell62280524invoice/573017417580544063046B79,
    :descriptions [
        {
            :key Product X,
            :value big
        }
    ]
}
  

Curl

{
    "invoice": {
        "id": "4600131349381120",
        "status": "created",
        "amount": 400000,
        "nominalAmount": 400000,
        "fineAmount": 0,
        "interestAmount": 0,
        "discountAmount": 0,
        "expiration": 123456789,
        "discounts": [
            {
                "percentage": 5.0
                "due": 2021-03-12T01:50:50.264656+00:00
            }
        ],
        "descriptions": [
            {
                "key": "Arya"
                "value": "Not today"
            }
        ],
        "name": "Arya Stark",
        "taxId": "012.345.678-90",
        "fee": 0,
        "pdf": "https://invoice-h.sandbox.starkbank.com/pdf/851ff545535c40ba88e24a05accb9978",
        "link": "https://invoice-h.sandbox.starkbank.com/invoicelink/851ff545535c40ba88e24a05accb9978",
        "fine": 2.5,
        "interest": 1.3,
        "tags": [
            "War supply",
            "Invoice #1234"
        ],
        "transactionIds": [],
        "brcode": "00020101021226600014br.gov.bcb.pix2538invoice-h.sandbox.starkbank.com/57301741758054405204000053039865802BR5910NightKing6010Winterfell62280524invoice/573017417580544063046B79",
        "created": "2020-10-26T01:50:50.264656+00:00",
        "updated": "2020-10-26T01:50:50.264656+00:00",
        "due": "2020-05-12T17:59:26.000000+00:00",
    }
}
  

Update an Invoice

Update a single invoice. If the invoice has not yet been paid, you can adjust parameters such as the requested amount, the due datetime and the expiration. If the invoice has already been paid, only the amount can be decreased, which will result in a payment reversal.

Parameters

id REQUIRED

Id of the invoice entity.

amount OPTIONAL

New amount that should be charged on payment. If the invoice has already been paid, it is the final amount after reversal. Example: 200 (R$2.00).

due OPTIONAL

New due datetime. Example: '2020-11-26T17:59:26.000000+00:00'.

expiration OPTIONAL

New expiration. Example: 3600 (1 hour).

status OPTIONAL

This can be used to cancel the invoice by passing 'canceled' as the status patch.

ENDPOINT
PATCH /v2/invoice/:id
REQUEST

Python

import starkbank

updated_invoice = starkbank.invoice.update(
    "4600131349381120", 
    status="canceled", 
    amount=12345,
    expiration=98765
)

print(updated_invoice)
  

Javascript

const starkbank = require('starkbank');

(async() => {
    let invoice = await starkbank.invoice.update('4600131349381120', 
        {
            status: 'canceled', 
            amount: 12345,
            expiration: 98765
        }
    );
    console.log(invoice);
})();
  

PHP

use StarkBank\Invoice;

$updateInvoice = Invoice::update(
    "4600131349381120",
    [
        "status" => "canceled"
        "amount" => 12345,
        "expiration" => 98765
    ]
);

print_r($updateInvoice);
  

Java

Invoice({
    "amount": 400000,
    "due": "2021-05-12T15:23:26.000000+00:00",
    "taxId": "012.345.678-90",
    "name": "Arya Stark",
    "expiration": 123456789,
    "fee": 0,
    "pdf": "https://invoice-h.sandbox.starkbank.com/pdf/851ff545535c40ba88e24a05accb9978",
    "link": "https://invoice-h.sandbox.starkbank.com/invoicelink/851ff545535c40ba88e24a05accb9978",
    "fine": 2.5,
    "interest": 1.3,
    "descriptions": [
        {
            "key": "Arya",
            "value": "Not today"
        }
    ]
    "discounts": [],
    "tags": ["war supply", "invoice #1234"],
    "transactionIds": [],
    "nominalAmount": 400000,
    "fineAmount": 0,
    "interestAmount": 0,
    "discountAmount": 0,
    "brcode": "00020101021226600014br.gov.bcb.pix2538invoice-h.sandbox.starkbank.com/57301741758054405204000053039865802BR5910NightKing6010Winterfell62280524invoice/573017417580544063046B79",
    "status": "created",
    "created": "2020-10-26T17:32:00.997116+00:00",
    "updated": "2020-10-26T17:32:00.997126+00:00",
    "id": "4600131349381120"
})
  

Ruby

require('starkbank')

invoice = StarkBank::Invoice.update(
    '4600131349381120', 
    status: 'canceled',
    amount: 12345,
    expiration: 98765,
)

puts invoice
  

Elixir

invoice = StarkBank.Invoice.update!(
    "4600131349381120", 
    status: "canceled",
    amount: 12345,
    expiration: 98765
) |> IO.inspect
  

C#

StarkBank.Invoice invoice = StarkBank.Invoice.Update(
    "4600131349381120",
    status: "canceled",
    amount: 12345,
    expiration: 98765
);

Console.WriteLine(invoice);
  

Go

package main

import (
    "fmt"
    "github.com/starkbank/sdk-go/starkbank/invoice"
)

func main() {

    var patchData = map[string]interface{}{}
    patchData["status"] = "canceled"
    patchData["amount"] = 12345
    patchData["expiration"] = 98765

    invoice, err := invoice.Update("4600131349381120", patchData, nil)
    if err.Errors != nil {
        for _, e := range err.Errors {
            fmt.Printf("code: %s, message: %s", e.Code, e.Message)
        }
    }

    fmt.Printf("%+v", invoice)
}
  

Clojure

(def invoice (starkbank.invoice/update "4600131349381120" {:amount 12345 :expiration 98765 :status "canceled"}))

(println invoice)
  

Curl

curl --location --request PATCH '{{baseUrl}}/v2/invoice/4600131349381120' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}' 
--header 'Content-Type: application/json' 
--data-raw '{
    "status": "canceled",
    "amount": 12345,
    "expiration": 98765,
}'
  
RESPONSE

Python

Invoice(
    amount=12345,
    brcode=00020101021226600014br.gov.bcb.pix2538invoice-h.sandbox.starkbank.com/57301741758054405204000053039865802BR5910NightKing6010Winterfell62280524invoice/573017417580544063046B79,
    created=2020-10-26 17:10:57.261868,
    descriptions=[{'key': 'Arya', 'value': 'Not today'}],
    discount_amount=0,
    discounts=[{'percentage': 10.0, 'due': '2021-03-12T18:23:26+00:00'}],
    due=2021-05-12 15:23:26,
    expiration=98765,
    fee=0,
    pdf=https://invoice-h.sandbox.starkbank.com/pdf/851ff545535c40ba88e24a05accb9978,
    link=https://invoice-h.sandbox.starkbank.com/invoicelink/851ff545535c40ba88e24a05accb9978,
    fine=2.5,
    fine_amount=0,
    id=4600131349381120,
    interest=1.3,
    interest_amount=0,
    name=Arya Stark,
    nominal_amount=400000,
    status=canceled,
    tags=['War supply', 'Invoice #1234'],
    transaction_ids=[],
    tax_id=012.345.678-90,
    updated=2020-10-26 17:10:57.261877
)
  

Javascript

Invoice {
    id: '4600131349381120',
    amount: 12345,
    due: '2021-05-12T16:27:37.585000+00:00',
    taxId: '012.345.678-90',
    name: 'Arya Stark',
    expiration: 98765,
    fine: 2.5,
    interest: 1.3,
    discounts: [ { percentage: 10, due: '2021-03-12T14:16:10.639000+00:00' } ],
    tags: [ 'war supply', 'invoice #1234' ],
    transactionIds: [  ],
    descriptions: [ { key: 'Arya', value: 'Not today' } ],
    fee: 0,
    pdf: 'https://invoice-h.sandbox.starkbank.com/pdf/851ff545535c40ba88e24a05accb9978',
    link: 'https://invoice-h.sandbox.starkbank.com/invoicelink/851ff545535c40ba88e24a05accb9978',
    nominalAmount: 400000,
    fineAmount: 0,
    interestAmount: 0,
    discountAmount: 0,
    brcode: '00020101021226600014br.gov.bcb.pix2538invoice-h.sandbox.starkbank.com/57301741758054405204000053039865802BR5910NightKing6010Winterfell62280524invoice/573017417580544063046B79',
    status: 'canceled',
    created: '2020-10-26T17:10:57.606357+00:00',
    updated: '2020-10-26T17:10:57.606367+00:00'
}
  

PHP

StarkBank\Invoice Object
(
    [id] => 4600131349381120
    [amount] => 12345
    [due] => DateTime Object
        (
            [date] => 2021-05-12 18:00:00.000000
            [timezone_type] => 1
            [timezone] => +00:00
        )

    [taxId] => 012.345.678-90
    [name] => Arya Stark
    [expiration] => 98765
    [fee] => 0
    [pdf] => https://invoice-h.sandbox.starkbank.com/pdf/851ff545535c40ba88e24a05accb9978
    [link] => https://invoice-h.sandbox.starkbank.com/invoicelink/851ff545535c40ba88e24a05accb9978
    [fine] => 2.5
    [interest] => 1.3
    [discounts] => Array
        (
            [0] => Array
                (
                    [percentage] => 10
                    [due] => 2021-03-12T21:00:00+00:00
                )

        )

    [tags] => Array
        (
            [0] => war supply
            [1] => invoice #1234
        )

    [transactionIds] => Array
        (
        )

    [descriptions] => Array
        (
            [0] => Array
                (
                    [key] => Arya
                    [value] => Not today
                )

        )

    [nominalAmount] => 400000
    [fineAmount] => 0
    [interestAmount] => 0
    [discountAmount] => 0
    [brcode] => 00020101021226600014br.gov.bcb.pix2538invoice-h.sandbox.starkbank.com/57301741758054405204000053039865802BR5910NightKing6010Winterfell62280524invoice/573017417580544063046B79
    [status] => canceled
    [created] => DateTime Object
        (
            [date] => 2020-10-26 17:10:43.241309
            [timezone_type] => 1
            [timezone] => +00:00
        )

    [updated] => DateTime Object
        (
            [date] => 2020-10-26 17:10:43.241320
            [timezone_type] => 1
            [timezone] => +00:00
        )

)
  

Java

import com.starkbank.*;

HashMap<String, Object> patchData = new HashMap<>();
patchData.put("status", "canceled");
patchData.put("amount", 12345);
patchData.put("expiration", 98765);

Invoice invoice = Invoice.update("4600131349381120", data);

System.out.println(invoice);
  

Ruby

invoice(
    id: 4600131349381120,
    amount: 12345,
    due: 2021-05-12T11:00:20+00:00,
    tax_id: 012.345.678-90,
    name: Arya Stark,
    expiration: 98765,
    fee: 0,
    pdf: https://invoice-h.sandbox.starkbank.com/pdf/851ff545535c40ba88e24a05accb9978,
    link: https://invoice-h.sandbox.starkbank.com/invoicelink/851ff545535c40ba88e24a05accb9978,
    fine: 2.5,
    interest: 1.3,
    discounts: [
        (
            percentage: 5,
            due: 2021-03-12T14:00:21+00:00
        )
    ],
    tags: ["war supply", "invoice #1234"],
    transaction_ids: [],
    descriptions: [
        (
            key: Arya,
            value: Not today
        )
    ],
    nominal_amount: 23571,
    fine_amount: 0,
    interest_amount: 0,
    discount_amount: 0,
    brcode: 00020101021226860014br.gov.bcb.pix2564invoice-h.sandbox.starkbank.com/0e272677d4924d1fa3520cfda61b0f6f5204000053039865802BR5933Matheus Coelho Ferraz 418128448406009Sao Paulo62200516643401702073958463047661,
    status: canceled,
    updated: 2020-10-26T14:00:21+00:00,
    created: 2020-10-26T14:00:21+00:00
)
  

Elixir

%StarkBank.Invoice{
    amount: 12345,
    brcode: "00020101021226600014br.gov.bcb.pix2538invoice-h.sandbox.starkbank.com/57301741758054405204000053039865802BR5910NightKing6010Winterfell62280524invoice/573017417580544063046B79",
    created: ~U[2020-10-26 18:36:18.116954Z],
    descriptions: [
        %{"key" => "Arya", "value" => "Not today"}
    ],
    discount_amount: 0,
    discounts: [
        %{"due" => "2020-11-23T21:36:18.223000+00:00", "percentage" => 10.0}
    ],
    due: "2020-05-12T18:36:18.219000+00:00",
    expiration: 98765,
    fee: 0,
    pdf: "https://invoice-h.sandbox.starkbank.com/pdf/851ff545535c40ba88e24a05accb9978",
    link: "https://invoice-h.sandbox.starkbank.com/invoicelink/851ff545535c40ba88e24a05accb9978",
    fine: 2.5,
    fine_amount: 0,
    id: "4600131349381120",
    interest: 1.3,
    interest_amount: 0,
    name: "Arya Stark",
    nominal_amount: 400000,
    status: "canceled",
    tags: ["war supply", "invoice #1234"],
    transaction_ids: [],
    tax_id: "012.345.678-90",
    updated: ~U[2020-10-26 18:36:18.116976Z]
}
  

C#

Invoice(
    Name: Arya Stark,
    TaxID: 012.345.678-90,
    Due: 12/05/2021 20:30:00,
    Expiration: 98765,
    Fee: 0,
    Pdf: https://invoice-h.sandbox.starkbank.com/pdf/851ff545535c40ba88e24a05accb9978,
    Link: https://invoice-h.sandbox.starkbank.com/invoicelink/851ff545535c40ba88e24a05accb9978,
    Fine: 2,5,
    Interest: 1,3,
    Descriptions: { { { key, Arya }, { value, Not today } } },
    Discounts: { { { percentage, 10 }, { due, 30/05/2021 23:30:00 } } },
    Tags: { war supply, invoice #1234 },
    TransactionIds: {  },
    Amount: 12345,
    NominalAmount: 400000,
    FineAmount: 0,
    InterestAmount: 0,
    DiscountAmount: 0,
    Brcode: 00020101021226600014br.gov.bcb.pix2538invoice-h.sandbox.starkbank.com/57301741758054405204000053039865802BR5910NightKing6010Winterfell62280524invoice/573017417580544063046B79,
    Status: canceled,
    Created: 26/10/2020 12:56:53,
    Updated: 26/10/2020 12:56:53,
    ID: 4600131349381120
)
  

Go

{
    Id:4600131349381120 
    Amount:12345 
    Name:Arya Stark
    TaxId:012.345.678-90
    Due:2021-05-12 16:54:53.5521 +0000 +0000 
    Expiration:98765 
    Fine:2.5 
    Interest:1.3 
    Discounts:[map[due:2023-02-16T16:20:16.621546+00:00 percentage:5]]
    Tags:[war supply invoice #1234] 
    Descriptions:[map[key:Arya value:Not today]]
    Pdf:https://invoice-h.sandbox.starkbank.com/pdf/851ff545535c40ba88e24a05accb9978 
    Link:https://invoice-h.sandbox.starkbank.com/invoicelink/851ff545535c40ba88e24a05accb9978 
    NominalAmount:400000 
    FineAmount:0 
    InterestAmount:0 
    DiscountAmount:0 
    Brcode:00020101021226600014br.gov.bcb.pix2538invoice-h.sandbox.starkbank.com/57301741758054405204000053039865802BR5910NightKing6010Winterfell62280524invoice/573017417580544063046B79 
    Status:canceled 
    Fee:0 
    TransactionIds:[] 
    Created:2020-10-26 17:10:54.16799 +0000 +0000 
    Updated:2020-10-26 17:10:54.24204 +0000 +0000
}
  

Clojure

{
    :amount 12345, 
    :interest-amount 0, 
    :fee 0, 
    :tags [war supply invoice #1234], 
    :transaction-ids [], 
    :updated 2020-10-26T06:09:07.540753+00:00, 
    :name Iron Bank S.A., 
    :expiration 98765, 
    :tax-id 012.345.678-90, 
    :pdf https://invoice-h.sandbox.starkbank.com/pdf/851ff545535c40ba88e24a05accb9978, 
    :link https://invoice-h.sandbox.starkbank.com/invoicelink/851ff545535c40ba88e24a05accb9978, 
    :nominal-amount 400000, 
    :created 2020-10-26T06:09:07.540724+00:00, 
    :discounts [
        {
            :percentage 5.0, 
            :due 2021-03-12T22:32:35.418698+00:00
        } 
    ], 
    :due 2021-05-12T19:32:35.418698+00:00,
    :status canceled,
    :interest 1.3, 
    :id 4600131349381120,
    :fine 2.5,
    :fine-amount 0,
    :discount-amount 0,
    :brcode 00020101021226600014br.gov.bcb.pix2538invoice-h.sandbox.starkbank.com/57301741758054405204000053039865802BR5910NightKing6010Winterfell62280524invoice/573017417580544063046B79,
    :descriptions [
        {
            :key Product X,
            :value big
        }
    ]
}
  

Curl

{
    "invoice": {
        "id": "4600131349381120",
        "status": "canceled",
        "amount": 12345,
        "nominalAmount": 400000,
        "fineAmount": 0,
        "interestAmount": 0,
        "discountAmount": 0,
        "expiration": 98765,
        "discounts": [
            {
                "percentage": 5.0
                "due": 2021-03-12T01:50:50.264656+00:00
            }
        ],
        "descriptions": [
            {
                "key": "Arya"
                "value": "Not today"
            }
        ],
        "name": "Arya Stark",
        "taxId": "012.345.678-90",
        "fee": 0,
        "pdf": "https://invoice-h.sandbox.starkbank.com/pdf/851ff545535c40ba88e24a05accb9978",
        "link": "https://invoice-h.sandbox.starkbank.com/invoicelink/851ff545535c40ba88e24a05accb9978",
        "fine": 2.5,
        "interest": 1.3,
        "tags": [
            "War supply",
            "Invoice #1234"
        ],
        "transactionIds": [],
        "brcode": "00020101021226600014br.gov.bcb.pix2538invoice-h.sandbox.starkbank.com/57301741758054405204000053039865802BR5910NightKing6010Winterfell62280524invoice/573017417580544063046B79",
        "created": "2020-10-26T01:50:50.264656+00:00",
        "updated": "2020-10-26T01:50:50.264656+00:00",
        "due": "2020-05-12T17:59:26.000000+00:00",
    }
}
  

Get an Invoice QR Code

Get the invoice QR Code png file. Similarly to the Boleto PDF, we create a QR Code image file with the invoice data so that your customer can pay it through Pix.

Parameters

id REQUIRED

Id of the invoice entity.

size OPTIONAL

Number of pixels in each 'box' of the QR code. Minimum = 1 and maximum = 50. Default value = 7.

ENDPOINT
GET /v2/invoice/:id/qrcode
REQUEST

Python

import starkbank

qrcode = starkbank.invoice.qrcode("4600131349381120", size=15)

with open("qrcode.png", "wb") as file:
    file.write(qrcode)
  

Javascript

const starkbank = require('starkbank');
const fs = require('fs').promises;

(async() => {
    let qrcode = await starkbank.invoice.qrcode('4600131349381120', size=7)

    await fs.writeFile('invoice.png', qrcode);
})();
  

PHP

use StarkBank\Invoice;

$png = Invoice::qrcode("4600131349381120", ["size" => 7]);

$fp = fopen('qrcode.png', 'w');
fwrite($fp, $png);
fclose($fp);
  

Java

import java.io.File;
import java.io.InputStream;
import java.nio.file.StandardCopyOption;
import com.starkbank.*;
import java.util.HashMap;

HashMap<String, Object> options = new HashMap<>();
options.put("size", 7);
InputStream png = Invoice.qrcode("4600131349381120", options);

java.nio.file.Files.copy(
    png,
    new File("qrcode.png").toPath(),
    StandardCopyOption.REPLACE_EXISTING
);
  

Ruby

require('starkbank')

qrcode = StarkBank::Invoice.qrcode('4600131349381120')

File.binwrite('qrcode.png', qrcode)
  

Elixir

qrcode = StarkBank.Invoice.qrcode!("4600131349381120")

file = File.open!("qrcode.png", [:write])
IO.binwrite(file, qrcode)
File.close(file)
  

C#

using System;

byte[] png = StarkBank.Invoice.Qrcode("4600131349381120");

System.IO.File.WriteAllBytes("qrcode.png", png);
  

Go

package main

import (
    "fmt"
    "github.com/starkbank/sdk-go/starkbank/invoice"
    "io/ioutil"
)

func main() {

    qrcode, err := invoice.Qrcode("4600131349381120", nil, nil)
    if err.Errors != nil {
        for _, e := range err.Errors {
            fmt.Printf("code: %s, message: %s", e.Code, e.Message)
        }
    }
    
    errFile := ioutil.WriteFile("qrcode.png", qrcode, 0666)
    if errFile != nil {
        fmt.Print(errFile)
    }
}
  

Clojure

(def qrcode (starkbank.invoice/qrcode "4600131349381120"))

(def file-name "invoice-qrcode.png")
(io/make-parents file-name)
(io/copy qrcode (io/file file-name))
  

Curl

curl --location --request GET '{{baseUrl}}/v2/invoice/4600131349381120/qrcode' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}'
  

Get an Invoice PDF

Get the invoice PDF file. Similarly to the Boleto PDF, we create a PDF file with the invoice data and the QR Code so that your customer can pay it through Pix. The same PDF can also be accessed by the public "pdf" parameter returned in the Invoice JSON. This link is the one you should send to your customers.

Parameters

id REQUIRED

Id of the invoice entity.

ENDPOINT
GET /v2/invoice/:id/pdf
REQUEST

Python

import starkbank

pdf = starkbank.invoice.pdf("4600131349381120")

with open("invoice.pdf", "wb") as file:
    file.write(pdf)
  

Javascript

const starkbank = require('starkbank');
const fs = require('fs').promises;

(async() => {
    let pdf = await starkbank.invoice.pdf('4600131349381120');
    await fs.writeFile('invoice.pdf', pdf);
})();
  

PHP

$pdf = StarkBank\Invoice::pdf("4600131349381120");

$fp = fopen('invoice.pdf', 'w');
fwrite($fp, $pdf);
fclose($fp);
  

Java

import java.io.File;
import java.io.InputStream;
import java.nio.file.StandardCopyOption;
import com.starkbank.*;

InputStream pdf = Invoice.pdf("4600131349381120");

java.nio.file.Files.copy(
    pdf,
    new File("invoice.pdf").toPath(),
    StandardCopyOption.REPLACE_EXISTING
);
  

Ruby

require('starkbank')

pdf = StarkBank::Invoice.pdf('4600131349381120')

File.open('invoice.pdf', 'w') { |file| file.write(pdf) }
  

Elixir

pdf = StarkBank.Invoice.pdf!("4600131349381120")

file = File.open!("invoice.pdf", [:write])
IO.binwrite(file, pdf)
File.close(file)
  

C#

byte[] pdf = Invoice.Pdf("4600131349381120");

System.IO.File.WriteAllBytes("invoice.pdf", pdf);
  

Go

package main

import (
    "fmt"
    "github.com/starkbank/sdk-go/starkbank/invoice"
    "io/ioutil"
)

func main() {

    pdf, err := invoice.Pdf("4600131349381120", nil, nil)
    if err.Errors != nil {
        for _, e := range err.Errors {
            fmt.Printf("code: %s, message: %s", e.Code, e.Message)
        }
    }
    
    errFile := ioutil.WriteFile("invoice.pdf", pdf, 0666)
    if errFile != nil {
        fmt.Print(errFile)
    }
}
  

Clojure

(clojure.java.io/copy
(starkbank.invoice/pdf "4600131349381120")
(clojure.java.io/file "invoice.pdf"))
  

Curl

curl --location --request GET '{{baseUrl}}/v2/invoice/4600131349381120/pdf' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}'
  

List Invoice Logs

Get a paged list of invoice logs. A log tracks a change in the invoice entity according to its life cycle.

Parameters

after OPTIONAL

Filter entities created after this date.

before OPTIONAL

Filter entities created before this date.

cursor OPTIONAL

String used to get the next batch of results. Our SDKs handle this for you.

fields OPTIONAL

List of strings to filter response JSON keys. Not available in the SDKs.

invoiceIds OPTIONAL

Array of invoice ids that are linked to the logs you desire.

limit OPTIONAL

Number of results per cursor. Max = 100.

types OPTIONAL

Filters logs by log types.

ENDPOINT
GET /v2/invoice/log
REQUEST

Python

import starkbank

logs = starkbank.invoice.log.query(
    after="2020-10-01",
    before="2020-10-30"
)

for log in logs:
    print(log)
  

Javascript

const starkbank = require('starkbank');

(async() => {
    let logs = await starkbank.invoice.log.query({
        after: '2020-10-01',
        before: '2020-10-30',
    });

    for await (let log of logs) {
        console.log(log);
    }
})();
  

PHP

use StarkBank\Invoice\Log;

$invoiceLogs = iterator_to_array(Log::query([
    "after" => "2020-10-01",
    "before" => "2020-10-30"
]));

foreach($invoiceLogs as $log) {
    print_r($log);
  

Java

import com.starkbank.*;
import com.starkbank.utils.Generator;
import java.util.HashMap;

HashMap<String, Object> params = new HashMap<>();
params.put("after", "2020-10-01");
params.put("before", "2020-10-30");
Generator<Invoice.Log> logs = Invoice.Log.query(params);

for (Invoice.Log log : logs){
    System.out.println(log);
}
  

Ruby

require('starkbank')

logs = StarkBank::Invoice::Log.query(
    after: '2020-10-01',
    before: '2020-10-30'
)

logs.each do |log|
    puts log
end
  

Elixir

logs = StarkBank.Invoice.Log.query!(
    after: "2020-10-01",
    before: "2020-10-30"
)

for log <- logs do
    log |> IO.inspect
end
  

C#

using System;
using System.Collections.Generic;

IEnumerable<StarkBank.Invoice.Log> logs = StarkBank.Invoice.Log.Query(
    after: new DateTime(2020, 10, 1),
    before: new DateTime(2020, 10, 30)
);

foreach (StarkBank.Invoice.Log log in logs)
{
    Console.WriteLine(log);
}
  

Go

package main

import (
    "fmt"
    "time"
    "github.com/starkbank/sdk-go/starkbank/invoice/log"
)

func main() {

    var params = map[string]interface{}{}
    params["after"] = time.Date(2020, 10, 1, 0, 0, 0, 0, time.UTC)
    params["before"] = time.Date(2020, 10, 30, 0, 0, 0, 0, time.UTC)
    
    logs, errorChannel := log.Query(params, nil)

    loop:
    for {
        select {
        case err := <-errorChannel:
            if err.Errors != nil {
                for _, e := range err.Errors {
                    fmt.Printf("code: %s, message: %s", e.Code, e.Message)
                }
            }
        case log, ok := <-logs:
            if !ok {
                break loop
            }
            fmt.Printf("%+v", log)
        }
    }
}
  

Clojure

(def logs (starkbank.invoice.log/query {
    :after "2020-10-1", 
    :before "2020-10-30"
}))

(doseq [log logs]
    (println log))
  

Curl

curl --location --request GET '{{baseUrl}}/v2/invoice/log?after=2020-10-01&before=2020-10-30' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}'
  
RESPONSE

Python

Log(
    created=2020-10-27 00:30:12.141283,
    errors=[],
    id=6742710681600000,
    type=credited,
    invoice=Invoice(
        amount=120000,
        brcode=00020101021226860014br.gov.bcb.pix2564invoice-h.sandbox.starkbank.com/7e0b4b71ec924f48865a4a3d979565f65204000053039865802BR5915Stark Bank S.A.6009Sao Paulo62070503***6304365D,
        created=2020-10-27 00:24:56.372300,
        descriptions=[{'value': 'Not today', 'key': 'Arya'}],
        discount_amount=0,
        discounts=[{'percentage': 10.0, 'due': '2021-03-12T18:23:26+00:00'}],
        due=2021-05-12 15:23:26,
        expiration=123456789,
        fee=0,
        pdf=https://invoice-h.sandbox.starkbank.com/pdf/851ff545535c40ba88e24a05accb9978,
        link=https://invoice-h.sandbox.starkbank.com/invoicelink/851ff545535c40ba88e24a05accb9978,
        fine=2.5,
        fine_amount=0,
        id=5616810774757376,
        interest=1.3,
        interest_amount=0,
        name=Arya Stark,
        nominal_amount=120000,
        status=paid,
        tags=['new sword', 'invoice #1234'],
        transaction-ids=[],
        tax_id=012.345.678-90,
        updated=2020-10-27 00:30:12.362815
    )
)
  

Javascript

Log {
    id: '6742710681600000',
    created: '2020-10-27T16:40:45.571311+00:00',
    type: 'credited',
    errors: [],
    invoice: {
        status: 'paid',
        updated: '2020-10-27T16:40:45.784728+00:00',
        taxId: '012.345.678-90',
        interest: 1.3,
        tags: [ 'new sword', 'invoice #1234' ],
        transactionIds: [],
        interestAmount: 0,
        created: '2020-10-27T15:24:40.674849+00:00',
        due: '2021-05-12T14:24:58.287000+00:00',
        descriptions: [ { key: 'Arya', value: 'Not today' } ],
        nominalAmount: 120000,
        discounts: [ { percentage: 10, due: '2021-03-12T14:16:10.639000+00:00' } ],
        amount: 120000,
        brcode: '00020101021226860014br.gov.bcb.pix2564invoice-h.sandbox.starkbank.com/7e0b4b71ec924f48865a4a3d979565f65204000053039865802BR5915Stark Bank S.A.6009Sao Paulo62070503***6304365D',
        expiration: 123456789,
        fineAmount: 0,
        discountAmount: 0,
        fee: 0,
        pdf: 'https://invoice-h.sandbox.starkbank.com/pdf/851ff545535c40ba88e24a05accb9978',
        link: 'https://invoice-h.sandbox.starkbank.com/invoicelink/851ff545535c40ba88e24a05accb9978',
        fine: 2.5,
        id: '5616810774757376',
        name: 'Arya Stark'
  }
}
  

PHP

StarkBank\Invoice\Log Object
(
    [id] => 6742710681600000
    [created] => DateTime Object
        (
            [date] => 2020-10-28 18:37:30.955089
            [timezone_type] => 1
            [timezone] => +00:00
        )

    [type] => credited
    [errors] => Array
        (
        )

    [invoice] => StarkBankInvoice Object
        (
            [id] => 5616810774757376
            [amount] => 120000
            [due] => DateTime Object
                (
                    [date] => 2021-05-12 18:00:00.000000
                    [timezone_type] => 1
                    [timezone] => +00:00
                )

            [taxId] => 012.345.678-90
            [name] => Arya Stark
            [expiration] => 123456789
            [fee] => 0
            [pdf] => https://invoice-h.sandbox.starkbank.com/pdf/851ff545535c40ba88e24a05accb9978
            [link] => https://invoice-h.sandbox.starkbank.com/invoicelink/851ff545535c40ba88e24a05accb9978
            [fine] => 2.5
            [interest] => 1.3
            [discounts] => Array
                (
                    [0] => Array
                        (
                            [percentage] => 10
                            [due] => 2021-03-12T21:00:00+00:00
                        )

                )

            [tags] => Array
                (
                    [0] => new sword
                    [1] => invoice #1234
                )
                
            [transactionIds] => Array
                (
                )

            [descriptions] => Array
                (
                    [0] => Array
                        (
                            [value] => Arya
                            [key] => Not today
                        )

                )

            [nominalAmount] => 120000
            [fineAmount] => 0
            [interestAmount] => 0
            [discountAmount] => 0
            [brcode] => 00020101021226860014br.gov.bcb.pix2564invoice-h.sandbox.starkbank.com/7e0b4b71ec924f48865a4a3d979565f65204000053039865802BR5915Stark Bank S.A.6009Sao Paulo62070503***6304365D
            [status] => paid
            [created] => DateTime Object
                (
                    [date] => 2020-10-27 18:37:30.924143
                    [timezone_type] => 1
                    [timezone] => +00:00
                )

            [updated] => DateTime Object
                (
                    [date] => 2020-10-27 18:50:08.046495
                    [timezone_type] => 1
                    [timezone] => +00:00
                )

        )

)
  

Java

import com.starkbank.*;
import com.starkbank.utils.Generator;
import java.util.HashMap;

HashMap<String, Object> params = new HashMap<>();
params.put("after", "2020-10-01");
params.put("before", "2020-10-30");
Generator<Invoice.Log> logs = Invoice.Log.query(params);

for (Invoice.Log log : logs){
    System.out.println(log);
}
  

Ruby

log(
    id: 6742710681600000,
    type: created,
    errors: [],
    created: 2020-10-27T14:00:21+00:00,
    invoice: invoice(
        id: 5616810774757376,
        amount: 120000,
        due: 2021-05-12T11:00:20+00:00,
        tax_id: 012.345.678-90,
        name: Arya Stark,
        expiration: 123456789,
        fee: 0,
        pdf: https://invoice-h.sandbox.starkbank.com/pdf/851ff545535c40ba88e24a05accb9978,
        link: https://invoice-h.sandbox.starkbank.com/invoicelink/851ff545535c40ba88e24a05accb9978,
        fine: 2.5,
        interest: 1.3,
        discounts: [
            (
                percentage: 5,
                due: 2021-03-12T14:00:21+00:00
            )
        ],
        tags: ["new sword", "invoice #1234"],
        descriptions: [
            (
                key: Arya,
                value: Not today
            )
        ],
        transaction_ids: [],
        nominal_amount: 120000,
        fine_amount: 0,
        interest_amount: 0,
        discount_amount: 0,
        brcode: 00020101021226860014br.gov.bcb.pix2564invoice-h.sandbox.starkbank.com/7e0b4b71ec924f48865a4a3d979565f65204000053039865802BR5915Stark Bank S.A.6009Sao Paulo62070503***6304365D,
        status: paid,
        updated: 2020-10-27T14:09:20+00:00,
        created: 2020-10-27T14:00:21+00:00
    )
)
  

Elixir

%StarkBank.Invoice.Log{
    created: ~U[2020-10-27 18:45:02.141607Z],
    errors: [],
    id: "6742710681600000",
    invoice: %StarkBank.Invoice{
        amount: 120000,
        brcode: "00020101021226860014br.gov.bcb.pix2564invoice-h.sandbox.starkbank.com/7e0b4b71ec924f48865a4a3d979565f65204000053039865802BR5915Stark Bank S.A.6009Sao Paulo62070503***6304365D",
        created: ~U[2020-11-13 18:36:18.116954Z],
        descriptions: [%{"key" => "Arya", "value" => "Not today"}],
        discount_amount: 0,
        discounts: [
            %{"due" => "2021-03-12T21:36:18.223000+00:00", "percentage" => 10.0}
        ],
        due: "2021-05-12T18:45:02.924000+00:00",
        expiration: 123456789,
        fee: 0,
        pdf: "https://invoice-h.sandbox.starkbank.com/pdf/851ff545535c40ba88e24a05accb9978",
        link: "https://invoice-h.sandbox.starkbank.com/invoicelink/851ff545535c40ba88e24a05accb9978",
        fine: 2.5,
        fine_amount: 0,
        id: "5616810774757376",
        interest: 1.3,
        interest_amount: 0,
        name: "Arya Stark",
        transaction_ids: [],
        nominal_amount: 120000,
        status: "paid",
        tags: ["new sword", "invoice #1234"],
        tax_id: "012.345.678-90",
        updated: ~U[2020-10-27 18:45:02.780963Z]
    },
    type: "credited"
}
  

C#

Log(
    Created: 27/10/2020 13:22:11,
    Type: credited,
    Errors: {  },
    Invoice: Invoice(
        Name: Arya Stark,
        TaxID: 012.345.678-90,
        Due: 12/05/2021 13:17:15,
        Expiration: 123456789,
        Fee: 0,
        Pdf: https://invoice-h.sandbox.starkbank.com/pdf/851ff545535c40ba88e24a05accb9978,
        Link: https://invoice-h.sandbox.starkbank.com/invoicelink/851ff545535c40ba88e24a05accb9978,
        Fine: 2,5,
        Interest: 1,3,
        Descriptions: { { { value, Not today }, { key, Arya } } },
        Discounts: { { { percentage, 10 }, { due, 30/05/2021 23:30:00 } } },
        Tags: { new sword, invoice #1234 },
        TransactionIds: {  },
        Amount: 120000,
        NominalAmount: 120000,
        FineAmount: 0,
        InterestAmount: 0,
        DiscountAmount: 0,
        Brcode: 00020101021226860014br.gov.bcb.pix2564invoice-h.sandbox.starkbank.com/7e0b4b71ec924f48865a4a3d979565f65204000053039865802BR5915Stark Bank S.A.6009Sao Paulo62070503***6304365D,
        Status: paid,
        Created: 27/10/2020 12:56:53,
        Updated: 27/10/2020 13:22:11,
        ID: 5616810774757376
    ),
    ID: 6742710681600000
)
  

Go

{
    Id:6742710681600000 
    Invoice:{
        Id:5616810774757376 
        Amount:120000 
        Name:Arya Stark
        TaxId:012.345.678-90 
        Due:2021-05-12 19:20:36.638 +0000 +0000 
        Expiration:123456789 
        Fine:2.5 
        Interest:1.3 
        Discounts:[
            map[
                due:2021-03-12T07:42:01.528000+00:00 
                percentage:10
            ]
        ] 
        Tags:[new sword invoice #1234] 
        Descriptions:[
            map[
                key:Arya 
                value:Not today
            ]
        ] 
        Pdf:https://invoice-h.sandbox.starkbank.com/pdf/851ff545535c40ba88e24a05accb9978 
        Link:https://invoice-h.sandbox.starkbank.com/invoicelink/851ff545535c40ba88e24a05accb9978
        NominalAmount:120000 
        FineAmount:0 
        InterestAmount:0 
        DiscountAmount:0 
        Brcode:00020101021226860014br.gov.bcb.pix2564invoice-h.sandbox.starkbank.com/7e0b4b71ec924f48865a4a3d979565f65204000053039865802BR5915Stark Bank S.A.6009Sao Paulo62070503***6304365D
        Status:paid 
        Fee:0 
        TransactionIds:[] 
        Created:2020-10-27 19:21:03.033976 +0000 +0000 
        Updated:2020-10-27 23:37:22.858647 +0000 +0000
    } 
    Errors:[] 
    Type:credited 
    Created:2020-10-27 19:20:37.522415 +0000 +0000
}
  

Clojure

{
    :id 6742710681600000,
    :created 2020-10-27T07:00:06.804223+00:00,
    :errors [],
    :type credited,
    :invoice {
        :amount 120000,
        :interest-amount 0,
        :fee 0,
        :tags [war supply invoice #1234],
        :updated 2020-10-27T07:00:07.175487+00:00,
        :name Arya Stark,
        :expiration 123456789,
        :tax-id 012.345.678-90,
        :pdf https://invoice-h.sandbox.starkbank.com/pdf/851ff545535c40ba88e24a05accb9978,
        :link https://invoice-h.sandbox.starkbank.com/invoicelink/851ff545535c40ba88e24a05accb9978,
        :nominal-amount 120000,
        :created 2020-10-27T06:41:14.165375+00:00,
        :discounts [
            {
                :percentage 10.0,
                :due 2021-03-12T06:41:12.584000+00:00
            }
        ],
        :due 2021-05-12T03:41:14.560000+00:00,
        :status paid,
        :interest 1.3,
        :id 5616810774757376,
        :fine 2.5,
        :fine-amount 0,
        :transaction-ids[]
        :discount-amount 0,
        :brcode 00020101021226860014br.gov.bcb.pix2564invoice-h.sandbox.starkbank.com/7e0b4b71ec924f48865a4a3d979565f65204000053039865802BR5915Stark Bank S.A.6009Sao Paulo62070503***6304365D,
        :descriptions [
            {
                :key Arya,
                :value Not today
            }
        ]
    }
}
  

Curl

{
    "cursor": null,
    "logs": [
        {
            "id": "6742710681600000",
            "created": "2020-10-27T23:00:08.338233+00:00",
            "errors": [],
            "type": "credited",
            "invoice": {
                "id": "5616810774757376",
                "status": "paid",
                "amount": 120000,
                "nominalAmount": 120000,
                "fineAmount": 0,
                "interestAmount": 0,
                "discountAmount": 0,
                "expiration": 123456789,
                "discounts": [
                    {
                        "percentage": 10
                        "due": "2020-11-25T17:59:26.000000+00:00"
                    }
                ],
                "descriptions": [
                    {
                        "key": "Arya"
                        "value": "Not today"
                    }
                ],
                "name": "Arya Stark",
                "taxId": "012.345.678-90",
                "fee": 0,
                "pdf": "https://invoice-h.sandbox.starkbank.com/pdf/851ff545535c40ba88e24a05accb9978",
                "link": "https://invoice-h.sandbox.starkbank.com/invoicelink/851ff545535c40ba88e24a05accb9978",
                "fine": 2.5,
                "interest": 1.3,
                "tags": [
                    "War supply",
                    "Invoice #1234"
                ],
                "transactionIds": [],
                "brcode": "00020101021226860014br.gov.bcb.pix2564invoice-h.sandbox.starkbank.com/7e0b4b71ec924f48865a4a3d979565f65204000053039865802BR5915Stark Bank S.A.6009Sao Paulo62070503***6304365D",
                "created": "2020-10-27T01:50:50.264656+00:00",
                "updated": "2020-10-27T01:50:50.264656+00:00",
                "due": "2021-05-12T17:59:26.000000+00:00"
            }
        }
    ]
}
  

Get an Invoice Log

Get a single invoice Log by its id.

Parameters

id REQUIRED

Id of the log entity.

fields OPTIONAL

List of strings to filter response JSON keys. Not available in the SDKs.

ENDPOINT
GET /v2/invoice/log/:id
REQUEST

Python

import starkbank

log = starkbank.invoice.log.get("6742710681600000")

print(log)
  

Javascript

const starkbank = require('starkbank');

(async() => {
    let log = await starkbank.invoice.log.get('6742710681600000');
    console.log(log);
})();
  

PHP

use StarkBank\Invoice\Log;

$invoiceLog = Log::get("6742710681600000");

print_r($invoiceLog);
  

Java

Log({
    "id": "6742710681600000",
    "created": "2020-10-27T18:20:09.558082+00:00",
    "type": "credited",
    "errors": [],
    "invoice": {
        "amount": 120000,
        "due": "2020-10-30T18:15:53.754000+00:00",
        "taxId": "012.345.678-90",
        "name": "Arya Stark",
        "expiration": 123456789,
        "fee": 0,
        "pdf": "https://invoice-h.sandbox.starkbank.com/pdf/851ff545535c40ba88e24a05accb9978",
        "link": "https://invoice-h.sandbox.starkbank.com/invoicelink/851ff545535c40ba88e24a05accb9978",
        "fine": 2.5,
        "interest": 1.3,
        "descriptions": [
        {
            "key": "Arya",
            "value": "Not today"
        }
        ],
        "discounts": [
        {
            "percentage": 10,
            "due": "2021-03-12T21:15:53.754000+00:00"
        }
        ],
        "tags": ["new sword", "invoice #1234"],
        "transaction_ids": [],
        "nominalAmount": 120000,
        "fineAmount": 0,
        "interestAmount": 0,
        "discountAmount": 0,
        "brcode": "00020101021226860014br.gov.bcb.pix2564invoice-h.sandbox.starkbank.com/7e0b4b71ec924f48865a4a3d979565f65204000053039865802BR5915Stark Bank S.A.6009Sao Paulo62070503***6304365D",
        "status": "paid",
        "created": "2020-10-27T18:15:53.894294+00:00",
        "updated": "2020-10-27T18:20:11.266852+00:00",
        "id": "5616810774757376"
    }
})
  

Ruby

require('starkbank')

log = StarkBank::Invoice::Log.get('6742710681600000')

puts log
  

Elixir

log = StarkBank.Invoice.Log.get!("6742710681600000")
|> IO.inspect
  

C#

using System;

StarkBank.Invoice.Log log = StarkBank.Invoice.Log.Get("6742710681600000");

Console.WriteLine(log);
  

Go

package main

import (
    "fmt"
    "github.com/starkbank/sdk-go/starkbank/invoice/log"
)

func main() {

    log, err := log.Get("6742710681600000", nil)
    if err.Errors != nil {
        for _, e := range err.Errors {
            fmt.Printf("code: %s, message: %s", e.Code, e.Message)
        }
    }
    
    fmt.Printf("%+v", log)
}
  

Clojure

(def log (starkbank.invoice.log/get "6742710681600000"))

(println log)
  

Curl

curl --location --request GET '{{baseUrl}}/v2/invoice/log/6742710681600000' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}'
  
RESPONSE

Python

Log(
    created=2020-10-27 00:30:12.141283,
    errors=[],
    id=6742710681600000,
    type=credited,
    invoice=Invoice(
        amount=120000,
        brcode=00020101021226860014br.gov.bcb.pix2564invoice-h.sandbox.starkbank.com/7e0b4b71ec924f48865a4a3d979565f65204000053039865802BR5915Stark Bank S.A.6009Sao Paulo62070503***6304365D,
        created=2020-10-27 00:24:56.372300,
        descriptions=[{'value': 'Not today', 'key': 'Arya'}],
        discount_amount=0,
        discounts=[{'percentage': 10.0, 'due': '2021-03-12T18:23:26+00:00'}],
        due=2021-05-12 15:23:26,
        expiration=123456789,
        fee=0,
        pdf=https://invoice-h.sandbox.starkbank.com/pdf/851ff545535c40ba88e24a05accb9978,
        link=https://invoice-h.sandbox.starkbank.com/invoicelink/851ff545535c40ba88e24a05accb9978,
        fine=2.5,
        fine_amount=0,
        id=5616810774757376,
        interest=1.3,
        interest_amount=0,
        name=Arya Stark,
        nominal_amount=120000,
        status=paid,
        tags=['new sword', 'invoice #1234'],
        transaction-ids=[],
        tax_id=012.345.678-90,
        updated=2020-10-27 00:30:12.362815
    )
)
  

Javascript

Log {
    id: '6742710681600000',
    created: '2020-10-27T16:40:45.571311+00:00',
    type: 'credited',
    errors: [],
    invoice: {
        status: 'paid',
        updated: '2020-10-27T16:40:45.784728+00:00',
        taxId: '012.345.678-90',
        interest: 1.3,
        tags: [ 'new sword', 'invoice #1234' ],
        transactionIds: [],
        interestAmount: 0,
        created: '2020-10-27T15:24:40.674849+00:00',
        due: '2021-05-12T14:24:58.287000+00:00',
        descriptions: [ { key: 'Arya', value: 'Not today' } ],
        nominalAmount: 120000,
        discounts: [ { percentage: 10, due: '2021-03-12T14:16:10.639000+00:00' } ],
        amount: 120000,
        brcode: '00020101021226860014br.gov.bcb.pix2564invoice-h.sandbox.starkbank.com/7e0b4b71ec924f48865a4a3d979565f65204000053039865802BR5915Stark Bank S.A.6009Sao Paulo62070503***6304365D',
        expiration: 123456789,
        fineAmount: 0,
        discountAmount: 0,
        fee: 0,
        pdf: 'https://invoice-h.sandbox.starkbank.com/pdf/851ff545535c40ba88e24a05accb9978',
        link: 'https://invoice-h.sandbox.starkbank.com/invoicelink/851ff545535c40ba88e24a05accb9978',
        fine: 2.5,
        id: '5616810774757376',
        name: 'Arya Stark'
    }
}
  

PHP

StarkBank\Invoice\Log Object
(
    [id] => 6742710681600000
    [created] => DateTime Object
        (
            [date] => 2020-10-28 18:37:30.955089
            [timezone_type] => 1
            [timezone] => +00:00
        )

    [type] => credited
    [errors] => Array
        (
        )

    [invoice] => StarkBankInvoice Object
        (
            [id] => 5616810774757376
            [amount] => 120000
            [due] => DateTime Object
                (
                    [date] => 2021-05-12 18:00:00.000000
                    [timezone_type] => 1
                    [timezone] => +00:00
                )

            [taxId] => 012.345.678-90
            [name] => Arya Stark
            [expiration] => 123456789
            [fee] => 0
            [pdf] => https://invoice-h.sandbox.starkbank.com/pdf/851ff545535c40ba88e24a05accb9978
            [link] => https://invoice-h.sandbox.starkbank.com/invoicelink/851ff545535c40ba88e24a05accb9978
            [fine] => 2.5
            [interest] => 1.3
            [discounts] => Array
                (
                    [0] => Array
                        (
                            [percentage] => 10
                            [due] => 2021-03-12T21:00:00+00:00
                        )

                )

            [tags] => Array
                (
                    [0] => new sword
                    [1] => invoice #1234
                )
                
            [transactionIds] => Array
                (
                )

            [descriptions] => Array
                (
                    [0] => Array
                        (
                            [value] => Arya
                            [key] => Not today
                        )

                )

            [nominalAmount] => 120000
            [fineAmount] => 0
            [interestAmount] => 0
            [discountAmount] => 0
            [brcode] => 00020101021226860014br.gov.bcb.pix2564invoice-h.sandbox.starkbank.com/7e0b4b71ec924f48865a4a3d979565f65204000053039865802BR5915Stark Bank S.A.6009Sao Paulo62070503***6304365D
            [status] => paid
            [created] => DateTime Object
                (
                    [date] => 2020-10-27 18:37:30.924143
                    [timezone_type] => 1
                    [timezone] => +00:00
                )

            [updated] => DateTime Object
                (
                    [date] => 2020-10-27 18:50:08.046495
                    [timezone_type] => 1
                    [timezone] => +00:00
                )

        )

)
  

Java

Log({
    "created": "2020-11-11T14:44:44.385820+00:00",
    "type": "credited",
    "errors": [],
    "deposit": {
        "name": "Iron Bank S.A",
        "taxId": "10.203.000/0001-80",
        "bankCode": "20018183",
        "branchCode": "0001",
        "accountNumber": "1010101010101010",
        "accountType": "payment",
        "amount": 9000,
        "type": "pix",
        "status": "created",
        "tags": [
        "deposit"
        ],
        "fee": 50,
        "transactionIds": [
        "5862355036536832"
        ],
        "created": "2020-11-11T14:44:43.144663+00:00",
        "updated": "2020-11-11T14:44:53.298960+00:00",
        "id": "5738709764800512"
    },
    "id": "5066704988143616"
})
  

Ruby

log(
    id: 6742710681600000,
    type: created,
    errors: [],
    created: 2020-10-27T14:00:21+00:00,
    invoice: invoice(
        id: 5616810774757376,
        amount: 120000,
        due: 2021-05-12T11:00:20+00:00,
        tax_id: 012.345.678-90,
        name: Arya Stark,
        expiration: 123456789,
        fee: 0,
        pdf: https://invoice-h.sandbox.starkbank.com/pdf/851ff545535c40ba88e24a05accb9978,
        link: https://invoice-h.sandbox.starkbank.com/invoicelink/851ff545535c40ba88e24a05accb9978,
        fine: 2.5,
        interest: 1.3,
        discounts: [
            (
                percentage: 5,
                due: 2021-03-12T14:00:21+00:00
            )
        ],
        tags: ["new sword", "invoice #1234"],
        descriptions: [
            (
                key: Arya,
                value: Not today
            )
        ],
        transaction_ids: [],
        nominal_amount: 120000,
        fine_amount: 0,
        interest_amount: 0,
        discount_amount: 0,
        brcode: 00020101021226860014br.gov.bcb.pix2564invoice-h.sandbox.starkbank.com/7e0b4b71ec924f48865a4a3d979565f65204000053039865802BR5915Stark Bank S.A.6009Sao Paulo62070503***6304365D,
        status: paid,
        updated: 2020-10-27T14:09:20+00:00,
        created: 2020-10-27T14:00:21+00:00
    )
)
  

Elixir

%StarkBank.Invoice.Log{
    created: ~U[2020-10-27 18:45:02.141607Z],
    errors: [],
    id: "6742710681600000",
    invoice: %StarkBank.Invoice{
        amount: 120000,
        brcode: "00020101021226860014br.gov.bcb.pix2564invoice-h.sandbox.starkbank.com/7e0b4b71ec924f48865a4a3d979565f65204000053039865802BR5915Stark Bank S.A.6009Sao Paulo62070503***6304365D",
        created: ~U[2020-11-13 18:36:18.116954Z],
        descriptions: [%{"key" => "Arya", "value" => "Not today"}],
        discount_amount: 0,
        discounts: [
            %{"due" => "2021-03-12T21:36:18.223000+00:00", "percentage" => 10.0}
        ],
        due: "2021-05-12T18:45:02.924000+00:00",
        expiration: 123456789,
        fee: 0,
        pdf: "https://invoice-h.sandbox.starkbank.com/pdf/851ff545535c40ba88e24a05accb9978",
        link: "https://invoice-h.sandbox.starkbank.com/invoicelink/851ff545535c40ba88e24a05accb9978",
        fine: 2.5,
        fine_amount: 0,
        id: "5616810774757376",
        interest: 1.3,
        interest_amount: 0,
        name: "Arya Stark",
        transaction_ids: [],
        nominal_amount: 120000,
        status: "paid",
        tags: ["new sword", "invoice #1234"],
        tax_id: "012.345.678-90",
        updated: ~U[2020-10-27 18:45:02.780963Z]
    },
    type: "credited"
}
  

C#

Log(
    Created: 27/10/2020 13:22:11,
    Type: credited,
    Errors: {  },
    Invoice: Invoice(
        Name: Arya Stark,
        TaxID: 012.345.678-90,
        Due: 12/05/2021 13:17:15,
        Expiration: 123456789,
        Fee: 0,
        Pdf: https://invoice-h.sandbox.starkbank.com/pdf/851ff545535c40ba88e24a05accb9978,
        Link: https://invoice-h.sandbox.starkbank.com/invoicelink/851ff545535c40ba88e24a05accb9978,
        Fine: 2,5,
        Interest: 1,3,
        Descriptions: { { { value, Not today }, { key, Arya } } },
        Discounts: { { { percentage, 10 }, { due, 30/05/2021 23:30:00 } } },
        Tags: { new sword, invoice #1234 },
        TransactionIds: {  },
        Amount: 120000,
        NominalAmount: 120000,
        FineAmount: 0,
        InterestAmount: 0,
        DiscountAmount: 0,
        Brcode: 00020101021226860014br.gov.bcb.pix2564invoice-h.sandbox.starkbank.com/7e0b4b71ec924f48865a4a3d979565f65204000053039865802BR5915Stark Bank S.A.6009Sao Paulo62070503***6304365D,
        Status: paid,
        Created: 27/10/2020 12:56:53,
        Updated: 27/10/2020 13:22:11,
        ID: 5616810774757376
    ),
    ID: 6742710681600000
)
  

Go

{
    Id:6742710681600000 
    Invoice:{
        Id:5616810774757376 
        Amount:120000 
        Name:Arya Stark
        TaxId:012.345.678-90 
        Due:2021-05-12 19:20:36.638 +0000 +0000 
        Expiration:123456789 
        Fine:2.5 
        Interest:1.3 
        Discounts:[
            map[
                due:2021-03-12T07:42:01.528000+00:00 
                percentage:10
            ]
        ] 
        Tags:[new sword invoice #1234] 
        Descriptions:[
            map[
                key:Arya 
                value:Not today
            ]
        ] 
        Pdf:https://invoice-h.sandbox.starkbank.com/pdf/851ff545535c40ba88e24a05accb9978 
        Link:https://invoice-h.sandbox.starkbank.com/invoicelink/851ff545535c40ba88e24a05accb9978
        NominalAmount:120000 
        FineAmount:0 
        InterestAmount:0 
        DiscountAmount:0 
        Brcode:00020101021226860014br.gov.bcb.pix2564invoice-h.sandbox.starkbank.com/7e0b4b71ec924f48865a4a3d979565f65204000053039865802BR5915Stark Bank S.A.6009Sao Paulo62070503***6304365D
        Status:paid 
        Fee:0 
        TransactionIds:[] 
        Created:2020-10-27 19:21:03.033976 +0000 +0000 
        Updated:2020-10-27 23:37:22.858647 +0000 +0000
    } 
    Errors:[] 
    Type:credited 
    Created:2020-10-27 19:20:37.522415 +0000 +0000
}
  

Clojure

{
    :id 6742710681600000,
    :created 2020-10-27T07:00:06.804223+00:00,
    :errors [],
    :type credited,
    :invoice {
        :amount 120000,
        :interest-amount 0,
        :fee 0,
        :tags [war supply invoice #1234],
        :updated 2020-10-27T07:00:07.175487+00:00,
        :name Arya Stark,
        :expiration 123456789,
        :tax-id 012.345.678-90,
        :pdf https://invoice-h.sandbox.starkbank.com/pdf/851ff545535c40ba88e24a05accb9978,
        :link https://invoice-h.sandbox.starkbank.com/invoicelink/851ff545535c40ba88e24a05accb9978,
        :nominal-amount 120000,
        :created 2020-10-27T06:41:14.165375+00:00,
        :discounts [
            {
                :percentage 10.0,
                :due 2021-03-12T06:41:12.584000+00:00
            }
        ],
        :due 2021-05-12T03:41:14.560000+00:00,
        :status paid,
        :interest 1.3,
        :id 5616810774757376,
        :fine 2.5,
        :fine-amount 0,
        :transaction-ids[]
        :discount-amount 0,
        :brcode 00020101021226860014br.gov.bcb.pix2564invoice-h.sandbox.starkbank.com/7e0b4b71ec924f48865a4a3d979565f65204000053039865802BR5915Stark Bank S.A.6009Sao Paulo62070503***6304365D,
        :descriptions [
            {
                :key Arya,
                :value Not today
            }
        ]
    }
}
  

Curl

{
    "log": {
        "id": "6742710681600000",
        "created": "2020-10-27T23:00:08.338233+00:00",
        "errors": [],
        "type": "credited",
        "invoice": {
            "id": "5616810774757376",
            "status": "paid",
            "amount": 120000,
            "nominalAmount": 120000,
            "fineAmount": 0,
            "interestAmount": 0,
            "discountAmount": 0,
            "expiration": 123456789,
            "discounts": [
                {
                    "percentage": 10
                    "due": "2020-11-25T17:59:26.000000+00:00"
                }
            ],
            "descriptions": [
                {
                    "key": "Arya"
                    "value": "Not today"
                }
            ],
            "name": "Arya Stark",
            "taxId": "012.345.678-90",
            "fee": 0,
            "pdf": "https://invoice-h.sandbox.starkbank.com/pdf/851ff545535c40ba88e24a05accb9978",
            "link": "https://invoice-h.sandbox.starkbank.com/invoicelink/851ff545535c40ba88e24a05accb9978",
            "fine": 2.5,
            "interest": 1.3,
            "tags": [
                "War supply",
                "Invoice #1234"
            ],
            "transactionIds": [],
            "brcode": "00020101021226860014br.gov.bcb.pix2564invoice-h.sandbox.starkbank.com/7e0b4b71ec924f48865a4a3d979565f65204000053039865802BR5915Stark Bank S.A.6009Sao Paulo62070503***6304365D",
            "created": "2020-10-27T01:50:50.264656+00:00",
            "updated": "2020-10-27T01:50:50.264656+00:00",
            "due": "2021-05-12T17:59:26.000000+00:00"
        }
    }
}
  

Get a reversed Invoice Log PDF

Whenever an Invoice is successfully reversed, a reversed log will be created. To retrieve a specific reversal receipt, you can request the corresponding log PDF.

Parameters

id REQUIRED

Id of the log invoice entity.

ENDPOINT
GET /v2/invoice/log/:id/pdf
REQUEST

Python

import starkbank

pdf = starkbank.invoice.log.pdf("6742710681600000")

with open("invoice-reversal.pdf", "wb") as file:
    file.write(pdf)
  

Javascript

const starkbank = require('starkbank');
const fs = require('fs').promises;

(async() => {
    let pdf = await starkbank.invoice.log.pdf('6742710681600000')
    await fs.writeFile('invoice-log.pdf', pdf);
})();
  

PHP

use StarkBank\Invoice\Log;

$pdf = Log::pdf("6742710681600000");

$fp = fopen('invoice-log.pdf', 'w');
fwrite($fp, $pdf);
fclose($fp);
  

Java

import java.io.File;
import java.io.InputStream;
import java.nio.file.StandardCopyOption;
import com.starkbank.*;

InputStream pdf = Invoice.Log.pdf("6742710681600000");

java.nio.file.Files.copy(
    pdf,
    new File("invoice-log.pdf").toPath(),
    StandardCopyOption.REPLACE_EXISTING
);
  

Ruby

require('starkbank')

pdf = StarkBank::Invoice::Log.pdf('6742710681600000')
File.binwrite('invoice_log.pdf', pdf)
  

Elixir

pdf = StarkBank.Invoice.Log.pdf!("6742710681600000")

file = File.open!("invoice-log.pdf", [:write])
IO.binwrite(file, pdf)
File.close(file)
  

C#

using System;

byte[] pdf = StarkBank.Invoice.Log.Pdf("6742710681600000");
System.IO.File.WriteAllBytes("invoice-log.pdf", pdf);
  

Go

package main

import (
    "fmt"
    "github.com/starkbank/sdk-go/starkbank/invoice/log"
)

func main() {

    pdf, err := log.Pdf("6742710681600000", nil)
    if err.Errors != nil {
        for _, e := range err.Errors {
            fmt.Printf("code: %s, message: %s", e.Code, e.Message)
        }
    }

    errFile := ioutil.WriteFile("invoiceLog.pdf", pdf, 0666)
    if errFile != nil {
        fmt.Print(errFile)
    }
}
  

Clojure

(clojure.java.io/copy
    (starkbank.invoice.log/pdf "67504567427106816000008353811456")
    (clojure.java.io/file "invoice-log.pdf"))
  

Curl

curl --location --request GET '{{baseUrl}}/v2/invoice/log/6742710681600000/pdf' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}'
  

Get an Invoice Payment information

Once an invoice has been paid, you can get the payment information using the Invoice. Payment sub-resource.

Parameters

id REQUIRED

Id of the invoice entity.

ENDPOINT
GET /v2/invoice/:id/payment
REQUEST

Python

import starkbank

payment = starkbank.invoice.payment("5049137766596608")

print(payment)
  

Javascript

const starkbank = require('starkbank');

(async() => {
    let payment = await starkbank.invoice.payment('5049137766596608');
    console.log(payment);
})();
  

PHP

use StarkBank\Invoice;

$payment = Invoice::payment("5049137766596608");

print_r($payment);
  

Java

import com.starkbank.*;

InputStream pdf = Invoice.Log.pdf("6742710681600000");
java.nio.file.Files.copy(
    pdf,
    new File("invoice.pdf").toPath(),
    StandardCopyOption.REPLACE_EXISTING
);
  

Ruby

require('starkbank')

payment = StarkBank::Invoice.Payment('5049137766596608')

puts payment
  

Elixir

payment = StarkBank.Invoice.payment!("5049137766596608")

|> IO.inspect
  

C#

using System;

StarkBank.Invoice.Payment payment = StarkBank.Invoice.Payment("5049137766596608");

Console.WriteLine(payment);
  

Go

package main

import (
    "fmt"
    "github.com/starkbank/sdk-go/starkbank/invoice"  
)

func main() {

    payment, err := Invoice.GetPayment("5049137766596608", nil)
	if err.Errors != nil {
		for _, e := range err.Errors {
			fmt.Printf("code: %s, message: %s", e.Code, e.Message)
		}
	}
    
    fmt.Printf("%+v", payment)
}
  

Clojure

(def payment (starkbank.invoice/payment "5049137766596608"))

(println payment)
  

Curl

curl --location --request GET '{{baseUrl}}/v2/invoice/5049137766596608/payment' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}'
  
RESPONSE

Python

Payment(
    account_number=3352164669759737,
    account_type=checking,
    amount=566223,
    bank_code=35480428,
    branch_code=7533,
    end_to_end_id=E01709266202302150600xG8OcRCaojI,
    method=pix,
    name=Cesar Eireli,
    tax_id=54.866.319/0001-23
)
  

Javascript

Payment {
    amount: 566223,
    name: 'Cesar Eireli',
    taxId: '54.866.319/0001-23'
    accountNumber: '3352164669759737',
    accountType: 'checking',
    bankCode: '35480428',
    branchCode: '7533',
    endToEndId: 'E01709266202302150600xG8OcRCaojI',
    method: 'pix',
}
  

PHP

StarkBank\Invoice\Payment Object
(
    [name] => Cesar Eireli.
    [taxId] => 54.866.319/0001-23
    [bankCode] => 35480428
    [branchCode] => 7533
    [accountNumber] => 3352164669759737
    [accountType] => checking
    [amount] => 566223
    [endToEndId] => E01709266202302150600xG8OcRCaojI
    [method] => pix
)
  

Java

import com.starkbank.*;

Invoice.Payment payment = Invoice.payment("5049137766596608");

System.out.println(payment);
  

Ruby

payment(
    name: Cesar Eireli.,
    tax_id: 54.866.319/0001-23,
    bank_code: 35480428,
    branch_code: 7533,
    account_number: 3352164669759737,
    account_type: checking,
    amount: 566223,
    end_to_end_id: E01709266202302150600xG8OcRCaojI,
    method: pix
)
  

Elixir

%StarkBank.Invoice.Payment{
    name: "Cesar Eireli.",
    tax_id: "54.866.319/0001-23",
    bank_code: "35480428",
    branch_code: "7533",
    account_number: "3352164669759737",
    account_type: "checking",
    amount: 566223,
    end_to_end_id: "E01709266202302150600xG8OcRCaojI",
    method: "pix"
}
  

C#

InvoicePayment(
    Amount: 566223,
    Name: Cesar Eireli.,
    TaxID: 54.866.319/0001-23,
    BankCode: 35480428,
    BranchCode: 7533,
    AccountNumber: 3352164669759737,
    AccountType: checking,
    EndToEndId: E01709266202302150600xG8OcRCaojI,
    Method: pix
)
  

Go

{
    Amount:566223,
    Name:Cesar Eireli.,
    TaxId:54.866.319/0001-23,
    BankCode:35480428,
    BranchCode:7533,
    AccountNumber:3352164669759737,
    AccountType:checking,
    EndToEndId:E01709266202302150600xG8OcRCaojI,
    Method:pix
}
  

Clojure

{
    :amount: 566223,
    :name: Cesar Eireli.,
    :tax-id: 54.866.319/0001-23,
    :bank-code: 35480428,
    :branch-code: 7533,
    :account-number: 3352164669759737,
    :account-type: checking,
    :end-to-end-id: E01709266202302150600xG8OcRCaojI,
    :method: pix
}
  

Curl

{
    payment: {
        amount: 566223,
        name: "Cesar Eireli",
        taxId: "54.866.319/0001-23"
        accountNumber: "3352164669759737",
        accountType: "checking",
        bankCode: "35480428",
        branchCode: "7533",
        endToEndId: "E01709266202302150600xG8OcRCaojI",
        method: "pix",
    }
}
  

Dynamic Brcode

Note: This is a basic Pix QR Code solution for one time payment. For a complete Pix QR Code receivable, check the Invoice resource.

When a Dynamic Brcode is paid, a Deposit is created with the tags parameter containing the string "dynamic-brcode/" followed by the Dynamic Brcode's uuid "dynamic-brcode/{uuid}" for conciliation.

The Dynamic Brcode object

Attributes

id STRING

Unique id for the dynamic brcode.

amount INTEGER

Amount in cents to be received. Example: 100 (R$1.00).

created STRING

Creation datetime. Example: "2020-04-23T23:00:00.000000+00:00".

displayDescription STRING

Description shown in the payer bank interface.

expiration INTEGER

Time in seconds from creation until expiration.

pictureUrl STRING

URL of the dynamic brcode image.

rules LIST OF OBJECTS

List of rule objects with key and value.

tags LIST OF STRINGS

Tags associated with the dynamic brcode.

updated STRING

Last update datetime. Example: "2020-04-23T23:00:00.000000+00:00".

uuid STRING

Unique UUID for the dynamic brcode.

Create Dynamic Brcodes

Use this route to create up to 100 new dynamic brcodes at a time.

Parameters

amount REQUIRED

A non-negative integer that represents the amount in cents to be received. Example: 100 (R$1.00).

displayDescription OPTIONAL

Description to be shown in the payer bank interface. ex: "Payment for service #1234"

expiration OPTIONAL

Time in seconds counted from the creation datetime until the brcode expires. After expiration, the brcode cannot be paid anymore. Default value: 3600 (1 hour).

rules OPTIONAL

List of rules for modifying dynamic brcode behavior. Example:

[
    {
        "key": "allowedTaxIds",
        "value": [
            "012.345.678-90",
            "45.059.493/0001-73"
        ]
    }
]

tags OPTIONAL

Array of strings to tag the entity for future queries. All tags will be converted to lowercase.

ENDPOINT
POST /v2/dynamic-brcode
REQUEST

Python

import starkbank

brcodes = starkbank.dynamicbrcode.create([
    starkbank.DynamicBrcode(
        amount=4000,
        expiration=123456789,
        tags=["New sword", "DynamicBrcode #1234"],
        display_description="Payment for service #1234",
        rules=[
            {
                "key": "allowedTaxIds",
                "value": [
                    "012.345.678-90",
                    "45.059.493/0001-73"
                ]
            }
        ],
    )
])

for brcode in brcodes:
    print(brcode)
  

Javascript

const starkbank = require('starkbank');

(async() => {
    let brcodes = await starkbank.dynamicBrcode.create([{
        amount: 4000,
        expiration: 123456789,
        tags: ['New sword', 'DynamicBrcode #1234'],
        displayDescription: 'Payment for service #1234',
        rules: [
            new starkbank.dynamicBrcode.Rule({
                key: "allowedTaxIds",
                value: ["012.345.678-90", "45.059.493/0001-73"]
            })
        ]
    }]);

    for (let brcode of brcodes) {
        console.log(brcode);
    }
})();
  

PHP

use StarkBank\DynamicBrcode;

$brcodes = DynamicBrcode::create([
    new DynamicBrcode([
        "amount" => 4000,
        "expiration" => 123456789,
        "tags" => [
            'New sword',
            'DynamicBrcode #1234'
        ],
        "displayDescription" => "Payment for service #1234",
        "rules" => [
            new DynamicBrcode\Rule([
                "key" => "allowedTaxIds",
                "value" => [
                    "012.345.678-90",
                    "45.059.493/0001-73"
                ]
            ])
        ],
    ])
]);

foreach ($brcodes as $brcode) {
    print_r($brcode);
}
  

Java

import com.starkbank.*;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

List<DynamicBrcode> brcodes = new ArrayList<>();

List<DynamicBrcode.Rule> rule = new ArrayList<>();
rule.add(new DynamicBrcode.Rule(
    "allowedTaxIds",
    new String[]{
        "012.345.678-90",
        "45.059.493/0001-73"
    }
));

HashMap<String, Object> data = new HashMap<>();

data.put("amount", 4000);
data.put("expiration", 123456789);
data.put("tags", new String[]{"new sword", "dynamicbrcode #1234"});
data.put("displayDescription", "Payment for service #1234");
data.put("rules", rule);


brcodes.add(new DynamicBrcode(data));
brcodes = DynamicBrcode.create(brcodes);

for (DynamicBrcode brcode : brcodes) {
    System.out.println(brcode);
}
  

Ruby

require('starkbank')

brcodes = StarkBank::DynamicBrcode.create(
    [
        StarkBank::DynamicBrcode.new(
            amount: 4000,
            expiration: 123456789,
            tags: ['new sword', 'dynamicbrcode #1234'],
            displayDescription: 'Payment for service #1234',
            rules: [
                StarkBank::DynamicBrcode::Rule.new(
                    key: 'allowedTaxIds',
                    value: ['012.345.678-90', '45.059.493/0001-73']
                )
            ]
        )
    ]
)

brcodes.each do |brcode|
    puts brcode
end
  

Elixir

brcode = StarkBank.DynamicBrcode.create!(
    [
        %StarkBank.DynamicBrcode{
            amount: 4000,
            expiration: 123456789,
            tags: [
                "New sword",
                "DynamicBrcode #1234"
            ]
        }
    ]
) |> IO.inspect()
  

C#

using System;
using System.Collections.Generic;

List<StarkBank.DynamicBrcode> brcodes = StarkBank.DynamicBrcode.Create(
    new List<StarkBank.DynamicBrcode> {
        new StarkBank.DynamicBrcode(
            amount: 4000,
            expiration: 123456789,
            tags: new List { "New sword", "DynamicBrcode #1234" },
        )
    }
);

foreach (StarkBank.DynamicBrcode brcode in brcodes)
{
    Console.WriteLine(brcode);
}
  

Go

package main

import (
    "fmt"
    "github.com/starkbank/sdk-go/starkbank/dynamicbrcode"
    "github.com/starkbank/sdk-go/starkbank/dynamicbrcode/rule"
    "time"
)

func main() {

    due := time.Now().Add(time.Hour * 24)

    rule := []rule.Rule{
		{
			Key: "allowedTaxIds",
			Value: []string{"012.345.678-90", "45.059.493/0001-73"},
		},
	}

    brcodes, err := dynamicbrcode.Create(
        []dynamicbrcode.DynamicBrcode{
            {
                Amount:     4000,
                Expiration: 123456789,
                Tags:       []string{"New sword", "DynamicBrcode #1234"},
                DisplayDescription: "Payment for service #1234",
			    Rules:      rule,
            },
        }, nil)
    if err.Errors != nil {
        for _, e := range err.Errors {
            fmt.Printf("code: %s, message: %s", e.Code, e.Message)
        }
    }

    for _, brcode := range brcodes {
        fmt.Printf("%+v", brcode)
    }
}
  

Clojure

Not yet available. Please contact us if you need this SDK.
  

Curl

curl --location --request POST '{{baseUrl}}/v2/dynamic-brcode' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}' 
--header 'Content-Type: application/json' 
--data-raw '{
    "brcodes": [
        {
            "amount": 4000,
            "expiration": 1234567890,
            "tags": [
                "New sword",
                "DynamicBrcode #1234"
            ],
            "displayDescription": "Payment for service #1234",
            "rules": [
                {
                    "key": "allowedTaxIds",
                    "value": [
                        "012.345.678-90",
                        "45.059.493/0001-73"
                    ]
                }
            ]
        }
    ]
}'
  
RESPONSE

Python

DynamicBrcode(
    amount=4000,
    created=2023-02-06 21:15:00.118056,
    expiration=123456789,
    id=00020101021226890014br.gov.bcb.pix2567brcode-h.sandbox.starkinfra.com/v2/80b0688d05934971a6b8ecd86cde69f25204000053039865802BR5925Stark Bank S.A. - Institu6009Sao Paulo62070503***630461C9,
    picture_url=https://sandbox.api.starkbank.com/v2/dynamic-brcode/80b0688d05934971a6b8ecd86cde69f2.png,
    tags=['new sword', 'dynamicbrcode #1234'],
    displayDescription=Payment for service #1234,
    rules=[
        Rule(
            key=allowedTaxIds,
            value=[
                '012.345.678-90',
                '45.059.493/0001-73'
            ]
        )
    ],
    updated=2023-02-06 21:15:00.449696,
    uuid=80b0688d05934971a6b8ecd86cde69f2
)
  

Javascript

DynamicBrcode {
    id: '00020101021226890014br.gov.bcb.pix2567brcode-h.sandbox.starkinfra.com/v2/e285405b196e42bb8e68f654283dcaa05204000053039865802BR5925Stark Bank S.A. - Institu6009Sao Paulo62070503***6304CB47',
    amount: 4000,
    expiration: 123456789,
    tags: [ 'new sword', 'dynamicbrcode #1234' ],
    displayDescription: 'Payment for service #1234',
    rules: [
        {
            key: 'allowedTaxIds',
            value: [ '012.345.678-90', '45.059.493/0001-73' ]
        }
    ],
    uuid: '80b0688d05934971a6b8ecd86cde69f2',
    pictureUrl: 'https://sandbox.api.starkbank.com/v2/dynamic-brcode/80b0688d05934971a6b8ecd86cde69f2.png',
    updated: '2023-02-06T21:17:30.977004+00:00',
    created: '2023-02-06T21:17:30.625913+00:00'
}
  

PHP

StarkBank\DynamicBrcode Object
(
    [id] => 00020101021226890014br.gov.bcb.pix2567brcode-h.sandbox.starkinfra.com/v2/e285405b196e42bb8e68f654283dcaa05204000053039865802BR5925Stark Bank S.A. - Institu6009Sao Paulo62070503***6304CB47
    [amount] => 4000
    [expiration] => DateInterval Object
        (
            [y] => 0
            [m] => 0
            [d] => 0
            [h] => 0
            [i] => 0
            [s] => 123456789
            [f] => 0
            [invert] => 0
            [days] =>
            [from_string] =>
        )

    [tags] => Array
        (
            [0] => new sword
            [1] => dynamicbrcode #1234
        )
    [displayDescription] => Payment for service #1234
    [rules] => Array
        (
            [0] => Array
                (
                    [key] => allowedTaxIds
                    [value] => Array
                        (
                            [0] => 012.345.678-90
                            [1] => 45.059.493/0001-73
                        )
                )
        )
    [uuid] => 80b0688d05934971a6b8ecd86cde69f2
    [pictureUrl] => https://sandbox.api.starkbank.com/v2/dynamic-brcode/80b0688d05934971a6b8ecd86cde69f2.png
    [updated] => DateTime Object
        (
            [date] => 2023-02-06 21:23:50.776494
            [timezone_type] => 1
            [timezone] => +00:00
        )

    [created] => DateTime Object
        (
            [date] => 2023-02-06 21:23:50.435531
            [timezone_type] => 1
            [timezone] => +00:00
        )

)
  

Java

DynamicBrcode({
    "amount": 4000,
    "expiration": 123456789,
    "tags": ["new sword", "dynamicbrcode #1234"],
    "displayDescription": "Payment for service #1234",
    "rules": [
        {
            key: 'allowedTaxIds',
            value: ["012.345.678-90", "45.059.493/0001-73"]
        }
    ],
    "uuid": "80b0688d05934971a6b8ecd86cde69f2",
    "pictureUrl": "https://sandbox.api.starkbank.com/v2/dynamic-brcode/80b0688d05934971a6b8ecd86cde69f2.png",
    "updated": "2023-02-06T21:30:36.688229+00:00",
    "created": "2023-02-06T21:30:36.372956+00:00",
    "id": "00020101021226890014br.gov.bcb.pix2567brcode-h.sandbox.starkinfra.com/v2/8411cece3387471ea7f2636b618c37fb5204000053039865802BR5925Stark Bank S.A. - Institu6009Sao Paulo62070503***6304556B"
})
  

Ruby

dynamicbrcode(
    id: 00020101021226890014br.gov.bcb.pix2567brcode-h.sandbox.starkinfra.com/v2/0e96a462d44a4d789f6d4fcbf7aa63b45204000053039865802BR5925Stark Bank S.A. - Institu6009Sao Paulo62070503***63048CC9,
    amount: 4000,
    expiration: 123456789,
    tags: ['new sword', 'dynamicbrcode #1234'],
    displayDescription: 'Payment for service #1234',
    rules: [
        (
            key: allowedTaxIds,
            value: ['012.345.678-90', '45.059.493/0001-73']
        )
    ],
    uuid: 80b0688d05934971a6b8ecd86cde69f2,
    picture_url: https://sandbox.api.starkbank.com/v2/dynamic-brcode/80b0688d05934971a6b8ecd86cde69f2.png,
    created: 2023-02-06T21:39:47+00:00,
    updated: 2023-02-06T21:39:47+00:00
)
  

Elixir

%StarkBank.DynamicBrcode{
    id: "00020101021226890014br.gov.bcb.pix2567brcode-h.sandbox.starkinfra.com/v2/0e96a462d44a4d789f6d4fcbf7aa63b45204000053039865802BR5925Stark Bank S.A. - Institu6009Sao Paulo62070503***63048CC9",
    uuid: "80b0688d05934971a6b8ecd86cde69f2",
    amount: 4000,
    expiration: 123456789,
    picture_url: "https://sandbox.api.starkbank.com/v2/dynamic-brcode/80b0688d05934971a6b8ecd86cde69f2.png",
    created: ~U[2023-02-06 18:36:18.116976Z],
    updated: ~U[2023-02-06 18:36:18.116976Z]
}
  

C#

DynamicBrcode(
    ID: 00020101021226890014br.gov.bcb.pix2567brcode-h.sandbox.starkinfra.com/v2/0e96a462d44a4d789f6d4fcbf7aa63b45204000053039865802BR5925Stark Bank S.A. - Institu6009Sao Paulo62070503***63048CC9
    Expiration: 123456789,
    Tags: { "new sword", "dynamicbrcode #1234" },
    Amount: 4000,
    Uuid: 80b0688d05934971a6b8ecd86cde69f2,
    PictureUrl: https://sandbox.api.starkbank.com/v2/dynamic-brcode/80b0688d05934971a6b8ecd86cde69f2.png,
    Created: 06/02/2023 18:45:08,
    Updated: 06/02/2023 18:45:08
)
  

Go

{
    Id:00020101021226890014br.gov.bcb.pix2567brcode-h.sandbox.starkinfra.com/v2/0e96a462d44a4d789f6d4fcbf7aa63b45204000053039865802BR5925Stark Bank S.A. - Institu6009Sao Paulo62070503***63048CC9
    Uuid:80b0688d05934971a6b8ecd86cde69f2
    Amount:4000
    Expiration:123456789
    Tags:[new sword dynamicbrcode #1234]
    DisplayDescription:Payment for service #1234
    Rule:[map[key:AllowedTaxIds value:[012.345.678-90 45.059.493/0001-73]]]
    PictureUrl:https://sandbox.api.starkbank.com/v2/dynamic-brcode/80b0688d05934971a6b8ecd86cde69f2.png
    Created:2023-02-06 19:54:54.16799 +0000 +0000
    Updated:2023-02-06 19:54:54.24204 +0000 +0000
}
  

Clojure

Not yet available. Please contact us if you need this SDK.
  

Curl

{
    "brcodes": [
        {
            "amount": 4000,
            "created": "2023-02-06T21:49:19.660252+00:00",
            "expiration": 123456789,
            "id": "00020101021226890014br.gov.bcb.pix2567brcode-h.sandbox.starkinfra.com/v2/0e96a462d44a4d789f6d4fcbf7aa63b45204000053039865802BR5925Stark Bank S.A. - Institu6009Sao Paulo62070503***63048CC9",
            "pictureUrl": "https://sandbox.api.starkbank.com/v2/dynamic-brcode/80b0688d05934971a6b8ecd86cde69f2.png",
            "tags": [
                "new sword",
                "dynamicbrcode #1234"
            ],
            "displayDescription": "Payment for service #1234",
            "rules": [
                {
                    "key": "allowedTaxIds",
                    "value": [
                        "012.345.678-90",
                        "45.059.493/0001-73"
                    ]
                }
            ],
            "updated": "2023-02-06T21:49:19.987058+00:00",
            "uuid": "80b0688d05934971a6b8ecd86cde69f2"
        }
    ],
    "message": "Brcode(s) successfully created"
}
  

List Dynamic Brcodes

Get a list of brcodes in chunks of at most 100. If you need smaller chunks, use the limit parameter.

Parameters

after OPTIONAL

Filter entities created after this date.

before OPTIONAL

Filter entities created before this date.

cursor OPTIONAL

String used to get the next batch of results. Our SDKs handle this for you.

limit OPTIONAL

Number of results per cursor. Max = 100.

tags OPTIONAL

Filter entities that contain the specified tags.

uuids OPTIONAL

list of uuids to filter retrieved objects.

ENDPOINT
GET /v2/dynamic-brcode
REQUEST

Python

import starkbank

brcodes = starkbank.dynamicbrcode.query(
    after="2023-02-01",
    before="2023-02-28",
)

for brcode in brcodes:
    print(brcode)
  

Javascript

const starkbank = require('starkbank');

(async() => {
    let brcodes = await starkbank.dynamicBrcode.query({
        after: '2023-02-01',
        before: '2023-02-28',
    });

    for await (let brcode of brcodes) {
        console.log(brcode);
    }
})();
  

PHP

use StarkBank\DynamicBrcode;

$brcodes = iterator_to_array(
    DynamicBrcode::query([
        "after" => "2023-02-01",
        "before" => "2023-02-28",
    ])
);

foreach ($brcodes as $brcode) {
    print_r($brcode);
}
  

Java

import com.starkbank.*;
import com.starkbank.utils.Generator;
import java.util.HashMap;

HashMap<String, Object> params = new HashMap<>();
params.put("after", "2023-02-01");
params.put("before", "2023-02-28");
Generator<DynamicBrcode> brcodes = DynamicBrcode.query(params);

for (DynamicBrcode brcode : brcodes){
    System.out.println(brcode);
}
  

Ruby

require('starkbank')

brcodes = StarkBank::DynamicBrcode.query(
    after: '2023-02-01',
    before: '2023-02-28'
)

brcodes.each do |brcode|
    puts brcode
end
  

Elixir

brcodes = StarkBank.DynamicBrcode.query!(
    after: "2023-02-01",
    before: "2023-02-28"
) |> Enum.take(1) |> IO.inspect
  

C#

IEnumerable<StarkBank.DynamicBrcode> brcodes = StarkBank.DynamicBrcode.Query(
    after: new DateTime(2023, 2, 1),
    before: new DateTime(2023, 2, 28)
);

foreach (StarkBank.DynamicBrcode brcode in brcodes)
{
    Console.WriteLine(brcode);
}
  

Go

package main

import (
    "fmt"
    "time"
    "github.com/starkbank/sdk-go/starkbank/brcode"
)

func main() {

    var params = map[string]interface{}{}
    params["after"] = time.Date(2023, 2, 1, 0, 0, 0, 0, time.UTC)
    params["before"] = time.Date(2023, 2, 28, 0, 0, 0, 0, time.UTC)

    brcodes, errorChannel := brcode.Query(params, nil)

    loop:
    for {
        select {
        case err := <-errorChannel:
            if err.Errors != nil {
                for _, e := range err.Errors {
                    fmt.Printf("code: %s, message: %s", e.Code, e.Message)
                }
            }
        case brcode, ok := <-brcodes:
            if !ok {
                break loop
            }
            fmt.Printf("%+v", brcode)
        }
    }
}
  

Clojure

Not yet available. Please contact us if you need this SDK.
  

Curl

curl --location --request GET '{{baseUrl}}/v2/dynamic-brcode?after=2023-02-01&before=2023-02-28' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}'
  
RESPONSE

Python

DynamicBrcode(
    amount=4000,
    created=2023-02-06 21:15:00.118056,
    expiration=123456789,
    id=00020101021226890014br.gov.bcb.pix2567brcode-h.sandbox.starkinfra.com/v2/80b0688d05934971a6b8ecd86cde69f25204000053039865802BR5925Stark Bank S.A. - Institu6009Sao Paulo62070503***630461C9,
    picture_url=https://sandbox.api.starkbank.com/v2/dynamic-brcode/80b0688d05934971a6b8ecd86cde69f2.png,
    tags=['new sword', 'dynamicbrcode #1234'],
    displayDescription=Payment for service #1234,
    rules=[
        Rule(
            key=allowedTaxIds,
            value=[
                '012.345.678-90',
                '45.059.493/0001-73'
            ]
        )
    ],
    updated=2023-02-06 21:15:00.449696,
    uuid=80b0688d05934971a6b8ecd86cde69f2
)
  

Javascript

DynamicBrcode {
    id: '00020101021226890014br.gov.bcb.pix2567brcode-h.sandbox.starkinfra.com/v2/e285405b196e42bb8e68f654283dcaa05204000053039865802BR5925Stark Bank S.A. - Institu6009Sao Paulo62070503***6304CB47',
    amount: 4000,
    expiration: 123456789,
    tags: [ 'new sword', 'dynamicbrcode #1234' ],
    displayDescription: 'Payment for service #1234',
    rules: [
        {
            key: 'allowedTaxIds',
            value: ['012.345.678-90', '45.059.493/0001-73']
        }
    ],
    uuid: '80b0688d05934971a6b8ecd86cde69f2',
    pictureUrl: 'https://sandbox.api.starkbank.com/v2/dynamic-brcode/80b0688d05934971a6b8ecd86cde69f2.png',
    updated: '2023-02-06T21:17:30.977004+00:00',
    created: '2023-02-06T21:17:30.625913+00:00'
}
  

PHP

StarkBank\DynamicBrcode Object
(
    [id] => 00020101021226890014br.gov.bcb.pix2567brcode-h.sandbox.starkinfra.com/v2/e285405b196e42bb8e68f654283dcaa05204000053039865802BR5925Stark Bank S.A. - Institu6009Sao Paulo62070503***6304CB47
    [amount] => 4000
    [expiration] => DateInterval Object
        (
            [y] => 0
            [m] => 0
            [d] => 0
            [h] => 0
            [i] => 0
            [s] => 123456789
            [f] => 0
            [invert] => 0
            [days] =>
            [from_string] =>
        )

    [tags] => Array
        (
            [0] => new sword
            [1] => dynamicbrcode #1234
        )
    [displayDescription] => Payment for service #1234
    [rules] => Array
        (
            [0] => Array
                (
                    [key] => allowedTaxIds
                    [value] => Array
                        (
                            [0] => 012.345.678-90
                            [1] => 45.059.493/0001-73
                        )
                )
        )
    [uuid] => 80b0688d05934971a6b8ecd86cde69f2
    [pictureUrl] => https://sandbox.api.starkbank.com/v2/dynamic-brcode/80b0688d05934971a6b8ecd86cde69f2.png
    [updated] => DateTime Object
        (
            [date] => 2023-02-06 21:23:50.776494
            [timezone_type] => 1
            [timezone] => +00:00
        )

    [created] => DateTime Object
        (
            [date] => 2023-02-06 21:23:50.435531
            [timezone_type] => 1
            [timezone] => +00:00
        )

)
  

Java

DynamicBrcode({
    "amount": 4000,
    "expiration": 123456789,
    "tags": ["new sword", "dynamicbrcode #1234"],
    "displayDescription": "Payment for service #1234",
    "rules": [
        {
            key: 'allowedTaxIds',
            value: ["012.345.678-90", "45.059.493/0001-73"]
        }
    ],
    "uuid": "80b0688d05934971a6b8ecd86cde69f2",
    "pictureUrl": "https://sandbox.api.starkbank.com/v2/dynamic-brcode/80b0688d05934971a6b8ecd86cde69f2.png",
    "updated": "2023-02-06T21:30:36.688229+00:00",
    "created": "2023-02-06T21:30:36.372956+00:00",
    "id": "00020101021226890014br.gov.bcb.pix2567brcode-h.sandbox.starkinfra.com/v2/8411cece3387471ea7f2636b618c37fb5204000053039865802BR5925Stark Bank S.A. - Institu6009Sao Paulo62070503***6304556B"
})
  

Ruby

dynamicbrcode(
    id: 00020101021226890014br.gov.bcb.pix2567brcode-h.sandbox.starkinfra.com/v2/0e96a462d44a4d789f6d4fcbf7aa63b45204000053039865802BR5925Stark Bank S.A. - Institu6009Sao Paulo62070503***63048CC9,
    amount: 4000,
    expiration: 123456789,
    tags: ["new sword", "dynamicbrcode #1234"],
    displayDescription: "Payment for service #1234",
    rules: [
        (
            key: allowedTaxIds,
            value: ["012.345.678-90", "45.059.493/0001-73"]
        )
    ],
    uuid: 80b0688d05934971a6b8ecd86cde69f2,
    picture_url: https://sandbox.api.starkbank.com/v2/dynamic-brcode/80b0688d05934971a6b8ecd86cde69f2.png,
    created: 2023-02-06T21:39:47+00:00,
    updated: 2023-02-06T21:39:47+00:00
)
  

Elixir

%StarkBank.DynamicBrcode{
    id: "00020101021226890014br.gov.bcb.pix2567brcode-h.sandbox.starkinfra.com/v2/0e96a462d44a4d789f6d4fcbf7aa63b45204000053039865802BR5925Stark Bank S.A. - Institu6009Sao Paulo62070503***63048CC9",
    uuid: "80b0688d05934971a6b8ecd86cde69f2",
    amount: 4000,
    expiration: 123456789,
    picture_url: "https://sandbox.api.starkbank.com/v2/dynamic-brcode/80b0688d05934971a6b8ecd86cde69f2.png",
    created: ~U[2023-02-06 18:36:18.116976Z]
    updated: ~U[2023-02-06 18:36:18.116976Z]
}
  

C#

DynamicBrcode(
    ID: 00020101021226890014br.gov.bcb.pix2567brcode-h.sandbox.starkinfra.com/v2/0e96a462d44a4d789f6d4fcbf7aa63b45204000053039865802BR5925Stark Bank S.A. - Institu6009Sao Paulo62070503***63048CC9
    Expiration: 123456789,
    Tags: { "new sword", "dynamicbrcode #1234" },
    Amount: 4000,
    Uuid: 80b0688d05934971a6b8ecd86cde69f2,
    PictureUrl: https://sandbox.api.starkbank.com/v2/dynamic-brcode/80b0688d05934971a6b8ecd86cde69f2.png,
    Created: 06/02/2023 18:45:08,
    Updated: 06/02/2023 18:45:08,
)
  

Go

{
    Id:00020101021226890014br.gov.bcb.pix2567brcode-h.sandbox.starkinfra.com/v2/0e96a462d44a4d789f6d4fcbf7aa63b45204000053039865802BR5925Stark Bank S.A. - Institu6009Sao Paulo62070503***63048CC9
    Uuid:80b0688d05934971a6b8ecd86cde69f2
    Amount:4000
    Expiration:123456789
    Tags:[new sword dynamicbrcode #1234]
    DisplayDescription:Payment for service #1234
    Rule:[map[key:AllowedTaxIds value:[012.345.678-90 45.059.493/0001-73]]]
    PictureUrl:https://sandbox.api.starkbank.com/v2/dynamic-brcode/80b0688d05934971a6b8ecd86cde69f2.png
    Created:2023-02-06 19:54:54.16799 +0000 +0000
    Updated:2023-02-06 19:54:54.24204 +0000 +0000
}
  

Clojure

Not yet available. Please contact us if you need this SDK.
  

Curl

{
    "brcodes": [
        {
            "amount": 4000,
            "created": "2023-02-06T21:49:19.660252+00:00",
            "expiration": 123456789,
            "id": "00020101021226890014br.gov.bcb.pix2567brcode-h.sandbox.starkinfra.com/v2/0e96a462d44a4d789f6d4fcbf7aa63b45204000053039865802BR5925Stark Bank S.A. - Institu6009Sao Paulo62070503***63048CC9",
            "pictureUrl": "https://sandbox.api.starkbank.com/v2/dynamic-brcode/80b0688d05934971a6b8ecd86cde69f2.png",
            "tags": [
                "new sword",
                "dynamicbrcode #1234"
            ],
            "displayDescription": "Payment for service #1234",
            "rules": [
                {
                    "key": "allowedTaxIds",
                    "value": [
                        "012.345.678-90",
                        "45.059.493/0001-73"
                    ]
                }
            ],
            "updated": "2023-02-06T21:49:19.987058+00:00",
            "uuid": "80b0688d05934971a6b8ecd86cde69f2"
        }
    ],
    "cursor": "CkwKFAoHY3JlYXRlZBIJCNyR8Ibwgf0CEjBqFGl-YXBpLW1zLWRlcG9zaXQtc2J4chgLEgtEZXBvc2l0UnVsZRiAgIDYr9DSCAwYACAB"
}
  

Get a Dynamic Brcode

Get a single dynamic brcode by its uuid.

Parameters

uuid REQUIRED

Uuid of the brcode entity.

fields OPTIONAL

List of strings to filter response JSON keys. Not available in the SDKs.

ENDPOINT
GET /v2/dynamic-brcode/:uuid
REQUEST

Python

import starkbank

brcode = starkbank.dynamicbrcode.get("80b0688d05934971a6b8ecd86cde69f2")

print(brcode)
  

Javascript

const starkbank = require('starkbank');

(async() => {
    let brcode = await starkbank.dynamicBrcode.get('80b0688d05934971a6b8ecd86cde69f2');
    console.log(brcode);
})();
  

PHP

use StarkBank\DynamicBrcode;

$brcode = DynamicBrcode::get("80b0688d05934971a6b8ecd86cde69f2");

print_r($brcode);
  

Java

import com.starkbank.*;

DynamicBrcode brcode = DynamicBrcode.get("80b0688d05934971a6b8ecd86cde69f2");

System.out.println(brcode);
  

Ruby

require('starkbank')

brcode = StarkBank::DynamicBrcode.get('80b0688d05934971a6b8ecd86cde69f2')

puts brcode
  

Elixir

brcode = StarkBank.DynamicBrcode.get!("80b0688d05934971a6b8ecd86cde69f2")
|> IO.inspect
  

C#

using System;

StarkBank.DynamicBrcode brcode = StarkBank.DynamicBrcode.Get("80b0688d05934971a6b8ecd86cde69f2");

Console.WriteLine(brcode);
  

Go

package main

import (
    "fmt"
    "github.com/starkbank/sdk-go/starkbank/brcode"
)

func main() {

    brcode, err := brcode.Get("80b0688d05934971a6b8ecd86cde69f2", nil)
    if err.Errors != nil {
        for _, e := range err.Errors {
            fmt.Printf("code: %s, message: %s", e.Code, e.Message)
        }
    }

    fmt.Printf("%+v", brcode)
}
  

Clojure

Not yet available. Please contact us if you need this SDK.
  

Curl

curl --location --request GET '{{baseUrl}}/v2/dynamic-brcode/80b0688d05934971a6b8ecd86cde69f2' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}'
  
RESPONSE

Python

DynamicBrcode(
    amount=4000,
    created=2023-02-06 21:15:00.118056,
    expiration=123456789,
    id=00020101021226890014br.gov.bcb.pix2567brcode-h.sandbox.starkinfra.com/v2/80b0688d05934971a6b8ecd86cde69f25204000053039865802BR5925Stark Bank S.A. - Institu6009Sao Paulo62070503***630461C9,
    picture_url=https://sandbox.api.starkbank.com/v2/dynamic-brcode/80b0688d05934971a6b8ecd86cde69f2.png,
    tags=['new sword', 'dynamicbrcode #1234'],
    displayDescription=Payment for service #1234,
    rules=[
        Rule(
            key=allowedTaxIds,
            value=[
                '012.345.678-90',
                '45.059.493/0001-73'
            ]
        )
    ],
    updated=2023-02-06 21:15:00.449696,
    uuid=80b0688d05934971a6b8ecd86cde69f2
)
  

Javascript

DynamicBrcode {
    id: '00020101021226890014br.gov.bcb.pix2567brcode-h.sandbox.starkinfra.com/v2/e285405b196e42bb8e68f654283dcaa05204000053039865802BR5925Stark Bank S.A. - Institu6009Sao Paulo62070503***6304CB47',
    amount: 4000,
    expiration: 123456789,
    tags: [ 'new sword', 'dynamicbrcode #1234' ],
    displayDescription: 'Payment for service #1234',
    rules: [
        {
            key: 'allowedTaxIds',
            value: ['012.345.678-90', '45.059.493/0001-73']
        }
    ],
    uuid: '80b0688d05934971a6b8ecd86cde69f2',
    pictureUrl: 'https://sandbox.api.starkbank.com/v2/dynamic-brcode/80b0688d05934971a6b8ecd86cde69f2.png',
    updated: '2023-02-06T21:17:30.977004+00:00',
    created: '2023-02-06T21:17:30.625913+00:00'
}
  

PHP

StarkBank\DynamicBrcode Object
(
    [id] => 00020101021226890014br.gov.bcb.pix2567brcode-h.sandbox.starkinfra.com/v2/e285405b196e42bb8e68f654283dcaa05204000053039865802BR5925Stark Bank S.A. - Institu6009Sao Paulo62070503***6304CB47
    [amount] => 4000
    [expiration] => DateInterval Object
        (
            [y] => 0
            [m] => 0
            [d] => 0
            [h] => 0
            [i] => 0
            [s] => 123456789
            [f] => 0
            [invert] => 0
            [days] =>
            [from_string] =>
        )

    [tags] => Array
        (
            [0] => new sword
            [1] => dynamicbrcode #1234
        )
    [displayDescription] => Payment for service #1234
    [rules] => Array
        (
            [0] => Array
                (
                    [key] => allowedTaxIds
                    [value] => Array
                        (
                            [0] => 012.345.678-90
                            [1] => 45.059.493/0001-73
                        )
                )
        )
    [uuid] => 80b0688d05934971a6b8ecd86cde69f2
    [pictureUrl] => https://sandbox.api.starkbank.com/v2/dynamic-brcode/80b0688d05934971a6b8ecd86cde69f2.png
    [updated] => DateTime Object
        (
            [date] => 2023-02-06 21:23:50.776494
            [timezone_type] => 1
            [timezone] => +00:00
        )

    [created] => DateTime Object
        (
            [date] => 2023-02-06 21:23:50.435531
            [timezone_type] => 1
            [timezone] => +00:00
        )

)
  

Java

DynamicBrcode({
    "amount": 4000,
    "expiration": 123456789,
    "tags": ["new sword", "dynamicbrcode #1234"],
    "displayDescription": "Payment for service #1234",
    "rules": [
        {
            key: 'allowedTaxIds',
            value: ["012.345.678-90", "45.059.493/0001-73"]
        }
    ],
    "uuid": "80b0688d05934971a6b8ecd86cde69f2",
    "pictureUrl": "https://sandbox.api.starkbank.com/v2/dynamic-brcode/80b0688d05934971a6b8ecd86cde69f2.png",
    "updated": "2023-02-06T21:30:36.688229+00:00",
    "created": "2023-02-06T21:30:36.372956+00:00",
    "id": "00020101021226890014br.gov.bcb.pix2567brcode-h.sandbox.starkinfra.com/v2/8411cece3387471ea7f2636b618c37fb5204000053039865802BR5925Stark Bank S.A. - Institu6009Sao Paulo62070503***6304556B"
})
  

Ruby

dynamicbrcode(
    id: 00020101021226890014br.gov.bcb.pix2567brcode-h.sandbox.starkinfra.com/v2/0e96a462d44a4d789f6d4fcbf7aa63b45204000053039865802BR5925Stark Bank S.A. - Institu6009Sao Paulo62070503***63048CC9,
    amount: 4000,
    expiration: 123456789,
    tags: ["new sword", "dynamicbrcode #1234"],
    displayDescription: "Payment for service #1234",
    rules: [
        (
            key: allowedTaxIds,
            value: ["012.345.678-90", "45.059.493/0001-73"]
        )
    ],
    uuid: 80b0688d05934971a6b8ecd86cde69f2,
    picture_url: https://sandbox.api.starkbank.com/v2/dynamic-brcode/80b0688d05934971a6b8ecd86cde69f2.png,
    created: 2023-02-06T21:39:47+00:00,
    updated: 2023-02-06T21:39:47+00:00
)
  

Elixir

%StarkBank.DynamicBrcode{
    id: "00020101021226890014br.gov.bcb.pix2567brcode-h.sandbox.starkinfra.com/v2/0e96a462d44a4d789f6d4fcbf7aa63b45204000053039865802BR5925Stark Bank S.A. - Institu6009Sao Paulo62070503***63048CC9",
    uuid: "80b0688d05934971a6b8ecd86cde69f2",
    amount: 4000,
    expiration: 123456789,
    picture_url: "https://sandbox.api.starkbank.com/v2/dynamic-brcode/80b0688d05934971a6b8ecd86cde69f2.png",
    created: ~U[2023-02-06 18:36:18.116976Z]
    updated: ~U[2023-02-06 18:36:18.116976Z]
}
  

C#

DynamicBrcode(
    ID: 00020101021226890014br.gov.bcb.pix2567brcode-h.sandbox.starkinfra.com/v2/0e96a462d44a4d789f6d4fcbf7aa63b45204000053039865802BR5925Stark Bank S.A. - Institu6009Sao Paulo62070503***63048CC9
    Expiration: 123456789,
    Tags: { "new sword", "dynamicbrcode #1234" },
    Amount: 4000,
    Uuid: 80b0688d05934971a6b8ecd86cde69f2,
    PictureUrl: https://sandbox.api.starkbank.com/v2/dynamic-brcode/80b0688d05934971a6b8ecd86cde69f2.png,
    Created: 06/02/2023 18:45:08,
    Updated: 06/02/2023 18:45:08,
)
  

Go

{
    Id:00020101021226890014br.gov.bcb.pix2567brcode-h.sandbox.starkinfra.com/v2/0e96a462d44a4d789f6d4fcbf7aa63b45204000053039865802BR5925Stark Bank S.A. - Institu6009Sao Paulo62070503***63048CC9
    Uuid:80b0688d05934971a6b8ecd86cde69f2
    Amount:4000
    Expiration:123456789
    Tags:[new sword dynamicbrcode #1234]
    DisplayDescription:Payment for service #1234
    Rule:[map[key:AllowedTaxIds value:[012.345.678-90 45.059.493/0001-73]]]
    PictureUrl:https://sandbox.api.starkbank.com/v2/dynamic-brcode/80b0688d05934971a6b8ecd86cde69f2.png
    Created:2023-02-06 19:54:54.16799 +0000 +0000
    Updated:2023-02-06 19:54:54.24204 +0000 +0000
}
  

Clojure

Not yet available. Please contact us if you need this SDK.
  

Curl

{
    "brcode": {
        "amount": 4000,
        "created": "2023-02-06T21:49:19.660252+00:00",
        "expiration": 123456789,
        "id": "00020101021226890014br.gov.bcb.pix2567brcode-h.sandbox.starkinfra.com/v2/0e96a462d44a4d789f6d4fcbf7aa63b45204000053039865802BR5925Stark Bank S.A. - Institu6009Sao Paulo62070503***63048CC9",
        "pictureUrl": "https://sandbox.api.starkbank.com/v2/dynamic-brcode/80b0688d05934971a6b8ecd86cde69f2.png",
        "tags": [
            "new sword",
            "dynamicbrcode #1234"
        ],
        "displayDescription": "Payment for service #1234",
        "rules": [
            {
                "key": "allowedTaxIds",
                "value": [
                    "012.345.678-90",
                    "45.059.493/0001-73"
                ]
            }
        ],
        "updated": "2023-02-06T21:49:19.987058+00:00",
        "uuid": "80b0688d05934971a6b8ecd86cde69f2"
    }
}
  

Deposit

Deposits represent passive cash-ins received by your account from external transfers or payments. In this section, we will teach you how to manage your Deposits.

Deposit Status

Each deposit has a status that can change over time according to its life cycle:

deposit-status

The Deposit object

Attributes

id STRING

Unique id for the deposit.

accountNumber STRING

Payer bank account number.

accountType STRING

Payer bank account type.

amount INTEGER

Deposit amount in cents.

bankCode STRING

Payer bank code or ISPB.

branchCode STRING

Payer bank branch.

created STRING

Creation datetime. Example: "2020-04-23T23:00:00.000000+00:00".

fee INTEGER

Fee charged in cents.

name STRING

Payer full name.

status STRING

Current deposit status. Options: "created", "void".

tags LIST OF STRINGS

Tags associated with the deposit.

taxId STRING

Payer CPF or CNPJ.

transactionIds LIST OF STRINGS

Ledger transaction IDs linked to the deposit.

type STRING

Type of the deposit.

updated STRING

Last update datetime. Example: "2020-04-23T23:00:00.000000+00:00".

List Deposits

Here you can list and filter all deposits you have received. We return it paged.

Parameters

after OPTIONAL

Filter entities created after this date.

before OPTIONAL

Filter entities created before this date.

cursor OPTIONAL

String used to get the next batch of results. Our SDKs handle this for you.

fields OPTIONAL

List of strings to filter response JSON keys. Not available in the SDKs.

ids OPTIONAL

List of strings to get specific entities by ids.

limit OPTIONAL

Number of results per cursor. Max = 100.

sort OPTIONAL

Sort order considered in the response. Options are: "created", "-created".

status OPTIONAL

Filter deposits by the specified status.

tags OPTIONAL

Filter entities that contain the specified tags.

ENDPOINT
GET /v2/deposit
REQUEST

Python

import starkbank

deposits = starkbank.deposit.query(
    after="2020-11-01",
    before="2020-11-30"
)

for deposit in deposits:
    print(deposit)
  

Javascript

const starkbank = require('starkbank');

(async() => {
    let deposits = await starkbank.deposit.query({
        after: '2020-11-01',
        before: '2020-11-30'
    });

    for await (let deposit of deposits) {
        console.log(deposit);
    }
})();
  

PHP

use StarkBank\Deposit;

$deposits = iterator_to_array(
    Deposit::query([
        "after" => "2020-11-01T18:00:00.000000+00:00",
        "before" => "2020-11-30T18:00:00.000000+00:00"
    ])
);

foreach ($deposits as $deposit) {
    print_r($deposit);
}
  

Java

import com.starkbank.*;
import com.starkbank.utils.Generator;
import java.util.HashMap;

HashMap<String, Object> params = new HashMap<>();
params.put("after", "2020-11-01");
params.put("before", "2020-11-30");
Generator<Deposit> deposits = Deposit.query(params);

for (Deposit deposit : deposits){
    System.out.println(deposit);
}
  

Ruby

require('starkbank')
require('date')

deposits = StarkBank::Deposit.query(
    after: '2020-11-01',
    before: '2020-11-30'
)

deposits.each do |deposit|
    puts deposit
end
  

Elixir

deposits = StarkBank.Deposit.query!(
    after: "2020-11-01",
    before: "2020-11-30"
)

for deposit <- deposits do
    deposit |> IO.inspect
end
  

C#

using System;
using System.Collections.Generic;

IEnumerable<StarkBank.Deposit> deposits = StarkBank.Deposit.Query(
    after: new DateTime(2020, 11, 1),
    before: new DateTime(2020, 11, 30)
);

foreach (StarkBank.Deposit deposit in deposits)
{
    Console.WriteLine(deposit);
}
  

Go

package main

import (
    "fmt"
    "time"
    "github.com/starkbank/sdk-go/starkbank/deposit"
)

func main() {

    var params = map[string]interface{}{}
    params["after"] = time.Date(2020, 11, 1, 0, 0, 0, 0, time.UTC)
    params["before"] = time.Date(2020, 11, 30, 0, 0, 0, 0, time.UTC)

    deposits, errorChannel := deposit.Query(params, nil)

    loop:
    for {
        select {
        case err := <-errorChannel:
            if err.Errors != nil {
                for _, e := range err.Errors {
                    fmt.Printf("code: %s, message: %s", e.Code, e.Message)
                }
            }
        case deposit, ok := <-deposits:
            if !ok {
                break loop
            }
            fmt.Printf("%+v", deposit)
        }
    }
}
  

Clojure

(def deposits (starkbank.deposit/query {
    :after "2020-11-01"
    :before "2020-11-30"
}))

(doseq [deposit deposits]
    (println deposit))
  

Curl

curl --location --request GET '{{baseUrl}}/v2/deposit?after=2020-11-01&before=2020-11-30' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}'
  
RESPONSE

Python

Deposit(
    account_number=1010101010101010,
    account_type= "payment",
    amount=100000,
    bank_code=20018183,
    branch_code=0001,
    created=2020-11-11 14:42:45.824846,
    fee=50,
    id=5155165527080960,
    name=Iron Bank S.A,
    status=created,
    tags=['deposit'],
    tax_id=10.203.000/0001-80,
    transaction_ids=['6663513506316288'],
    type=pix,
    updated=2020-11-11 14:42:47.333539
)
  

Javascript

Deposit {
    id: '5155165527080960',
    name: 'Iron Bank S.A',
    taxId: '10.203.000/0001-80',
    bankCode: '20018183',
    branchCode: '0001',
    accountNumber: '1010101010101010',
    accountType: 'payment',
    amount: 100000,
    type: 'pix',
    status: 'created',
    tags: [ 'deposit' ],
    fee: 50,
    transactionIds: [ '6663513506316288' ],
    created: '2020-11-11T14:42:43.144663+00:00',
    updated: '2020-11-11T14:42:53.282375+00:00'
}
  

PHP

StarkBank\Deposit Object
(
    [id] => 5155165527080960
    [name] => Iron Bank S.A
    [taxId] => 10.203.000/0001-80
    [bankCode] => 20018183
    [branchCode] => 0001
    [accountNumber] => 1010101010101010
    [accountType] => payment
    [amount] => 100000
    [type] => pix
    [status] => created
    [tags] => Array
        (
            [0] => deposit
        )

    [fee] => 50
    [transactionIds] => Array
        (
            [0] => 6663513506316288
        )

    [created] => DateTime Object
        (
            [date] => 2020-11-11 14:42:43.144663
            [timezone_type] => 1
            [timezone] => +00:00
        )

    [updated] => DateTime Object
        (
            [date] => 2020-11-11 14:42:53.282375
            [timezone_type] => 1
            [timezone] => +00:00
        )

)
  

Java

Deposit({
    "name": "Iron Bank S.A",
    "taxId": "10.203.000/0001-80",
    "bankCode": "20018183",
    "branchCode": "0001",
    "accountNumber": "1010101010101010",
    "accountType": "payment",
    "amount": 100000,
    "type": "pix",
    "status": "created",
    "tags": [
        "deposit"
    ],
    "fee": 50,
    "transactionIds": [
        "6663513506316288"
    ],
    "created": "2020-11-11T14:42:43.144663+00:00",
    "updated": "2020-11-11T14:42:53.282375+00:00",
    "id": "5155165527080960"
})
  

Ruby

deposit(
    id: 5155165527080960,
    name: Iron Bank S.A,
    tax_id: 10.203.000/0001-80,
    bank_code: 20018183,
    branch_code: 0001,
    account_number: 1010101010101010,
    account_type: payment,
    amount: 100000,
    type: pix,
    status: created,
    tags: ["deposit"],
    fee: 50,
    transaction_ids: ["5862355036536832"],
    created: 2020-11-11T14:42:43+00:00,
    updated: 2020-11-11T14:42:53+00:00
)
  

Elixir

%StarkBank.Deposit{
    account_number: "5078376503050240",
    account_type: "payment",
    amount: 100000,
    bank_code: "20018183",
    branch_code: "0001",
    created: ~U[2020-11-11 14:42:53.282375Z]
    fee: 50,
    id: "5155165527080960",
    name: "Stark Bank S.A.",
    status: "created",
    tags: ["deposit"],
    tax_id: "10.203.000/0001-80",
    transaction_ids: ["6663513506316288"],
    type: "pix",
    updated: ~U[2020-11-11 14:42:53.282375Z]
}
  

C#

Deposit(
    Amount: 100000,
    Name: Iron Bank S.A,
    TaxID: 10.203.000/0001-80,
    BankCode: 20018183,
    BranchCode: 0001,
    AccountNumber: 1010101010101010,
    AccountType: payment,
    Type: pix,
    Fee: 50,
    TransactionIds: { 6663513506316288 },
    Status: created,
    Tags: { deposit },
    Created: 11/11/2020 11:42:43,
    Updated: 11/11/2020 11:42:53,
    ID: 5155165527080960
)
  

Go

{
    Id:5155165527080960
    Name:Iron Bank S.A
    TaxId:10.203.000/0001-80
    BankCode:20018183
    BranchCode:0001
    AccountNumber:1010101010101010
    AccountType:payment
    Amount:100000
    Type:pix
    Status:created
    Tags:[deposit]
    Fee:50
    TransactionIds:[6663513506316288]
    Created:2020-11-11 14:42:18.281081 +0000 +0000
    Updated:2020-11-11 14:42:20.060486 +0000 +0000
}
  

Clojure

{
    :amount 100000,
    :fee 50,
    :tags [deposit],
    :branch-code 0001,
    :updated 2020-11-11T11:42:58.939596+00:00,
    :name Stark Bank S.A.,
    :tax-id 10.203.000/0001-80,
    :type pix,
    :created 2020-11-11T11:42:57.490286+00:00,
    :status created,
    :id 5155165527080960,
    :transaction-ids [6663513506316288],
    :account-number 1010101010101010,
    :account-type payment,
    :bank-code 20018183
}
  

Curl

{
    "cursor": null,
    "deposits": [
        {
            "status": "created",
            "updated": "2020-11-11T14:42:53.282375+00:00",
            "accountNumber": "1010101010101010",
            "accountType": "payment",
            "taxId": "10.203.000/0001-80",
            "transactionIds": [
                "6663513506316288"
            ],
            "bankCode": "20018183",
            "id": "5155165527080960",
            "fee": 50,
            "name": "Iron Bank S.A",
            "created": "2020-11-11T14:42:43.144663+00:00",
            "tags": [
                "deposit"
            ],
            "branchCode": "0001",
            "amount": 100000,
            "type": "pix"
        }
    ]
}
  

Get a Deposit

Get a single Deposit by its id.

Parameters

id REQUIRED

Id of the deposit. Example: '5656565656565656'.

fields OPTIONAL

List of strings to filter response JSON keys. Not available in the SDKs.

ENDPOINT
GET /v2/deposit/:id
REQUEST

Python

import starkbank

deposit = starkbank.deposit.get("5155165527080960")

print(deposit)
  

Javascript

const starkbank = require('starkbank');

(async() => {
    let deposit = await starkbank.deposit.get('5155165527080960')
    console.log(deposit);
})();
  

PHP

use StarkBank\Deposit;

$deposit = Deposit::get('5155165527080960');

print_r($deposit);
  

Java

import com.starkbank.*;

Deposit deposit = Deposit.get("5155165527080960");

System.out.println(deposit);
  

Ruby

require('starkbank')

deposit = StarkBank::Deposit.get('5155165527080960')

puts deposit
  

Elixir

deposit = StarkBank.Deposit.get!("5155165527080960")
|> IO.inspect
  

C#

using System;

StarkBank.Deposit deposit = StarkBank.Deposit.Get("5155165527080960");

Console.WriteLine(deposit);
  

Go

package main

import (
    "fmt"
    "github.com/starkbank/sdk-go/starkbank/deposit"
)

func main() {

    deposit, err := deposit.Get("5155165527080960", nil)
    if err.Errors != nil {
        for _, e := range err.Errors {
            fmt.Printf("code: %s, message: %s", e.Code, e.Message)
        }
    }

    fmt.Printf("%+v", deposit)
}
  

Clojure

(def deposit (starkbank.deposit/get "5155165527080960"))

(println deposit)
  

Curl

curl --location --request GET '{{baseUrl}}/v2/deposit/5155165527080960' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}'
  
RESPONSE

Python

Deposit(
    account_number=1010101010101010,
    account_type= "payment",
    amount=100000,
    bank_code=20018183,
    branch_code=0001,
    created=2020-11-11 14:42:45.824846,
    fee=50,
    id=5155165527080960,
    name=Iron Bank S.A,
    status=created,
    tags=['deposit'],
    tax_id=10.203.000/0001-80,
    transaction_ids=['6663513506316288'],
    type=pix,
    updated=2020-11-11 14:42:47.333539
)
  

Javascript

Deposit {
    id: '5155165527080960',
    name: 'Iron Bank S.A',
    taxId: '10.203.000/0001-80',
    bankCode: '20018183',
    branchCode: '0001',
    accountNumber: '1010101010101010',
    accountType: 'payment',
    amount: 100000,
    type: 'pix',
    status: 'created',
    tags: [ 'deposit' ],
    fee: 50,
    transactionIds: [ '6663513506316288' ],
    created: '2020-11-11T14:42:43.144663+00:00',
    updated: '2020-11-11T14:42:53.282375+00:00'
}
  

PHP

StarkBank\Deposit Object
(
    [id] => 5155165527080960
    [name] => Iron Bank S.A
    [taxId] => 10.203.000/0001-80
    [bankCode] => 20018183
    [branchCode] => 0001
    [accountNumber] => 1010101010101010
    [accountType] => payment
    [amount] => 100000
    [type] => pix
    [status] => created
    [tags] => Array
        (
            [0] => deposit
        )

    [fee] => 50
    [transactionIds] => Array
        (
            [0] => 6663513506316288
        )

    [created] => DateTime Object
        (
            [date] => 2020-11-11 14:42:43.144663
            [timezone_type] => 1
            [timezone] => +00:00
        )

    [updated] => DateTime Object
        (
            [date] => 2020-11-11 14:42:53.282375
            [timezone_type] => 1
            [timezone] => +00:00
        )

)
  

Java

Deposit({
    "name": "Iron Bank S.A",
    "taxId": "10.203.000/0001-80",
    "bankCode": "20018183",
    "branchCode": "0001",
    "accountNumber": "1010101010101010",
    "accountType": "payment",
    "amount": 100000,
    "type": "pix",
    "status": "created",
    "tags": [
        "deposit"
    ],
    "fee": 50,
    "transactionIds": [
        "6663513506316288"
    ],
    "created": "2020-11-11T14:42:43.144663+00:00",
    "updated": "2020-11-11T14:42:53.282375+00:00",
    "id": "5155165527080960"
})
  

Ruby

deposit(
    id: 5155165527080960,
    name: Iron Bank S.A,
    tax_id: 10.203.000/0001-80,
    bank_code: 20018183,
    branch_code: 0001,
    account_number: 1010101010101010,
    account_type: payment,
    amount: 100000,
    type: pix,
    status: created,
    tags: ["deposit"],
    fee: 50,
    transaction_ids: ["5862355036536832"],
    created: 2020-11-11T14:42:43+00:00,
    updated: 2020-11-11T14:42:53+00:00
)
  

Elixir

%StarkBank.Deposit{
    account_number: "5078376503050240",
    account_type: "payment",
    amount: 100000,
    bank_code: "20018183",
    branch_code: "0001",
    created: ~U[2020-11-11 14:42:53.282375Z]
    fee: 50,
    id: "5155165527080960",
    name: "Stark Bank S.A.",
    status: "created",
    tags: ["deposit"],
    tax_id: "10.203.000/0001-80",
    transaction_ids: ["6663513506316288"],
    type: "pix",
    updated: ~U[2020-11-11 14:42:53.282375Z]
}
  

C#

Deposit(
    Amount: 100000,
    Name: Iron Bank S.A,
    TaxID: 10.203.000/0001-80,
    BankCode: 20018183,
    BranchCode: 0001,
    AccountNumber: 1010101010101010,
    AccountType: payment,
    Type: pix,
    Fee: 50,
    TransactionIds: { 6663513506316288 },
    Status: created,
    Tags: { deposit },
    Created: 11/11/2020 11:42:43,
    Updated: 11/11/2020 11:42:53,
    ID: 5155165527080960
)
  

Go

{
    Id:5155165527080960
    Name:Iron Bank S.A
    TaxId:10.203.000/0001-80
    BankCode:20018183
    BranchCode:0001
    AccountNumber:1010101010101010
    AccountType:payment
    Amount:100000
    Type:pix
    Status:created
    Tags:[deposit]
    Fee:50
    TransactionIds:[6663513506316288]
    Created:2020-11-11 14:42:18.281081 +0000 +0000
    Updated:2020-11-11 14:42:20.060486 +0000 +0000
}
  

Clojure

{
    :amount 100000,
    :fee 50,
    :tags [deposit],
    :branch-code 0001,
    :updated 2020-11-11T11:42:58.939596+00:00,
    :name Stark Bank S.A.,
    :tax-id 10.203.000/0001-80,
    :type pix,
    :created 2020-11-11T11:42:57.490286+00:00,
    :status created,
    :id 5155165527080960,
    :transaction-ids [6663513506316288],
    :account-number 1010101010101010,
    :account-type payment,
    :bank-code 20018183
}
  

Curl

{
    "deposits":
        {
            "status": "created",
            "updated": "2020-11-11T14:42:53.282375+00:00",
            "accountNumber": "1010101010101010",
            "accountType": "payment",
            "taxId": "10.203.000/0001-80",
            "transactionIds": [
                "6663513506316288"
            ],
            "bankCode": "20018183",
            "id": "5155165527080960",
            "fee": 50,
            "name": "Iron Bank S.A",
            "created": "2020-11-11T14:42:43.144663+00:00",
            "tags": [
                "deposit"
            ],
            "branchCode": "0001",
            "amount": 100000,
            "type": "pix"
        }
}
  

Update a Deposit

Update the Deposit by passing its id to be partially or fully reversed.

Parameters

id REQUIRED

Id of the deposit. Example: '5155165527080960'.

amount REQUIRED

The new amount of the Deposit. If the amount = 0 the Deposit will be fully reversed

ENDPOINT
PATCH /v2/deposit/:id
REQUEST

Python

import starkbank

deposit = starkbank.deposit.update(
    "5155165527080960",
    amount=0,
)

print(deposit)
  

Javascript

const starkbank = require('starkbank');

(async() => {
    let deposit = await starkbank.deposit.update(
        '5155165527080960',
        {
            amount: 0
        }
    );

    console.log(deposit);
})();
  

PHP

Not yet available. Please contact us if you need this SDK.
  

Java

import com.starkbank.*;
import java.util.HashMap;

HashMap patchData = new HashMap<>();
patchData.put("amount", 0);
Deposit deposit = Deposit.update("5155165527080960", patchData);

System.out.println(deposit);
      

Ruby

Not yet available. Please contact us if you need this SDK.
  

Elixir

Not yet available. Please contact us if you need this SDK.
  

C#

Not yet available. Please contact us if you need this SDK.
  

Go

Not yet available. Please contact us if you need this SDK.
  

Clojure

Not yet available. Please contact us if you need this SDK.
  

Curl

curl --location --request PATCH '{{baseUrl}}/v2/deposit/5155165527080960' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}' 
--header 'Content-Type: application/json' 
--data-raw '{
    "amount": 0,
}'
  
RESPONSE

Python

Deposit (
  id="6165578200907776",
  name="Brice Ltda.",
  tax_id="72.831.025/0001-48",
  bank_code="07252614",
  branch_code="2645",
  account_number="4729524077596703",
  account_type="savings",
  amount=0,
  type="pix",
  status="created",
  tags=[
    "e07252614202310251510pkudndwgiev",
    "72055490-9aa6-4df9-ab5c-2009a9621f33",
    "ditto"
  ],
  fee=0,
  transaction_ids=[ "72909267320047755761378230622962" ],
  created="2023-10-25T15:10:51.111167+00:00",
  updated="2024-01-10T14:08:24.577238+00:00"
)
      

Javascript

Deposit {
  id: '6165578200907776',
  name: 'Brice Ltda.',
  taxId: '72.831.025/0001-48',
  bankCode: '07252614',
  branchCode: '2645',
  accountNumber: '4729524077596703',
  accountType: 'savings',
  amount: 0,
  type: 'pix',
  status: 'created',
  tags: [
    'e07252614202310251510pkudndwgiev',
    '72055490-9aa6-4df9-ab5c-2009a9621f33',
    'ditto'
  ],
  fee: 0,
  transactionIds: [ '72909267320047755761378230622962' ],
  created: '2023-10-25T15:10:51.111167+00:00',
  updated: '2024-01-10T14:08:24.577238+00:00'
}
    

PHP

Not yet available. Please contact us if you need this SDK.
  

Java

    Deposit({
        "id": "6676193709391872",
        "name": "Stark Bank S.A. - Instituicao de Pagamento",
        "taxId": "20.018.183/0001-80",
        "bankCode": "20018183",
        "branchCode": "0001",
        "accountNumber": "6285683442319360",
        "accountType": "payment",
        "amount": "0",
        "type": "pix",
        "status": "created",
        "tags": [ "e20018183202401091210feho2snf786" ],
        "fee": "0",
        "transactionIds": [ "14776349998573571486997563581928" ],
        "created": "2024-01-09T12:10:26.394336+00:00",
        "updated": "2024-01-09T17:37:28.082085+00:00"
    })
  

Ruby

Not yet available. Please contact us if you need this SDK.
  

Elixir

Not yet available. Please contact us if you need this SDK.
  

C#

Not yet available. Please contact us if you need this SDK.
  

Go

    Not yet available. Please contact us if you need this SDK.
  

Clojure

Not yet available. Please contact us if you need this SDK.
  

Curl

{
  Deposit {
    "id": "6165578200907776",
    "name": "Brice Ltda.",
    "taxId": "72.831.025/0001-48",
    "bankCode": "07252614",
    "branchCode": "2645",
    "accountNumber": "4729524077596703",
    "accountType": "savings",
    "amount": 0,
    "type": "pix",
    "status": "created",
    "tags": [
       "e07252614202310251510pkudndwgiev",
       "72055490-9aa6-4df9-ab5c-2009a9621f33",
       "ditto"
     ],
     "fee": 0,
     "transactionIds": [ "72909267320047755761378230622962" ],
     "created": "2023-10-25T15:10:51.111167+00:00",
     "updated": "2024-01-10T14:08:24.577238+00:00"
   }
}
  

List Deposit Logs

Get a paged list of all deposit logs. A log tracks a change in the deposit entity according to its life cycle.

Parameters

after OPTIONAL

Filter entities created after this date.

before OPTIONAL

Filter entities created before this date.

cursor OPTIONAL

String used to get the next batch of results. Our SDKs handle this for you.

depositIds OPTIONAL

Array of deposit ids that are linked to the logs you desire.

fields OPTIONAL

List of strings to filter response JSON keys. Not available in the SDKs.

limit OPTIONAL

Number of results per cursor. Max = 100.

types OPTIONAL

Filters logs by log types.

ENDPOINT
GET /v2/deposit/log
REQUEST

Python

import starkbank

logs = starkbank.deposit.log.query(
    after="2020-11-01",
    before="2020-11-30"
)

for log in logs:
    print(log)
  

Javascript

const starkbank = require('starkbank');

(async() => {
    let logs = await starkbank.deposit.log.query({
        after: '2020-11-01',
        before: '2020-11-30'
    });

    for await (let log of logs) {
        console.log(log);
    }
})();
  

PHP

use StarkBank\Deposit\Log;

$depositLogs = iterator_to_array(
    Log::query([
    "after" => "2020-11-01T18:00:00.000000+00:00",
    "before" => "2020-11-30T18:00:00.000000+00:00"
    ])
);

foreach($depositLogs as $log) {
    print_r($log);
}
  

Java

import com.starkbank.*;
import com.starkbank.utils.Generator;
import java.util.HashMap;

HashMap<String, Object> params = new HashMap<>();
params.put("after", "2020-11-01");
params.put("before", "2020-11-30");
Generator<Deposit.Log> logs = Deposit.Log.query(params);

for (Deposit.Log log : logs){
    System.out.println(log);
}
  

Ruby

require('starkbank')

logs = StarkBank::Deposit::Log.query(
    after: '2020-11-01',
    before: '2020-11-30'
)

logs.each do |log|
    puts log
end
  

Elixir

logs = StarkBank.Deposit.Log.query!(
    after: "2020-11-01",
    before: "2020-11-30"
    )
|> Enum.take(1)
|> IO.inspect
  

C#

using System;
using System.Collections.Generic;

IEnumerable<StarkBank.Deposit.Log> logs = StarkBank.Deposit.Log.Query(
    after: new DateTime(2020, 11, 1),
    before: new DateTime(2020, 11, 30)
);

foreach(StarkBank.Deposit.Log log in logs) {
    Console.WriteLine(log);
}
  

Go

package main

import (
    "fmt"
    "time"
    "github.com/starkbank/sdk-go/starkbank/deposit/log"
)

func main() {

    var params = map[string]interface{}{}
    params["after"] = time.Date(2020, 11, 1, 0, 0, 0, 0, time.UTC)
    params["before"] = time.Date(2020, 11, 30, 0, 0, 0, 0, time.UTC)

    logs, errorChannel := log.Query(params, nil)

    loop:
    for {
        select {
        case err := <-errorChannel:
            if err.Errors != nil {
                for _, e := range err.Errors {
                    fmt.Printf("code: %s, message: %s", e.Code, e.Message)
                }
            }
        case log, ok := <-logs:
            if !ok {
                break loop
            }
            fmt.Printf("%+v", log)
        }
    }
}
  

Clojure

(def logs (starkbank.deposit.log/query {
    :after "2020-11-01"
    :before "2020-11-30"
}))

(doseq [log logs]
    (println log))
  

Curl

curl --location --request GET '{{baseUrl}}/v2/deposit/log?after=2020-11-01&before=2020-11-30' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}'
  
RESPONSE

Python

Log(
    created=2020-11-11 14:44:44.385820,
    deposit=Deposit(
        account_number=1010101010101010,
        account_type=payment,
        amount=9000,
        bank_code=20018183,
        branch_code=0001,
        created=2020-11-11 14:44:43.144663,
        fee=50,
        id=5738709764800512,
        name=Iron Bank S.A,
        status=created,
        tags=['deposit'],
        tax_id=10.203.000/0001-80,
        transaction_ids=['5862355036536832'],
        type=pix,
        updated=2020-11-11 14:44:53.298960
    ),
    errors=[],
    id=5066704988143616,
    type=credited
)
  

Javascript

Log {
    id: '5066704988143616',
    created: '2020-11-11T14:44:44.385820+00:00',
    type: 'credited',
    errors: [],
    deposit: {
        status: 'created',
        updated: '2020-11-11T14:44:53.298960+00:00',
        accountNumber: '1010101010101010',
        accountType: 'payment',
        taxId: '10.203.000/0001-80',
        transactionIds: [ '5862355036536832' ],
        bankCode: '20018183',
        id: '5738709764800512',
        fee: 50,
        name: 'Iron Bank S.A',
        created: '2020-11-11T14:44:43.144663+00:00',
        tags: [ 'deposit' ],
        branchCode: '0001',
        amount: 9000,
        type: 'pix'
    }
}
  

PHP

StarkBank\Deposit\Log Object
(
    [id] => 5066704988143616
    [created] => DateTime Object
        (
            [date] => 2020-11-11 14:44:57.576040
            [timezone_type] => 1
            [timezone] => +00:00
        )

    [type] => created
    [errors] => Array
        (
        )

    [deposit] => StarkBank\Deposit Object
        (
            [id] => 5738709764800512
            [name] => Iron Bank S.A
            [taxId] => 10.203.000/0001-80
            [bankCode] => 20018183
            [branchCode] => 0001
            [accountNumber] => 1010101010101010
            [accountType] => payment
            [amount] => 9000
            [type] => pix
            [status] => created
            [tags] => Array
                (
                    [0] => deposit
                )

            [fee] =>
            [transactionIds] => Array
                (
                    [0] => 5862355036536832
                )

            [created] => DateTime Object
                (
                    [date] => 2020-11-11 14:44:57.490286
                    [timezone_type] => 1
                    [timezone] => +00:00
                )

            [updated] => DateTime Object
                (
                    [date] => 2020-11-11 14:44:58.966772
                    [timezone_type] => 1
                    [timezone] => +00:00
                )

        )

)
  

Java

Log({
    "created": "2020-11-11T14:44:44.385820+00:00",
    "type": "credited",
    "errors": [],
    "deposit": {
        "name": "Iron Bank S.A",
        "taxId": "10.203.000/0001-80",
        "bankCode": "20018183",
        "branchCode": "0001",
        "accountNumber": "1010101010101010",
        "accountType": "payment",
        "amount": 9000,
        "type": "pix",
        "status": "created",
        "tags": [
        "deposit"
        ],
        "fee": 50,
        "transactionIds": [
        "5862355036536832"
        ],
        "created": "2020-11-11T14:44:43.144663+00:00",
        "updated": "2020-11-11T14:44:53.298960+00:00",
        "id": "5738709764800512"
    },
    "id": "5066704988143616"
})
  

Ruby

log(
    id: 5066704988143616,
    type: credited,
    errors: [],
    deposit: deposit(
        id: 5738709764800512,
        name: Iron Bank S.A,
        tax_id: 10.203.000/0001-80,
        bank_code: 20018183,
        branch_code: 0001,
        account_number: 1010101010101010,
        account_type: payment,
        amount: 9000,
        type: pix,
        status: created,
        tags: ["deposit"],
        fee: 50,
        transaction_ids: ["5862355036536832"],
        created: 2020-11-11T14:44:43+00:00,
        updated: 2020-11-11T14:44:53+00:00
    ),
    created: 2020-11-11T14:44:44+00:00
)
  

Elixir

%StarkBank.Deposit.Log{
    created: ~U[2020-11-11 14:44:44.385820Z],
    deposit: %StarkBank.Deposit{
        account_number: "1010101010101010",
        account_type: "payment",
        amount: 9000,
        bank_code: "20018183",
        branch_code: "0001",
        created: ~U[2020-11-11 14:44:43.144663Z],
        fee: 50,
        id: "5738709764800512",
        name: "Iron Bank S.A",
        status: "created",
        tags: ["deposit"],
        tax_id: "10.203.000/0001-80",
        transaction_ids: ["5862355036536832"],
        type: "pix",
        updated: ~U[2020-11-11 14:44:53.298960Z]
    },
    errors: [],
    id: "5066704988143616",
    type: "credited"
}
  

C#

Log(
    Created: 11/11/2020 11:44:44,
    Type: credited,
    Errors: {  },
    Deposit: Deposit(
        Amount: 9000,
        Name: Iron Bank S.A,
        TaxID: 10.203.000/0001-80,
        BankCode: 20018183,
        BranchCode: 0001,
        AccountNumber: 1010101010101010,
        AccountType: payment,
        Type: pix,
        Fee: 50,
        TransactionIds: { 5862355036536832 },
        Status: created,
        Tags: { deposit },
        Created: 11/11/2020 11:44:43,
        Updated: 11/11/2020 11:44:53,
        ID: 5738709764800512
    ),
    ID: 5066704988143616
)
  

Go

{
    Id:5066704988143616
    Deposit:{
        Id:5738709764800512
        Name:Iron Bank S.A
        TaxId:10.203.000/0001-80
        BankCode:20018183
        BranchCode:0001
        AccountNumber:1010101010101010
        AccountType:payment
        Amount:9000
        Type:pix
        Status:created
        Tags:[deposit]
        Fee:50
        TransactionIds:[5862355036536832]
        Created:2020-11-11 19:01:22.183451 +0000 +0000
        Updated:2020-11-11 19:01:23.183451 +0000 +0000
    }
    Errors:[]
    Type:credited
    Created:2020-11-11 14:44:44.520104 +0000 +0000
}
  

Clojure

{
    :id 5066704988143616,
    :created 2020-11-11T14:44:06.804223+00:00,
    :errors [],
    :type credited,
    :deposit {
        :amount 9000,
        :fee 50,
        :tags [deposit],
        :branch-code 0001,
        :updated 2020-11-11T11:44:58.939596+00:00,
        :name Iron Bank S.A,
        :tax-id 10.203.000/0001-80,
        :type pix,
        :created 2020-11-11T11:44:57.490286+00:00,
        :status created,
        :id 5738709764800512,
        :transaction-ids [5862355036536832],
        :account-number 1010101010101010,
        :account-type payment,
        :bank-code 20018183
    }
}
  

Curl

{
    "cursor": null,
    "logs": [
        {
            "deposit": {
                "status": "created",
                "updated": "2020-11-11T14:44:53.298960+00:00",
                "accountNumber": "1010101010101010",
                "accountType": "payment",
                "taxId": "10.203.000/0001-80",
                "transactionIds": [
                    "5862355036536832"
                ],
                "bankCode": "20018183",
                "id": "5738709764800512",
                "fee": 50,
                "name": "Iron Bank S.A",
                "created": "2020-11-11T14:44:43.144663+00:00",
                "tags": [
                    "deposit"
                ],
                "branchCode": "0001",
                "amount": 9000,
                "type": "pix"
            },
            "errors": [],
            "type": "credited",
            "id": "5066704988143616",
            "created": "2020-11-11T14:44:44.385820+00:00"
        }
    ]
}
  

Get a Deposit Log

Get a single deposit log by its id.

Parameters

id REQUIRED

Id of the log entity

fields OPTIONAL

List of strings to filter response JSON keys. Not available in the SDKs.

ENDPOINT
GET /v2/deposit/log/:id
REQUEST

Python

import starkbank

log = starkbank.deposit.log.get("5066704988143616")

print(log)
  

Javascript

const starkbank = require('starkbank');

(async() => {
    let log = await starkbank.deposit.log.get('5066704988143616');
    console.log(log);
})();
  

PHP

use StarkBank\Deposit\Log;

$depositLog = Log::get("5066704988143616");

print_r($depositLog);
  

Java

import com.starkbank.*;

Deposit.Log log = Deposit.Log.get("5066704988143616");

System.out.println(log);
  

Ruby

require('starkbank')

log = StarkBank::Deposit::Log.get('5066704988143616')

puts log
  

Elixir

log = StarkBank.Deposit.Log.get!("5066704988143616")
|> IO.inspect
  

C#

using System;

StarkBank.Deposit.Log log = StarkBank.Deposit.Log.Get("5066704988143616");

Console.WriteLine(log);
  

Go

package main

import (
    "fmt"
    "github.com/starkbank/sdk-go/starkbank/deposit/log"
)

func main() {

    log, err := log.Get("5066704988143616", nil)
    if err.Errors != nil {
        for _, e := range err.Errors {
            fmt.Printf("code: %s, message: %s", e.Code, e.Message)
        }
    }

    fmt.Printf("%+v", log)
}
  

Clojure

(def log (starkbank.deposit.log/get "5066704988143616"))

(println log)
  

Curl

curl --location --request GET '{{baseUrl}}/v2/deposit/log/5066704988143616' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}'
  
RESPONSE

Python

Log(
    created=2020-11-11 14:44:44.385820,
    deposit=Deposit(
        account_number=1010101010101010,
        account_type=payment,
        amount=9000,
        bank_code=20018183,
        branch_code=0001,
        created=2020-11-11 14:44:43.144663,
        fee=50,
        id=5738709764800512,
        name=Iron Bank S.A,
        status=created,
        tags=['deposit'],
        tax_id=10.203.000/0001-80,
        transaction_ids=['5862355036536832'],
        type=pix,
        updated=2020-11-11 14:44:53.298960
    ),
    errors=[],
    id=5066704988143616,
    type=credited
)
  

Javascript

Log {
    id: '5066704988143616',
    created: '2020-11-11T14:44:44.385820+00:00',
    type: 'credited',
    errors: [],
    deposit: {
        status: 'created',
        updated: '2020-11-11T14:44:53.298960+00:00',
        accountNumber: '1010101010101010',
        accountType: 'payment',
        taxId: '10.203.000/0001-80',
        transactionIds: [ '5862355036536832' ],
        bankCode: '20018183',
        id: '5738709764800512',
        fee: 50,
        name: 'Iron Bank S.A',
        created: '2020-11-11T14:44:43.144663+00:00',
        tags: [ 'deposit' ],
        branchCode: '0001',
        amount: 9000,
        type: 'pix'
    }
}
  

PHP

StarkBank\Deposit\Log Object
(
    [id] => 5066704988143616
    [created] => DateTime Object
        (
            [date] => 2020-11-11 14:44:57.576040
            [timezone_type] => 1
            [timezone] => +00:00
        )

    [type] => created
    [errors] => Array
        (
        )

    [deposit] => StarkBankDeposit Object
        (
            [id] => 5738709764800512
            [name] => Iron Bank S.A
            [taxId] => 10.203.000/0001-80
            [bankCode] => 20018183
            [branchCode] => 0001
            [accountNumber] => 1010101010101010
            [accountType] => payment
            [amount] => 9000
            [type] => pix
            [status] => created
            [tags] => Array
                (
                    [0] => deposit
                )

            [fee] =>
            [transactionIds] => Array
                (
                    [0] => 5862355036536832
                )

            [created] => DateTime Object
                (
                    [date] => 2020-11-11 14:44:57.490286
                    [timezone_type] => 1
                    [timezone] => +00:00
                )

            [updated] => DateTime Object
                (
                    [date] => 2020-11-11 14:44:58.966772
                    [timezone_type] => 1
                    [timezone] => +00:00
                )

        )

)
  

Java

Log({
    "created": "2020-11-11T14:44:44.385820+00:00",
    "type": "credited",
    "errors": [],
    "deposit": {
        "name": "Iron Bank S.A",
        "taxId": "10.203.000/0001-80",
        "bankCode": "20018183",
        "branchCode": "0001",
        "accountNumber": "1010101010101010",
        "accountType": "payment",
        "amount": 9000,
        "type": "pix",
        "status": "created",
        "tags": [
        "deposit"
        ],
        "fee": 50,
        "transactionIds": [
        "5862355036536832"
        ],
        "created": "2020-11-11T14:44:43.144663+00:00",
        "updated": "2020-11-11T14:44:53.298960+00:00",
        "id": "5738709764800512"
    },
    "id": "5066704988143616"
})
  

Ruby

log(
    id: 5066704988143616,
    type: credited,
    errors: [],
    deposit: deposit(
        id: 5738709764800512,
        name: Iron Bank S.A,
        tax_id: 10.203.000/0001-80,
        bank_code: 20018183,
        branch_code: 0001,
        account_number: 1010101010101010,
        account_type: payment,
        amount: 9000,
        type: pix,
        status: created,
        tags: ["deposit"],
        fee: 50,
        transaction_ids: ["5862355036536832"],
        created: 2020-11-11T14:44:43+00:00,
        updated: 2020-11-11T14:44:53+00:00
    ),
    created: 2020-11-11T14:44:44+00:00
)
  

Elixir

%StarkBank.Deposit.Log{
    created: ~U[2020-11-11 14:44:44.385820Z],
    deposit: %StarkBank.Deposit{
        account_number: "1010101010101010",
        account_type: "payment",
        amount: 9000,
        bank_code: "20018183",
        branch_code: "0001",
        created: ~U[2020-11-11 14:44:43.144663Z],
        fee: 50,
        id: "5738709764800512",
        name: "Iron Bank S.A",
        status: "created",
        tags: ["deposit"],
        tax_id: "10.203.000/0001-80",
        transaction_ids: ["5862355036536832"],
        type: "pix",
        updated: ~U[2020-11-11 14:44:53.298960Z]
    },
    errors: [],
    id: "5066704988143616",
    type: "credited"
}
  

C#

Log(
    Created: 11/11/2020 11:44:44,
    Type: credited,
    Errors: {  },
    Deposit: Deposit(
        Amount: 9000,
        Name: Iron Bank S.A,
        TaxID: 10.203.000/0001-80,
        BankCode: 20018183,
        BranchCode: 0001,
        AccountNumber: 1010101010101010,
        AccountType: payment,
        Type: pix,
        Fee: 50,
        TransactionIds: { 5862355036536832 },
        Status: created,
        Tags: { deposit },
        Created: 11/11/2020 11:44:43,
        Updated: 11/11/2020 11:44:53,
        ID: 5738709764800512
    ),
    ID: 5066704988143616
)
  

Go

{
    Id:5066704988143616
    Deposit:{
        Id:5738709764800512
        Name:Iron Bank S.A
        TaxId:10.203.000/0001-80
        BankCode:20018183
        BranchCode:0001
        AccountNumber:1010101010101010
        AccountType:payment
        Amount:9000
        Type:pix
        Status:created
        Tags:[deposit]
        Fee:50
        TransactionIds:[5862355036536832]
        Created:2020-11-11 19:01:22.183451 +0000 +0000
        Updated:2020-11-11 19:01:23.183451 +0000 +0000
    }
    Errors:[]
    Type:credited
    Created:2020-11-11 14:44:44.520104 +0000 +0000
}
  

Clojure

{
    :id 5066704988143616,
    :created 2020-11-11T14:44:06.804223+00:00,
    :errors [],
    :type credited,
    :deposit {
        :amount 9000,
        :fee 50,
        :tags [deposit],
        :branch-code 0001,
        :updated 2020-11-11T11:44:58.939596+00:00,
        :name Iron Bank S.A,
        :tax-id 10.203.000/0001-80,
        :type pix,
        :created 2020-11-11T11:44:57.490286+00:00,
        :status created,
        :id 5738709764800512,
        :transaction-ids [5862355036536832],
        :account-number 1010101010101010,
        :account-type payment,
        :bank-code 20018183
    }
}
  

Curl

{
    "deposit": {
        "status": "created",
        "updated": "2020-11-11T14:44:53.298960+00:00",
        "accountNumber": "1010101010101010",
        "accountType": "payment",
        "taxId": "10.203.000/0001-80",
        "transactionIds": [
            "5862355036536832"
        ],
        "bankCode": "20018183",
        "id": "5738709764800512",
        "fee": 50,
        "name": "Iron Bank S.A",
        "created": "2020-11-11T14:44:43.144663+00:00",
        "tags": [
            "deposit"
        ],
        "branchCode": "0001",
        "amount": 9000,
        "type": "pix"
    },
    "errors": [],
    "type": "credited",
    "id": "5066704988143616",
    "created": "2020-11-11T14:44:44.385820+00:00"
}
  

Get a reversed Deposit Log PDF

Whenever a Deposit is successfully reversed, a reversed log will be created. To retrieve a specific reversal receipt, you can request the corresponding log PDF.

Parameters

id REQUIRED

Id of the log Deposit entity.

ENDPOINT
GET /v2/deposit/log/:id/pdf
REQUEST

Python

import starkbank

pdf = starkbank.deposit.log.pdf("6742710681600000")

with open("deposit-reversal.pdf", "wb") as file:
    file.write(pdf)
  

Javascript

const starkbank = require('starkbank');
const fs = require('fs').promises;

(async() => {
    let pdf = await starkbank.deposit.log.pdf('6742710681600000');
    await fs.writeFile('deposit.pdf', pdf);
})();
    

PHP

$pdf = Log::pdf("6742710681600000");

$fp = fopen('deposit.pdf', 'w');
fwrite($fp, $pdf);
fclose($fp);
    

Java

Not yet available. Please contact us if you need this SDK.
    

Ruby

Not yet available. Please contact us if you need this SDK.
    

Elixir

Not yet available. Please contact us if you need this SDK.
    

C#

Not yet available. Please contact us if you need this SDK.
    

Go

Not yet available. Please contact us if you need this SDK.
    

Clojure

Not yet available. Please contact us if you need this SDK.
    

Curl

curl --location --request GET '{{baseUrl}}/v2/deposit/log/6742710681600000/pdf' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}'
    

Boleto

A boleto is a method you can use to charge your customers or load your Stark Bank account. Here we will teach you how to create and manage boletos.

You can also split a Boleto between different receivers, you need to create a Split Receiver, and add the receiver into the Splits array.

Boleto Status

Each boleto has a status that can change over time according to its life cycle: boleto-status

Boleto Log

Every time we make a change to a boleto, we create a log. Logs are pretty useful for understanding the life cycle of each boleto and the changes that happened to it. Here you can see the flow of possible events: boleto-log

The Boleto object

Attributes

id STRING

Unique id for the boleto.

amount INTEGER

Amount in cents to be charged. Example: 100 (R$1.00).

barCode STRING

Boleto bar code.

city STRING

Customer city name.

created STRING

Creation datetime. Example: "2020-04-23T23:00:00.000000+00:00".

descriptions LIST OF OBJECTS

List of description objects.

discounts LIST OF OBJECTS

List of discount objects.

district STRING

Customer district name.

due STRING

Due date of the boleto. Example: "2020-04-23".

fee INTEGER

Fee charged in cents.

fine FLOAT

Percentage charged if paid after due date.

interest FLOAT

Monthly percentage charged if paid after due date.

line STRING

Boleto line number.

name STRING

Customer full name.

ourNumber STRING

Boleto control number (nosso numero).

overdueLimit INTEGER

Number of days after due date until boleto expires.

receiverName STRING

Name of the credit receiver (Sacador Avalista).

receiverTaxId STRING

Tax ID of the credit receiver.

stateCode STRING

Customer state code.

status STRING

Current boleto status. Options: "created", "overdue", "paid", "canceled".

streetLine1 STRING

Customer street address.

streetLine2 STRING

Customer street address complement.

tags LIST OF STRINGS

Tags associated with the boleto.

taxId STRING

Customer CPF or CNPJ.

transactionIds LIST OF STRINGS

Ledger transaction IDs linked to the boleto.

workspaceId STRING

ID of the workspace that created the boleto.

zipCode STRING

Customer zip code.

Create Boletos

This is how you create a new list of boletos. You can create up to 100 boletos per request. In case a boleto is paid after its due date and there is fine or interest, its amount will be updated with the paid amount. The same is valid if the boleto is paid with a discount.

Parameters

amount REQUIRED

A positive integer that represents the amount in cents to be charged. Example: 100 (R$1.00).

city REQUIRED

Customer city name. Example: "São Paulo".

district REQUIRED

Customer district name. Example: "Itaim Bibi".

name REQUIRED

Customer full name. Example: "Anthony Edward Stark".

stateCode REQUIRED

Customer state code. Example: "SP".

streetLine1 REQUIRED

Customer street address. Example: "Av. Faria Lima, 1844".

streetLine2 REQUIRED

Customer street address complement. Example: "CJ 13".

taxId REQUIRED

Customer CPF (11 digits formatted or unformatted) or CNPJ (14 digits formatted or unformatted). Example: 012.345.678-90.

zipCode REQUIRED

Customer zip code. Example: 01500-000.

descriptions OPTIONAL

List of up to 15 descriptions containing information to help the customer understand why he is being charged. You can add text and amount to create a table or you can just add text. When generating PDFs, if the 'booklet' layout is selected, only the text field of the first description will be considered and it will be used to fill the installment cell in the PDF. Example:

[
    {
        "text": "Explaining first part of the value",
        "amount": 20000
    },
    {
        "text": "More text to explaining something to the customer"
    }
]

discounts OPTIONAL

List of up to 2 discounts specifying the discount percentage and the limit date up to when the discount is valid. Example:

[
    {
        "percentage": 5,
        "date": "2020-04-01"
    },
    {
        "percentage": 3.5,
        "date": "2020-04-02"
    }
]

due OPTIONAL

Due date of the boleto. Example: 2020-06-27. The default value is set to two days after creation date.

fine OPTIONAL

Percentage of the boleto amount charged if customer pays after the due date. Default value = 2.00 (2%).

interest OPTIONAL

Monthly interest, in percentage, charged if customer pays after the due date. Default value = 1.00 (1%).

overdueLimit OPTIONAL

Number of days after due date after which the boleto will no longer be payable. 0<=overdueLimit<=59. Default value=59.

receiverName OPTIONAL

Name of the credit receiver (Sacador Avalista). If none is informed, workspace owner name will be used. If informed, receiverTaxId must also be informed.

receiverTaxId OPTIONAL

Tax ID (CPF/CNPJ) of the credit receiver (Sacador Avalista). If none is informed, workspace owner tax ID will be used. If informed, receiverName must also be informed.

splits OPTIONAL

Array of Split objects to indicate payment receivers. Example:

[
    {
        "receiverId": "5742447426535424",
        "amount": 100
    },
    {
        "receiverId": "5743243941642240",
        "amount": 200
    }
]

tags OPTIONAL

Filter entities that contain the specified tags.

ENDPOINT
POST /v2/boleto
REQUEST

Python

import starkbank

boletos = starkbank.boleto.create([
    starkbank.Boleto(
        amount=400000,
        due="2020-05-20",
        name="Iron Bank S.A.",
        tax_id="20.018.183/0001-80",
        fine=2.5,
        interest=1.3,
        overdue_limit=5,
        street_line_1="Av. Faria Lima, 1844",
        street_line_2="CJ 13",
        district="Itaim Bibi",
        city="São Paulo",
        state_code="SP",
        zip_code="01500-000",
        tags=["War supply", "Invoice #1234"],
        discounts=[
            {"percentage": 10, "date": "2020-04-25"}
        ],
        splits=[
            Split(amount=3000, receiverId="5742447426535424"), Split(amount=5000, receiverId="5743243941642240")
        ]
    )
])

for boleto in boletos:
    print(boleto)
  

Javascript

const starkbank = require('starkbank');

(async() => {
    let boletos = await starkbank.boleto.create([
        {
            amount: 400000,
            name: 'Iron Bank S.A.',
            taxId: '20.018.183/0001-80', 
            streetLine1: 'Av. Faria Lima, 1844', 
            streetLine2: 'CJ 13',
            district: 'Itaim Bibi', 
            city: 'São Paulo',
            stateCode: 'SP',
            zipCode: '01500-000',
            due: '2020-05-20',
            fine: 2.5,
            interest: 1.3,
            overdueLimit: 5,
            tags: ['War supply', 'Invoice #1234'],
            discounts: [
                {'percentage': 10, 'date': '2020-04-25'}
            ]
        },
    ]);

    for (let boleto of boletos) {
        console.log(boleto);
    }
})();
  

PHP

$boletos = StarkBank\Boleto::create([
    new StarkBank\Boleto([
        "amount" => 400000,
        "name" => "Iron Bank S.A.",
        "taxId" => "20.018.183/0001-80", 
        "streetLine1" => "Av. Faria Lima, 1844", 
        "streetLine2" => "CJ 13",
        "district" => "Itaim Bibi", 
        "city" => "São Paulo",
        "stateCode" => "SP",
        "zipCode" => "01500-000",
        "due" => "2020-05-20",
        "fine" => 2.5,
        "interest" => 1.3,
        "overdueLimit" => 5,
        "tags" => ["War supply", "Invoice #1234"],
        "discounts" => [
            ["percentage" => 10, "date" => "2020-04-25"]
        ]
    ])
]);

foreach($boletos as $boleto){
    print_r($boleto);
}
  

Java

import com.starkbank.*;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

List<Boleto> boletos = new ArrayList<>();
HashMap<String, Object> data = new HashMap<>();
data.put("amount", 400000);
data.put("name", "Iron Bank S.A.");
data.put("taxId", "20.018.183/0001-80");
data.put("streetLine1", "Av. Faria Lima, 1844");
data.put("streetLine2", "CJ 13");
data.put("district", "Itaim Bibi");
data.put("city", "São Paulo");
data.put("stateCode", "SP");
data.put("zipCode", "01500-000");
data.put("due", "2020-05-20");
data.put("fine", 2.5);
data.put("interest", 1.3);
data.put("overdueLimit", 5);
data.put("tags", new String[]{"War supply", "Invoice #1234"});

List<HashMap<String, Object>> discounts = new ArrayList<>();
discounts.add(new HashMap<>());
discounts.get(0).put("percentage", 5);
discounts.get(0).put("date", "2020-04-25");
data.put("discounts", discounts);

boletos.add(new Boleto(data));

boletos = Boleto.create(boletos);

for (Boleto boleto : boletos){
    System.out.println(boleto);
}
  

Ruby

require('starkbank')

boletos = StarkBank::Boleto.create(
    [
        StarkBank::Boleto.new(
            amount: 400000,
            due: '2020-05-20',
            name: 'Iron Bank S.A.',
            street_line_1: 'Av. Faria Lima, 1844',
            street_line_2: 'CJ 13',
            district: 'Itaim Bibi',
            city: 'São Paulo',
            state_code: 'SP',
            zip_code: '01500-000',
            tax_id: '20.018.183/0001-80',
            overdue_limit: 5,
            fine: 2.5,
            interest: 1.3,
            tags: ['War supply', 'Invoice #1234'],
            discounts: [
                {percentage: 10, date: '2020-04-25'}
            ]
        )
    ]
)

boletos.each do |boleto|
    puts boleto
end
  

Elixir

boletos = StarkBank.Boleto.create!([
    %StarkBank.Boleto{
        amount: 400000,
        due: "2020-05-20",
        name: "Iron Bank S.A.",
        street_line_1: "Av. Faria Lima, 1844",
        street_line_2: "CJ 13",
        district: "Itaim Bibi",
        city: "São Paulo",
        state_code: "SP",
        zip_code: "01500-000",
        tax_id: "20.018.183/0001-80",
        overdue_limit: 5,
        fine: 2.5,
        interest: 1.3,
        tags: ["War supply", "Invoice #1234"],
        discounts: [
            %{percentage: 10, date: "2020-04-25"}
        ]
    }
])

for payment <- payments do
    payment |> IO.inspect
end
  

C#

using System;
using System.Collections.Generic;

List<StarkBank.Boleto> boletos = StarkBank.Boleto.Create(
    new List<StarkBank.Boleto> {
        new StarkBank.Boleto(
            amount: 400000,
            due: new DateTime(2020, 5, 20),
            name: "Iron Bank S.A.",
            streetLine1: "Av. Faria Lima, 1844",
            streetLine2: "CJ 13",
            district: "Itaim Bibi",
            city: "Sao Paulo",
            stateCode: "SP",
            zipCode: "01500-000",
            taxID: "20.018.183/0001-80",
            overdueLimit: 5,
            fine: 2.5,
            interest: 1.3,
            tags: new List<string> { "War supply", "Invoice #1234" },
            discounts: new List<Dictionary<string, object>>() {
                new Dictionary<string, object> {
                    {"percentage", 10},
                    {"date", new DateTime(2020, 4, 25)}
                }
            }
        )
    }
);

foreach(StarkBank.Boleto boleto in boletos)
{
    Console.WriteLine(boleto);
}
  

Go

package main

import (
    "fmt"
    "github.com/starkbank/sdk-go/starkbank/boleto"
)

func main() {

    due := time.Date(2020, 05, 20, 0, 0, 0, 0, time.UTC)

    boletos, err := boleto.Create(
        []boleto.Boleto{
            {
                Amount:       400000,
                Due:          &due,
                Name:         "Iron Bank S.A.",
                TaxId:        "20.018.183/0001-80",
                Fine:         2.5,
                Interest:     1.3,
                OverdueLimit: 5,
                StreetLine1:  "Av. Faria Lima, 1844",
                StreetLine2:  "CJ 13",
                District:     "Itaim Bibi",
                City:         "São Paulo",
                StateCode:    "SP",
                ZipCode:      "01500-000",
                Tags:         []string{"War Supply", "Invoice #1234"},
                Discounts:    []map[string]interface{}{
                    {
                        "percentage": 10,
                        "date": "2020-04-25",
                    },
                },
            }, nil)
    if err.Errors != nil {
        for _, e := range err.Errors {
            fmt.Printf("code: %s, message: %s", e.Code, e.Message)
        }
    }

    for _, boleto := range boletos {
        fmt.Printf("%+v", boleto)
    }
}
  

Clojure

(def boletos (starkbank.boleto/create [{
    :amount 400000
    :due "2020-05-20"
    :name "Iron Bank S.A."
    :street-line-1 "Av. Faria Lima, 1844"
    :street-line-2 "CJ 13"
    :district "Itaim Bibi"
    :city "São Paulo"
    :state-code "SP"
    :zip-code "01500-000"
    :tax-id "20.018.183/0001-80"
    :overdue-limit 5
    :fine 2.5
    :interest 1.3
    :tags ["War supply" "Invoice #1234"]
    :discounts [
        {:percentage 10 :date "2020-04-25"}
    ]
}]))
(dorun (map println boletos))
  

Curl

curl --location --request POST '{{baseUrl}}/v2/boleto' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}' 
--header 'Content-Type: application/json' 
--data-raw '{
    "boletos": [
        {
            "amount": 400000,
            "due": "2020-05-20",
            "name": "Iron Bank S.A.",
            "taxId": "20.018.183/0001-80",
            "fine": 2.5,
            "interest": 1.3,
            "overdueLimit": 5,
            "streetLine1": "Av. Faria Lima, 1844",
            "streetLine2": "CJ 13",
            "district": "Itaim Bibi",
            "city": "São Paulo",
            "stateCode": "SP",
            "zipCode": "01500-000",
            "tags": ["War supply", "Invoice #1234"]
            "discounts": [                 {
                    "percentage": 10,
                    "date": "2020-04-25"
                }
            ],
            "splits": [
                {
                    "receiverId": "5742447426535424",
                    "amount": 3000
                },
                {
                    "receiverId": "5743243941642240",
                    "amount": 5000
                }
            ]
        },
    ]
}'
  
RESPONSE

Python

Boleto(
    id=6655767935451136,
    amount=400000,
    bar_code=34191826100004000001091007175647307144464000,
    city=São Paulo,
    created=2020-04-23 23:36:08.129614,
    descriptions=[],
    discounts=[{'date': '2020-04-26T02:59:59.999999+00:00', 'percentage': 10.0}],
    district=Itaim Bibi,
    due=2020-05-21,
    fee=0,
    fine=2.5,
    interest=1.3,
    line=34191.09107 07175.647309 71444.640008 1 82610000400000,
    name=Iron Bank S.A.,
    our_number=10445145,
    transaction_ids=[],
    overdue_limit=5,
    receiver_name=Winterfell S. A.,
    receiver_tax_id=71.735.814/0001-12,
    state_code=SP,
    status=created,
    street_line_1=Av. Faria Lima, 1844,
    street_line_2=CJ 13,
    tags=['war supply', 'invoice #1234'],
    tax_id=20.018.183/0001-80,
    zip_code=01500-000,
    workspace_id=5083989094170624,
    splits=[
        Split(
            amount=3000,
            created=None,
            external_id=None,
            id=None,
            receiver_id=5742447426535424,
            scheduled=None,
            source=None,
            status=None,
            tags=None,
            updated=None
        ),
        Split(
            amount=5000,
            created=None,
            external_id=None,
            id=None,
            receiver_id=5743243941642240,
            scheduled=None,
            source=None,
            status=None,
            tags=None,
            updated=None
        )
    ]
)
  

Javascript

Boleto {
    id: '6655767935451136',
    amount: 400000,
    name: 'Iron Bank S.A.',
    taxId: '20.018.183/0001-80',
    streetLine1: 'Av. Faria Lima, 1844',
    streetLine2: 'CJ 13',
    district: 'Itaim Bibi',
    city: 'São Paulo',
    stateCode: 'SP',
    zipCode: '01500-000',
    due: '2020-05-21T02:59:59.999999+00:00',
    fine: 2.5,
    interest: 1.3,
    ourNumber: '10445145',
    transactionIds: [],
    overdueLimit: 5,
    receiverName: 'Winterfell S.A.',
    receiverTaxId: '71.735.814/0001-12',
    tags: [ 'war supply', 'invoice #1234' ],
    descriptions: [],
    discounts: [ { date: '2020-04-26T02:59:59.999999+00:00', percentage: 10 } ],
    fee: 0,
    line: '34191.09107 07176.307309 71444.640008 1 82610000400000',
    barCode: '34191826100004000001091007175647307144464000',
    status: 'created',
    created: '2020-04-23T23:36:10.789288+00:00',
    workspaceId: '5083989094170624'
}
  

PHP

StarkBank\Boleto Object
(
    [id] => 6655767935451136
    [amount] => 400000
    [name] => Iron Bank S.A.
    [taxId] => 20.018.183/0001-80
    [streetLine1] => Av. Faria Lima, 1844
    [streetLine2] => CJ 13
    [district] => Itaim Bibi
    [city] => São Paulo
    [stateCode] => SP
    [zipCode] => 01500-000
    [due] => DateTime Object
        (
            [date] => 2020-05-21 02:59:59.999999
            [timezone_type] => 1
            [timezone] => +00:00
        )

    [fine] => 2.5
    [interest] => 1.3
    [ourNumber] => 10445145
    [transactionIds] => Array
        (
        )
    [overdueLimit] => 5
    [receiverName] => Winterfell S.A.
    [receiverTaxId] => 71.735.814/0001-12
    [tags] => Array
        (
            [0] => war supply
            [1] => invoice #1234
        )

    [descriptions] => Array
        (
        )

    [discounts] => Array
        (
            [0] => Array
                (
                    [date] => 2020-04-26T02:59:59.999999+00:00
                    [percentage] => 10
                )

        )

    [fee] => 0
    [line] => 34191.09107 07150.227309 71444.640008 7 82610000400000
    [barCode] => 34197826100004000001091007150227307144464000
    [status] => created
    [created] => DateTime Object
        (
            [date] => 2020-04-22 20:12:56.830070
            [timezone_type] => 1
            [timezone] => +00:00
        )
    [workspaceId] => 5083989094170624

)
  

Java

Boleto({
    "id": "6655767935451136",
    "amount": "400000",
    "name": "Iron Bank S.A.",
    "taxId": "20.018.183/0001-80",
    "streetLine1": "Av. Faria Lima, 1844",
    "streetLine2": "CJ 13",
    "district": "Itaim Bibi",
    "city": "São Paulo",
    "stateCode": "SP",
    "zipCode": "01500-000",
    "due": "2020-04-21T02:59:59.999999+00:00",
    "fine": 2.5,
    "interest": 1.3,
    "ourNumber": "10445145",
    "workspaceId": "5083989094170624",
    "transactionIds": [],
    "overdueLimit": 5,
    "receiverName": "Winterfell S.A.",
    "receiverTaxId": "71.735.814/0001-12",
    "tags": ["war supply", "invoice #1234"],
    "descriptions": [],
    "discounts": [
        {"date": "2020-04-26T02:59:59.999999+00:00", "percentage": 10.0}
    ],
    "fee": 0,
    "line": "34191.09107 07027.987309 71444.640008 5 82310000400000",
    "barCode": "34191826100004000001091007175647307144464000",
    "status": "created",
    "created": "2020-04-23T23:28:13+00:00"
    "workspaceId": "5083989094170624"
})
  

Ruby

boleto(
    id: 6655767935451136,
    amount: 400000,
    name: Iron Bank S.A.,
    tax_id: 20.018.183/0001-80,
    street_line_1: Av. Faria Lima, 1844,
    street_line_2: CJ 13,
    district: Itaim Bibi,
    city: São Paulo,
    state_code: SP,
    zip_code: 01500-000,
    due: 2020-05-21T02:59:59.999999+00:00,
    fine: 2.5,
    interest: 1.3,
    our_number: 10445145,
    transaction_ids: [],
    overdue_limit: 5,
    receiver_name: Winterfell S.A.,
    receiver_tax_id: 71.735.814/0001-12,
    tags: ["war supply", "invoice #1234"],
    descriptions: [],
    discounts: [{"date"=>"2020-04-26T02:59:59.999999+00:00", "percentage"=>10.0}],
    fee: 0,
    line: 34191.09107 07149.917309 71444.640008 1 82610000400000,
    bar_code: 34191826100004000001091007149917307144464000,
    status: created,
    created: 2020-04-23T19:59:25+00:00
    workspace_id: 5083989094170624
)
  

Elixir

%StarkBank.Boleto{
    amount: 400000,
    bar_code: "34191826100004000001091007175647307144464000",
    city: "São Paulo",
    created: ~U[2020-04-23 17:41:58.458035Z],
    descriptions: [],
    discounts: [
        %{"date" => "2020-04-26T02:59:59.999999+00:00", "percentage" => 10.0}
    ],
    district: "Itaim Bibi",
    due: ~U[2020-05-21 02:59:59.999999Z],
    fee: 0,
    fine: 2.5,
    id: "6655767935451136",
    interest: 1.3,
    line: "34191.09107 07156.837309 71444.640008 8 82610000400000",
    name: "Iron Bank S.A.",
    our_number: "10445145",
    transaction_ids: [],
    overdue_limit: 5,
    receiver_name: "Winterfell S.A.",
    receiver_tax_id: "71.735.814/0001-12",
    state_code: "SP",
    status: "created",
    street_line_1: "Av. Faria Lima, 1844",
    street_line_2: "CJ 13",
    tags: ["war supply", "invoice #1234"],
    tax_id: "20.018.183/0001-80",
    zip_code: "01500-000",
    workspace_id: "5083989094170624"
}
  

C#

Boleto(
    Amount: 400000,
    Name: Iron Bank S.A.,
    TaxID: 20.018.183/0001-80,
    StreetLine1: Av. Faria Lima, 1844,
    StreetLine2: CJ 13,
    District: Itaim Bibi,
    City: Sao Paulo,
    StateCode: SP,
    ZipCode: 01500-000,
    Due: 05/21/2020 23:59:59,
    Fine: 2.5,
    Interest: 1.3,
    OverdueLimit: 5,
    OurNumber: 10445145,
    TransactionIds: {  },
    ReceiverName: Wintefell S.A.,
    ReceiverTaxID: 71.735.814/0001-12,
    Tags: { war supply, invoice #1234 },
    Descriptions: {  },
    Discounts: { { { date, 2020-04-26T02:59:59.999999+00:00 }, { percentage, 10 } } },
    Fee: 0,
    Line: 34191.09107 07159.647309 71444.640008 1 82610000400000,
    BarCode: 34191826100004000001091007159647307144464000,
    Status: created,
    Created: 04/23/2020 15:53:22,
    WorkspaceId: 5083989094170624
    ID: 6655767935451136
)
  

Go

{
    Id:6655767935451136 
    Amount:400000 
    Name:Iron Bank S.A. 
    TaxId:20.018.183/0001-80 
    StreetLine1:Av. Faria Lima, 1844 
    StreetLine2:CJ 13 
    District:Itaim Bibi 
    City:São Paulo 
    StateCode:SP 
    ZipCode:01500-000 
    Due:2020-05-21 02:59:59.999999 +0000 +0000 
    Fine:2.5
    Interest:1.3 
    OverdueLimit:5
    Descriptions:[] 
    Discounts:[map[date:2020-04-26T02:59:59.999999+00:00 percentage:10]]
    Tags:[war supply invoice #1234] 
    ReceiverName:Winterfell S.A.
    ReceiverTaxId:71.735.814/0001-12
    Fee:0 
    Line:34191.09107 44555.427309 71444.640008 4 92570000400000 
    BarCode:34191826100004000001091007175647307144464000 
    Status:created 
    TransactionIds:[] 
    WorkspaceId:5083989094170624
    Created:2020-04-23 03:18:33.515597 +0000 +0000 
    OurNumber:10445554
}
  

Clojure

{:amount 400000,
 :fee 0,
 :tags ["war supply" "invoice #1234"],
 :street-line-1 "Av. Faria Lima, 1844",
 :name "Iron Bank S.A.",
 :state-code "SP",
 :city "São Paulo",
 :tax-id "20.018.183/0001-80",
 :our-number "10445145",
 :transaction-ids [],
 :overdue-limit 5,
 :receiver-name "Winterfell S.A."
 :receiver-tax-id "71.735.814/0001-12"
 :created "2020-04-23T19:14:43.125462+00:00",
 :discounts
 [{:date "2020-04-26T02:59:59.999999+00:00", :percentage 10.0}],
 :due "2020-05-21T02:59:59.999999+00:00",
 :street-line-2 "CJ 13",
 :line "34191.09107 07322.097309 71444.640008 1 82610000400000",
 :status "created",
 :interest 1.3,
 :id "6655767935451136",
 :fine 2.5,
 :zip-code "01500-000",
 :bar-code "34191826100004000001091007322097307144464000",
 :descriptions [],
 :district "Itaim Bibi"}
  

Curl

{
    "message": "Boleto(s) successfully created",
    "boletos": [
        {
            "id": "6655767935451136",
            "status": "created",
            "line": "34191.09107 07175.647309 71444.640008 1 82610000400000",
            "barCode": "34191826100004000001091007175647307144464000",
            "amount": 400000,
            "due": "2020-05-21T02:59:59.999999+00:00",
            "name": "Iron Bank S.A.",
            "taxId": "20.018.183/0001-80",
            "fine": 2.5,
            "interest": 1.3,
            "ourNumber": "10445145",
            "transactionIds": [],
            "overdueLimit": 5,
            "receiverName": "Winterfell S.A.",
            "receiverTaxId": "71.735.814/0001-12",
            "streetLine1": "Av. Faria Lima, 1844",
            "streetLine2": "CJ 13",
            "district": "Itaim Bibi",
            "city": "São Paulo",
            "stateCode": "SP",
            "zipCode": "01500-000",
            "tags": ["War supply", "Invoice #1234"],
            "workspaceId": "5083989094170624",
            "fee": 0,
            "descriptions": [],
            "discounts": [
                {
                    "percentage": 10, 
                    "date": "2020-04-25"
                }
            ],
            "workspaceId": "5083989094170624"
        },
        "splits": [
            {
                "amount": 3000,
                "receiverId": "5742447426535424",
            ),
            {
                "amount": 5000,
                "receiverId": "5743243941642240",
            }
        ]
    ]
}
  

List Boletos

Get a list of non-deleted boletos in chunks of at most 100. If you need smaller chunks, use the limit parameter.

Parameters

after OPTIONAL

Filter entities created after this date.

before OPTIONAL

Filter entities created before this date.

cursor OPTIONAL

String used to get the next batch of results. Our SDKs handle this for you.

fields OPTIONAL

List of strings to filter response JSON keys. Not available in the SDKs.

ids OPTIONAL

List of strings to get specific entities by ids.

limit OPTIONAL

Number of results per cursor. Max = 100.

status OPTIONAL

Filter boletos by the specified status.

tags OPTIONAL

Filter entities that contain the specified tags.

ENDPOINT
GET /v2/boleto
REQUEST

Python

import starkbank

boletos = starkbank.boleto.query(
    after="2020-04-01",
    before="2020-04-30"
)

for boleto in boletos:
    print(boleto)
  

Javascript

const starkbank = require('starkbank');

(async() => {
    let boletos = await starkbank.boleto.query({
        after: '2020-04-01',
        before: '2020-04-30',
    });

    for await (let boleto of boletos) {
        console.log(boleto);
    }
})();
  

PHP

$boletos = StarkBank\Boleto::query([
    "after" => "2020-04-01",
    "before" => "2020-04-30"
]);

foreach($boletos as $boleto){
    print_r($boleto);
}
  

Java

import com.starkbank.*;
import com.starkbank.utils.Generator;
import java.util.HashMap;

HashMap<String, Object> params = new HashMap<>();
params.put("after", "2020-04-01");
params.put("before", "2020-04-30");
Generator<Boleto> boletos = Boleto.query(params);

for (Boleto boleto : boletos){
    System.out.println(boleto);
}
  

Ruby

require('starkbank')

boletos = StarkBank::Boleto.query(
    after: '2020-04-01',
    before: '2020-04-30'
)

boletos.each do |boleto|
    puts boleto
end
  

Elixir

boletos = StarkBank.Boleto.query!(
    after: "2019-04-01",
    before: "2020-04-30"
)

for payment <- payments do
    payment |> IO.inspect
end
  

C#

using System;
using System.Collections.Generic;

IEnumerable<StarkBank.Boleto> boletos = StarkBank.Boleto.Query(
    after: new DateTime(2020, 4, 1),
    before: new DateTime(2020, 4, 30)
);

foreach(StarkBank.Boleto boleto in boletos)
{
    Console.WriteLine(boleto);
}
  

Go

package main

import (
    "fmt"
    "time"
    "github.com/starkbank/sdk-go/starkbank/boleto"
)

func main() {

    var params = map[string]interface{}{}
    params["after"] = time.Date(2020, 4, 1, 0, 0, 0, 0, time.UTC)
    params["before"] = time.Date(2020, 4, 30, 0, 0, 0, 0, time.UTC)
    
    boletos, errorChannel := boleto.Query(params, nil)

    loop:
    for {
        select {
        case err := <-errorChannel:
            if err.Errors != nil {
                for _, e := range err.Errors {
                    fmt.Printf("code: %s, message: %s", e.Code, e.Message)
                }
            }
        case boleto, ok := <-boletos:
            if !ok {
                break loop
            }
            fmt.Printf("%+v", boleto)
        }
    }
}
  

Clojure

(def boletos
  (starkbank.boleto/query
    {
      :after "2020-4-1",
      :before "2020-4-30"
    }))
(dorun (map println boletos))
  

Curl

curl --location --request GET '{{baseUrl}}/v2/boleto?after=2020-04-01&before=2020-04-30' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}'
  
RESPONSE

Python

Boleto(
    id=6655767935451136,
    amount=400000,
    bar_code=34191826100004000001091007175647307144464000,
    city=São Paulo,
    created=2020-04-23 23:36:08.129614,
    descriptions=[],
    discounts=[{'date': '2020-04-26T02:59:59.999999+00:00', 'percentage': 10.0}],
    district=Itaim Bibi,
    due=2020-05-21,
    fee=0,
    fine=2.5,
    interest=1.3,
    line=34191.09107 07175.647309 71444.640008 1 82610000400000,
    name=Iron Bank S.A.,
    our_number=10445145,
    transaction_ids=[],
    overdue_limit=5,
    receiver_name=Winterfell S. A.,
    receiver_tax_id=71.735.814/0001-12,
    state_code=SP,
    status=created,
    street_line_1=Av. Faria Lima, 1844,
    street_line_2=CJ 13,
    tags=['war supply', 'invoice #1234'],
    tax_id=20.018.183/0001-80,
    zip_code=01500-000
    workspace_id=5083989094170624
)
  

Javascript

Boleto {
    id: '6655767935451136',
    amount: 400000,
    name: 'Iron Bank S.A.',
    taxId: '20.018.183/0001-80',
    streetLine1: 'Av. Faria Lima, 1844',
    streetLine2: 'CJ 13',
    district: 'Itaim Bibi',
    city: 'São Paulo',
    stateCode: 'SP',
    zipCode: '01500-000',
    due: '2020-05-21T02:59:59.999999+00:00',
    fine: 2.5,
    interest: 1.3,
    ourNumber: '10445145',
    transactionIds: [],
    overdueLimit: 5,
    receiverName: 'Winterfell S.A.',
    receiverTaxId: '71.735.814/0001-12',
    tags: [ 'war supply', 'invoice #1234' ],
    descriptions: [],
    discounts: [ { date: '2020-04-26T02:59:59.999999+00:00', percentage: 10 } ],
    fee: 0,
    line: '34191.09107 07176.307309 71444.640008 1 82610000400000',
    barCode: '34191826100004000001091007175647307144464000',
    status: 'created',
    created: '2020-04-23T23:36:10.789288+00:00',
    workspaceId: '5083989094170624'
}
  

PHP

StarkBank\Boleto Object
(
    [id] => 6655767935451136
    [amount] => 400000
    [name] => Iron Bank S.A.
    [taxId] => 20.018.183/0001-80
    [streetLine1] => Av. Faria Lima, 1844
    [streetLine2] => CJ 13
    [district] => Itaim Bibi
    [city] => São Paulo
    [stateCode] => SP
    [zipCode] => 01500-000
    [due] => DateTime Object
        (
            [date] => 2020-05-21 02:59:59.999999
            [timezone_type] => 1
            [timezone] => +00:00
        )

    [fine] => 2.5
    [interest] => 1.3
    [ourNumber] => 10445145
    [transactionIds] => Array
        (
        )
    [overdueLimit] => 5
    [receiverName] => Winterfell S.A.
    [receiverTaxId] => 71.735.814/0001-12
    [tags] => Array
        (
            [0] => war supply
            [1] => invoice #1234
        )

    [descriptions] => Array
        (
        )

    [discounts] => Array
        (
            [0] => Array
                (
                    [date] => 2020-04-26T02:59:59.999999+00:00
                    [percentage] => 10
                )

        )

    [fee] => 0
    [line] => 34191.09107 07150.227309 71444.640008 7 82610000400000
    [barCode] => 34197826100004000001091007150227307144464000
    [status] => created
    [created] => DateTime Object
        (
            [date] => 2020-04-22 20:12:56.830070
            [timezone_type] => 1
            [timezone] => +00:00
        )
    [workspaceId] => 5083989094170624
)
  

Java

Boleto({
    "id": "6655767935451136",
    "amount": "400000",
    "name": "Iron Bank S.A.",
    "taxId": "20.018.183/0001-80",
    "streetLine1": "Av. Faria Lima, 1844",
    "streetLine2": "CJ 13",
    "district": "Itaim Bibi",
    "city": "São Paulo",
    "stateCode": "SP",
    "zipCode": "01500-000",
    "due": "2020-04-21T02:59:59.999999+00:00",
    "fine": 2.5,
    "interest": 1.3,
    "ourNumber": "10445145",
    "workspaceId": "5083989094170624",
    "transactionIds": [],
    "overdueLimit": 5,
    "receiverName": "Winterfell S.A.",
    "receiverTaxId": "71.735.814/0001-12",
    "tags": ["war supply", "invoice #1234"],
    "descriptions": [],
    "discounts": [
        {"date": "2020-04-26T02:59:59.999999+00:00", "percentage": 10.0}
    ],
    "fee": 0,
    "line": "34191.09107 07027.987309 71444.640008 5 82310000400000",
    "barCode": "34191826100004000001091007175647307144464000",
    "status": "created",
    "created": "2020-04-23T23:28:13+00:00"
    "workspaceId": "5083989094170624"
})
  

Ruby

boleto(
    id: 6655767935451136,
    amount: 400000,
    name: Iron Bank S.A.,
    tax_id: 20.018.183/0001-80,
    street_line_1: Av. Faria Lima, 1844,
    street_line_2: CJ 13,
    district: Itaim Bibi,
    city: São Paulo,
    state_code: SP,
    zip_code: 01500-000,
    due: 2020-05-21T02:59:59.999999+00:00,
    fine: 2.5,
    interest: 1.3,
    our_number: 10445145,
    transaction_ids: [],
    overdue_limit: 5,
    receiver_name: Winterfell S.A.,
    receiver_tax_id: 71.735.814/0001-12,
    tags: ["war supply", "invoice #1234"],
    descriptions: [],
    discounts: [{"date"=>"2020-04-26T02:59:59.999999+00:00", "percentage"=>10.0}],
    fee: 0,
    line: 34191.09107 07149.917309 71444.640008 1 82610000400000,
    bar_code: 34191826100004000001091007149917307144464000,
    status: created,
    created: 2020-04-23T19:59:25+00:00
    workspace_id: 5083989094170624
)
  

Elixir

%StarkBank.Boleto{
    amount: 400000,
    bar_code: "34191826100004000001091007175647307144464000",
    city: "São Paulo",
    created: ~U[2020-04-23 17:41:58.458035Z],
    descriptions: [],
    discounts: [
        %{"date" => "2020-04-26T02:59:59.999999+00:00", "percentage" => 10.0}
    ],
    district: "Itaim Bibi",
    due: ~U[2020-05-21 02:59:59.999999Z],
    fee: 0,
    fine: 2.5,
    id: "6655767935451136",
    interest: 1.3,
    line: "34191.09107 07156.837309 71444.640008 8 82610000400000",
    name: "Iron Bank S.A.",
    our_number: "10445145",
    transaction_ids: [],
    overdue_limit: 5,
    receiver_name: "Winterfell S.A.",
    receiver_tax_id: "71.735.814/0001-12",
    state_code: "SP",
    status: "created",
    street_line_1: "Av. Faria Lima, 1844",
    street_line_2: "CJ 13",
    tags: ["war supply", "invoice #1234"],
    tax_id: "20.018.183/0001-80",
    zip_code: "01500-000",
    workspace_id: "5083989094170624"
}
  

C#

Boleto(
    Amount: 400000,
    Name: Iron Bank S.A.,
    TaxID: 20.018.183/0001-80,
    StreetLine1: Av. Faria Lima, 1844,
    StreetLine2: CJ 13,
    District: Itaim Bibi,
    City: Sao Paulo,
    StateCode: SP,
    ZipCode: 01500-000,
    Due: 05/21/2020 23:59:59,
    Fine: 2.5,
    Interest: 1.3,
    OverdueLimit: 5,
    OurNumber: 10445145,
    TransactionIds: {  },
    ReceiverName: Wintefell S.A.,
    ReceiverTaxID: 71.735.814/0001-12,
    Tags: { war supply, invoice #1234 },
    Descriptions: {  },
    Discounts: { { { date, 2020-04-26T02:59:59.999999+00:00 }, { percentage, 10 } } },
    Fee: 0,
    Line: 34191.09107 07159.647309 71444.640008 1 82610000400000,
    BarCode: 34191826100004000001091007159647307144464000,
    Status: created,
    Created: 04/23/2020 15:53:22,
    WorkspaceId: 5083989094170624
    ID: 6655767935451136
)
  

Go

{
    Id:6655767935451136 
    Amount:400000 
    Name:Iron Bank S.A. 
    TaxId:20.018.183/0001-80 
    StreetLine1:Av. Faria Lima, 1844 
    StreetLine2:CJ 13 
    District:Itaim Bibi 
    City:São Paulo 
    StateCode:SP 
    ZipCode:01500-000 
    Due:2020-05-21 02:59:59.999999 +0000 +0000 
    Fine:2.5
    Interest:1.3 
    OverdueLimit:5
    Descriptions:[] 
    Discounts:[map[date:2020-04-26T02:59:59.999999+00:00 percentage:10]]
    Tags:[war supply invoice #1234] 
    ReceiverName:Winterfell S.A.
    ReceiverTaxId:71.735.814/0001-12
    Fee:0 
    Line:34191.09107 44555.427309 71444.640008 4 92570000400000 
    BarCode:34191826100004000001091007175647307144464000 
    Status:created 
    TransactionIds:[] 
    WorkspaceId:5083989094170624
    Created:2020-04-23 03:18:33.515597 +0000 +0000 
    OurNumber:10445554
}
  

Clojure

{:amount 400000,
 :fee 0,
 :tags ["war supply" "invoice #1234"],
 :street-line-1 "Av. Faria Lima, 1844",
 :name "Iron Bank S.A.",
 :state-code "SP",
 :city "São Paulo",
 :tax-id "20.018.183/0001-80",
 :our-number "10445145",
 :transaction-ids [],
 :overdue-limit 5,
 :receiver-name "Winterfell S.A."
 :receiver-tax-id "71.735.814/0001-12"
 :created "2020-04-23T19:14:43.125462+00:00",
 :discounts
 [{:date "2020-04-26T02:59:59.999999+00:00", :percentage 10.0}],
 :due "2020-05-21T02:59:59.999999+00:00",
 :street-line-2 "CJ 13",
 :line "34191.09107 07322.097309 71444.640008 1 82610000400000",
 :status "created",
 :interest 1.3,
 :id "6655767935451136",
 :fine 2.5,
 :zip-code "01500-000",
 :bar-code "34191826100004000001091007322097307144464000",
 :descriptions [],
 :district "Itaim Bibi"}
  

Curl

{
    "cursor": null,
    "boletos": [
        {
            "id": "6655767935451136",
            "status": "created",
            "line": "34191.09107 07175.647309 71444.640008 1 82610000400000",
            "barCode": "34191826100004000001091007175647307144464000",
            "amount": 400000,
            "due": "2020-05-21T02:59:59.999999+00:00",
            "name": "Iron Bank S.A.",
            "taxId": "20.018.183/0001-80",
            "fine": 2.5,
            "interest": 1.3,
            "ourNumber": "10445145",
            "transactionIds": [],
            "overdueLimit": 5,
            "receiverName": "Winterfell S.A.",
            "receiverTaxId": "71.735.814/0001-12",
            "streetLine1": "Av. Faria Lima, 1844",
            "streetLine2": "CJ 13",
            "district": "Itaim Bibi",
            "city": "São Paulo",
            "stateCode": "SP",
            "zipCode": "01500-000",
            "tags": ["War supply", "Invoice #1234"],
            "workspaceId": "5083989094170624",
            "fee": 0,
            "descriptions": [],
            "discounts": [
                {
                    "percentage": 10,
                    "date": "2020-04-25"
                }
            ],
            "workspaceId": "5083989094170624"
        }
    ]
}
  

Get a Boleto

Get a single boleto by its id.

Parameters

id REQUIRED

Id of the boleto entity.

fields OPTIONAL

List of strings to filter response JSON keys. Not available in the SDKs.

ENDPOINT
GET /v2/boleto/:id
REQUEST

Python

import starkbank

boleto = starkbank.boleto.get("6655767935451136")

print(boleto)
  

Javascript

const starkbank = require('starkbank');

(async() => {
    let boleto = await starkbank.boleto.get('6655767935451136')
    console.log(boleto);
})();
  

PHP

$boleto = StarkBank\Boleto::get("6655767935451136");

print_r($boleto);
  

Java

import com.starkbank.*;

Boleto boleto = Boleto.get("6655767935451136");

System.out.println(boleto);
  

Ruby

require('starkbank')

boleto = StarkBank::Boleto.get('6655767935451136')

puts boleto
  

Elixir

boleto = StarkBank.Boleto.get!("6655767935451136")

boleto |> IO.inspect
  

C#

using System;

StarkBank.Boleto boleto = StarkBank.Boleto.Get("6655767935451136");

Console.WriteLine(boleto);
  

Go

package main

import (
    "fmt"
    "github.com/starkbank/sdk-go/starkbank/boleto"
)

func main() {

    boleto, err := boleto.Get("6655767935451136", nil)
    if err.Errors != nil {
        for _, e := range err.Errors {
            fmt.Printf("code: %s, message: %s", e.Code, e.Message)
        }
    }

    fmt.Printf("%+v", boleto)
}
  

Clojure

(def log (starkbank.boleto.log/get "6655767935451136"))
(println log)
  

Curl

curl --location --request GET '{{baseUrl}}/v2/boleto/6655767935451136' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}'
  
RESPONSE

Python

Boleto(
    id=6655767935451136,
    amount=400000,
    bar_code=34191826100004000001091007175647307144464000,
    city=São Paulo,
    created=2020-04-23 23:36:08.129614,
    descriptions=[],
    discounts=[{'date': '2020-04-26T02:59:59.999999+00:00', 'percentage': 10.0}],
    district=Itaim Bibi,
    due=2020-05-21,
    fee=0,
    fine=2.5,
    interest=1.3,
    line=34191.09107 07175.647309 71444.640008 1 82610000400000,
    name=Iron Bank S.A.,
    our_number=10445145,
    transaction_ids=[],
    overdue_limit=5,
    receiver_name=Winterfell S. A.,
    receiver_tax_id=71.735.814/0001-12,
    state_code=SP,
    status=created,
    street_line_1=Av. Faria Lima, 1844,
    street_line_2=CJ 13,
    tags=['war supply', 'invoice #1234'],
    tax_id=20.018.183/0001-80,
    zip_code=01500-000,
    workspace_id=5083989094170624
)
  

Javascript

Boleto {
    id: '6655767935451136',
    amount: 400000,
    name: 'Iron Bank S.A.',
    taxId: '20.018.183/0001-80',
    streetLine1: 'Av. Faria Lima, 1844',
    streetLine2: 'CJ 13',
    district: 'Itaim Bibi',
    city: 'São Paulo',
    stateCode: 'SP',
    zipCode: '01500-000',
    due: '2020-05-21T02:59:59.999999+00:00',
    fine: 2.5,
    interest: 1.3,
    ourNumber: '10445145',
    transactionIds: [],
    overdueLimit: 5,
    receiverName: 'Winterfell S.A.',
    receiverTaxId: '71.735.814/0001-12',
    tags: [ 'war supply', 'invoice #1234' ],
    descriptions: [],
    discounts: [ { date: '2020-04-26T02:59:59.999999+00:00', percentage: 10 } ],
    fee: 0,
    line: '34191.09107 07176.307309 71444.640008 1 82610000400000',
    barCode: '34191826100004000001091007175647307144464000',
    status: 'created',
    created: '2020-04-23T23:36:10.789288+00:00',
    workspaceId: '5083989094170624'
}
  

PHP

StarkBank\Boleto Object
(
    [id] => 6655767935451136
    [amount] => 400000
    [name] => Iron Bank S.A.
    [taxId] => 20.018.183/0001-80
    [streetLine1] => Av. Faria Lima, 1844
    [streetLine2] => CJ 13
    [district] => Itaim Bibi
    [city] => São Paulo
    [stateCode] => SP
    [zipCode] => 01500-000
    [due] => DateTime Object
        (
            [date] => 2020-05-21 02:59:59.999999
            [timezone_type] => 1
            [timezone] => +00:00
        )

    [fine] => 2.5
    [interest] => 1.3
    [ourNumber] => 10445145
    [transactionIds] => Array
        (
        )
    [overdueLimit] => 5
    [receiverName] => Winterfell S.A.
    [receiverTaxId] => 71.735.814/0001-12
    [tags] => Array
        (
            [0] => war supply
            [1] => invoice #1234
        )

    [descriptions] => Array
        (
        )

    [discounts] => Array
        (
            [0] => Array
                (
                    [date] => 2020-04-26T02:59:59.999999+00:00
                    [percentage] => 10
                )

        )

    [fee] => 0
    [line] => 34191.09107 07150.227309 71444.640008 7 82610000400000
    [barCode] => 34197826100004000001091007150227307144464000
    [status] => created
    [created] => DateTime Object
        (
            [date] => 2020-04-22 20:12:56.830070
            [timezone_type] => 1
            [timezone] => +00:00
        )
    [workspaceId] => 5083989094170624

)
  

Java

Boleto({
    "id": "6655767935451136",
    "amount": "400000",
    "name": "Iron Bank S.A.",
    "taxId": "20.018.183/0001-80",
    "streetLine1": "Av. Faria Lima, 1844",
    "streetLine2": "CJ 13",
    "district": "Itaim Bibi",
    "city": "São Paulo",
    "stateCode": "SP",
    "zipCode": "01500-000",
    "due": "2020-04-21T02:59:59.999999+00:00",
    "fine": 2.5,
    "interest": 1.3,
    "ourNumber": "10445145",
    "workspaceId": "5083989094170624",
    "transactionIds": [],
    "overdueLimit": 5,
    "receiverName": "Winterfell S.A.",
    "receiverTaxId": "71.735.814/0001-12",
    "tags": ["war supply", "invoice #1234"],
    "descriptions": [],
    "discounts": [
        {"date": "2020-04-26T02:59:59.999999+00:00", "percentage": 10.0}
    ],
    "fee": 0,
    "line": "34191.09107 07027.987309 71444.640008 5 82310000400000",
    "barCode": "34191826100004000001091007175647307144464000",
    "status": "created",
    "created": "2020-04-23T23:28:13+00:00"
    "workspaceId": "5083989094170624"
})
  

Ruby

boleto(
    id: 6655767935451136,
    amount: 400000,
    name: Iron Bank S.A.,
    tax_id: 20.018.183/0001-80,
    street_line_1: Av. Faria Lima, 1844,
    street_line_2: CJ 13,
    district: Itaim Bibi,
    city: São Paulo,
    state_code: SP,
    zip_code: 01500-000,
    due: 2020-05-21T02:59:59.999999+00:00,
    fine: 2.5,
    interest: 1.3,
    our_number: 10445145,
    transaction_ids: [],
    overdue_limit: 5,
    receiver_name: Winterfell S.A.,
    receiver_tax_id: 71.735.814/0001-12,
    tags: ["war supply", "invoice #1234"],
    descriptions: [],
    discounts: [{"date"=>"2020-04-26T02:59:59.999999+00:00", "percentage"=>10.0}],
    fee: 0,
    line: 34191.09107 07149.917309 71444.640008 1 82610000400000,
    bar_code: 34191826100004000001091007149917307144464000,
    status: created,
    created: 2020-04-23T19:59:25+00:00
    workspace_id: 5083989094170624
)
  

Elixir

%StarkBank.Boleto{
    amount: 400000,
    bar_code: "34191826100004000001091007175647307144464000",
    city: "São Paulo",
    created: ~U[2020-04-23 17:41:58.458035Z],
    descriptions: [],
    discounts: [
        %{"date" => "2020-04-26T02:59:59.999999+00:00", "percentage" => 10.0}
    ],
    district: "Itaim Bibi",
    due: ~U[2020-05-21 02:59:59.999999Z],
    fee: 0,
    fine: 2.5,
    id: "6655767935451136",
    interest: 1.3,
    line: "34191.09107 07156.837309 71444.640008 8 82610000400000",
    name: "Iron Bank S.A.",
    our_number: "10445145",
    transaction_ids: [],
    overdue_limit: 5,
    receiver_name: "Winterfell S.A.",
    receiver_tax_id: "71.735.814/0001-12",
    state_code: "SP",
    status: "created",
    street_line_1: "Av. Faria Lima, 1844",
    street_line_2: "CJ 13",
    tags: ["war supply", "invoice #1234"],
    tax_id: "20.018.183/0001-80",
    zip_code: "01500-000",
    workspace_id: "5083989094170624"
}
  

C#

Boleto(
    Amount: 400000,
    Name: Iron Bank S.A.,
    TaxID: 20.018.183/0001-80,
    StreetLine1: Av. Faria Lima, 1844,
    StreetLine2: CJ 13,
    District: Itaim Bibi,
    City: Sao Paulo,
    StateCode: SP,
    ZipCode: 01500-000,
    Due: 05/21/2020 23:59:59,
    Fine: 2.5,
    Interest: 1.3,
    OverdueLimit: 5,
    OurNumber: 10445145,
    TransactionIds: {  },
    ReceiverName: Wintefell S.A.,
    ReceiverTaxID: 71.735.814/0001-12,
    Tags: { war supply, invoice #1234 },
    Descriptions: {  },
    Discounts: { { { date, 2020-04-26T02:59:59.999999+00:00 }, { percentage, 10 } } },
    Fee: 0,
    Line: 34191.09107 07159.647309 71444.640008 1 82610000400000,
    BarCode: 34191826100004000001091007159647307144464000,
    Status: created,
    Created: 04/23/2020 15:53:22,
    WorkspaceId: 5083989094170624,
    ID: 6655767935451136
)
  

Go

{
    Id:6655767935451136 
    Amount:400000 
    Name:Iron Bank S.A. 
    TaxId:20.018.183/0001-80 
    StreetLine1:Av. Faria Lima, 1844 
    StreetLine2:CJ 13 
    District:Itaim Bibi 
    City:São Paulo 
    StateCode:SP 
    ZipCode:01500-000 
    Due:2020-05-21 02:59:59.999999 +0000 +0000 
    Fine:2.5
    Interest:1.3 
    OverdueLimit:5
    Descriptions:[] 
    Discounts:[map[date:2020-04-26T02:59:59.999999+00:00 percentage:10]]
    Tags:[war supply invoice #1234] 
    ReceiverName:Winterfell S.A.
    ReceiverTaxId:71.735.814/0001-12
    Fee:0 
    Line:34191.09107 44555.427309 71444.640008 4 92570000400000 
    BarCode:34191826100004000001091007175647307144464000 
    Status:created 
    TransactionIds:[] 
    WorkspaceId:5083989094170624
    Created:2020-04-23 03:18:33.515597 +0000 +0000 
    OurNumber:10445554
}
  

Clojure

{:amount 400000,
 :fee 0,
 :tags ["war supply" "invoice #1234"],
 :street-line-1 "Av. Faria Lima, 1844",
 :name "Iron Bank S.A.",
 :state-code "SP",
 :city "São Paulo",
 :tax-id "20.018.183/0001-80",
 :our-number "10445145",
 :transaction-ids [],
 :overdue-limit 5,
 :receiver-name "Winterfell S.A."
 :receiver-tax-id "71.735.814/0001-12"
 :created "2020-04-23T19:14:43.125462+00:00",
 :discounts
 [{:date "2020-04-26T02:59:59.999999+00:00", :percentage 10.0}],
 :due "2020-05-21T02:59:59.999999+00:00",
 :street-line-2 "CJ 13",
 :line "34191.09107 07322.097309 71444.640008 1 82610000400000",
 :status "created",
 :interest 1.3,
 :id "6655767935451136",
 :fine 2.5,
 :zip-code "01500-000",
 :bar-code "34191826100004000001091007322097307144464000",
 :descriptions [],
 :district "Itaim Bibi"}
  

Curl

{
    "boleto": {
        "id": "6655767935451136",
        "status": "created",
        "line": "34191.09107 07175.647309 71444.640008 1 82610000400000",
        "barCode": "34191826100004000001091007175647307144464000",
        "amount": 400000,
        "due": "2020-05-21T02:59:59.999999+00:00",
        "name": "Iron Bank S.A.",
        "taxId": "20.018.183/0001-80",
        "fine": 2.5,
        "interest": 1.3,
        "ourNumber": "10445145",
        "transactionIds": [],
        "overdueLimit": 5,
        "receiverName": "Winterfell S.A.",
        "receiverTaxId": "71.735.814/0001-12",
        "streetLine1": "Av. Faria Lima, 1844",
        "streetLine2": "CJ 13",
        "district": "Itaim Bibi",
        "city": "São Paulo",
        "stateCode": "SP",
        "zipCode": "01500-000",
        "tags": ["War supply", "Invoice #1234"],
        "workspaceId": "5083989094170624",
        "fee": 0,
        "descriptions": [],
        "discounts": [
            {
                "percentage": 10, 
                "date": "2020-04-25"
            }
        ],
        "workspaceId": "5083989094170624"
    }
}
  

Delete a Boleto

Delete a single boleto. We will send a request to CIP to cancel the boleto registration. After the boleto registration is canceled, it won't be possible to pay it anymore.

NOTE: This action cannot be undone.

Parameters

id REQUIRED

Id of the boleto entity.

ENDPOINT
DELETE /v2/boleto/:id
REQUEST

Python

import starkbank

boleto = starkbank.boleto.delete("6655767935451136")

print(boleto)
  

Javascript

const starkbank = require('starkbank');

(async() => {
    let boleto = await starkbank.boleto.delete('6655767935451136');
    console.log(boleto);
})();
  

PHP

$boleto = StarkBank\Boleto::delete("6655767935451136");

print_r($boleto);
  

Java

import com.starkbank.*;

Boleto boleto = Boleto.delete("6655767935451136");

System.out.println(boleto);
  

Ruby

require('starkbank')

boleto = StarkBank::Boleto.delete('6655767935451136')

puts boleto
  

Elixir

boleto = StarkBank.Boleto.delete!("6655767935451136")

boleto |> IO.inspect
  

C#

using System;

StarkBank.Boleto boleto = StarkBank.Boleto.Delete("6655767935451136");

Console.WriteLine(boleto);
  

Go

package main

import (
    "fmt"
    "github.com/starkbank/sdk-go/starkbank/boleto"
)

func main() {

    boleto, err := boleto.Delete("6655767935451136", nil)
    if err.Errors != nil {
        for _, e := range err.Errors {
            fmt.Printf("code: %s, message: %s", e.Code, e.Message)
        }
    }

    fmt.Printf("%+v", boleto)
}
  

Clojure

(def boleto (starkbank.boleto/delete "6655767935451136"))
(println boleto)
  

Curl

curl --location --request DELETE '{{baseUrl}}/v2/boleto/6655767935451136' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}'
  
RESPONSE

Python

Boleto(
    id=6655767935451136,
    amount=400000,
    bar_code=34191826100004000001091007175647307144464000,
    city=São Paulo,
    created=2020-04-23 23:36:08.129614,
    descriptions=[],
    discounts=[{'date': '2020-04-26T02:59:59.999999+00:00', 'percentage': 10.0}],
    district=Itaim Bibi,
    due=2020-05-21,
    fee=0,
    fine=2.5,
    interest=1.3,
    line=34191.09107 07175.647309 71444.640008 1 82610000400000,
    name=Iron Bank S.A.,
    our_number=10445145,
    transaction_ids=[],
    overdue_limit=5,
    receiver_name=Winterfell S. A.,
    receiver_tax_id=71.735.814/0001-12,
    state_code=SP,
    status=created,
    street_line_1=Av. Faria Lima, 1844,
    street_line_2=CJ 13,
    tags=['war supply', 'invoice #1234'],
    tax_id=20.018.183/0001-80,
    zip_code=01500-000,
    workspace_id=5083989094170624
)
  

Javascript

Boleto {
    id: '6655767935451136',
    amount: 400000,
    name: 'Iron Bank S.A.',
    taxId: '20.018.183/0001-80',
    streetLine1: 'Av. Faria Lima, 1844',
    streetLine2: 'CJ 13',
    district: 'Itaim Bibi',
    city: 'São Paulo',
    stateCode: 'SP',
    zipCode: '01500-000',
    due: '2020-05-21T02:59:59.999999+00:00',
    fine: 2.5,
    interest: 1.3,
    ourNumber: '10445145',
    transactionIds: [],
    overdueLimit: 5,
    receiverName: 'Winterfell S.A.',
    receiverTaxId: '71.735.814/0001-12',
    tags: [ 'war supply', 'invoice #1234' ],
    descriptions: [],
    discounts: [ { date: '2020-04-26T02:59:59.999999+00:00', percentage: 10 } ],
    fee: 0,
    line: '34191.09107 07176.307309 71444.640008 1 82610000400000',
    barCode: '34191826100004000001091007175647307144464000',
    status: 'created',
    created: '2020-04-23T23:36:10.789288+00:00',
    workspaceId: '5083989094170624'
}
  

PHP

StarkBank\Boleto Object
(
    [id] => 6655767935451136
    [amount] => 400000
    [name] => Iron Bank S.A.
    [taxId] => 20.018.183/0001-80
    [streetLine1] => Av. Faria Lima, 1844
    [streetLine2] => CJ 13
    [district] => Itaim Bibi
    [city] => São Paulo
    [stateCode] => SP
    [zipCode] => 01500-000
    [due] => DateTime Object
        (
            [date] => 2020-05-21 02:59:59.999999
            [timezone_type] => 1
            [timezone] => +00:00
        )

    [fine] => 2.5
    [interest] => 1.3
    [ourNumber] => 10445145
    [transactionIds] => Array
        (
        )
    [overdueLimit] => 5
    [receiverName] => Winterfell S.A.
    [receiverTaxId] => 71.735.814/0001-12
    [tags] => Array
        (
            [0] => war supply
            [1] => invoice #1234
        )

    [descriptions] => Array
        (
        )

    [discounts] => Array
        (
            [0] => Array
                (
                    [date] => 2020-04-26T02:59:59.999999+00:00
                    [percentage] => 10
                )

        )

    [fee] => 0
    [line] => 34191.09107 07150.227309 71444.640008 7 82610000400000
    [barCode] => 34197826100004000001091007150227307144464000
    [status] => created
    [created] => DateTime Object
        (
            [date] => 2020-04-22 20:12:56.830070
            [timezone_type] => 1
            [timezone] => +00:00
        )

    [workspaceId] => 5083989094170624

)
  

Java

Boleto({
    "id": "6655767935451136",
    "amount": "400000",
    "name": "Iron Bank S.A.",
    "taxId": "20.018.183/0001-80",
    "streetLine1": "Av. Faria Lima, 1844",
    "streetLine2": "CJ 13",
    "district": "Itaim Bibi",
    "city": "São Paulo",
    "stateCode": "SP",
    "zipCode": "01500-000",
    "due": "2020-04-21T02:59:59.999999+00:00",
    "fine": 2.5,
    "interest": 1.3,
    "ourNumber": "10445145",
    "workspaceId": "5083989094170624",
    "transactionIds": [],
    "overdueLimit": 5,
    "receiverName": "Winterfell S.A.",
    "receiverTaxId": "71.735.814/0001-12",
    "tags": ["war supply", "invoice #1234"],
    "descriptions": [],
    "discounts": [
        {"date": "2020-04-26T02:59:59.999999+00:00", "percentage": 10.0}
    ],
    "fee": 0,
    "line": "34191.09107 07027.987309 71444.640008 5 82310000400000",
    "barCode": "34191826100004000001091007175647307144464000",
    "status": "created",
    "created": "2020-04-23T23:28:13+00:00"
    "workspaceId": "5083989094170624"
})
  

Ruby

boleto(
    id: 6655767935451136,
    amount: 400000,
    name: Iron Bank S.A.,
    tax_id: 20.018.183/0001-80,
    street_line_1: Av. Faria Lima, 1844,
    street_line_2: CJ 13,
    district: Itaim Bibi,
    city: São Paulo,
    state_code: SP,
    zip_code: 01500-000,
    due: 2020-05-21T02:59:59.999999+00:00,
    fine: 2.5,
    interest: 1.3,
    our_number: 10445145,
    transaction_ids: [],
    overdue_limit: 5,
    receiver_name: Winterfell S.A.,
    receiver_tax_id: 71.735.814/0001-12,
    tags: ["war supply", "invoice #1234"],
    descriptions: [],
    discounts: [{"date"=>"2020-04-26T02:59:59.999999+00:00", "percentage"=>10.0}],
    fee: 0,
    line: 34191.09107 07149.917309 71444.640008 1 82610000400000,
    bar_code: 34191826100004000001091007149917307144464000,
    status: created,
    created: 2020-04-23T19:59:25+00:00
    workspace_id: 5083989094170624
)
  

Elixir

%StarkBank.Boleto{
    amount: 400000,
    bar_code: "34191826100004000001091007175647307144464000",
    city: "São Paulo",
    created: ~U[2020-04-23 17:41:58.458035Z],
    descriptions: [],
    discounts: [
        %{"date" => "2020-04-26T02:59:59.999999+00:00", "percentage" => 10.0}
    ],
    district: "Itaim Bibi",
    due: ~U[2020-05-21 02:59:59.999999Z],
    fee: 0,
    fine: 2.5,
    id: "6655767935451136",
    interest: 1.3,
    line: "34191.09107 07156.837309 71444.640008 8 82610000400000",
    name: "Iron Bank S.A.",
    our_number: "10445145",
    transaction_ids: [],
    overdue_limit: 5,
    receiver_name: "Winterfell S.A.",
    receiver_tax_id: "71.735.814/0001-12",
    state_code: "SP",
    status: "created",
    street_line_1: "Av. Faria Lima, 1844",
    street_line_2: "CJ 13",
    tags: ["war supply", "invoice #1234"],
    tax_id: "20.018.183/0001-80",
    zip_code: "01500-000",
    workspace_id: "5083989094170624"
}
  

C#

Boleto(
    Amount: 400000,
    Name: Iron Bank S.A.,
    TaxID: 20.018.183/0001-80,
    StreetLine1: Av. Faria Lima, 1844,
    StreetLine2: CJ 13,
    District: Itaim Bibi,
    City: Sao Paulo,
    StateCode: SP,
    ZipCode: 01500-000,
    Due: 05/21/2020 23:59:59,
    Fine: 2.5,
    Interest: 1.3,
    OverdueLimit: 5,
    OurNumber: 10445145,
    TransactionIds: {  },
    ReceiverName: Wintefell S.A.,
    ReceiverTaxID: 71.735.814/0001-12,
    Tags: { war supply, invoice #1234 },
    Descriptions: {  },
    Discounts: { { { date, 2020-04-26T02:59:59.999999+00:00 }, { percentage, 10 } } },
    Fee: 0,
    Line: 34191.09107 07159.647309 71444.640008 1 82610000400000,
    BarCode: 34191826100004000001091007159647307144464000,
    Status: created,
    Created: 04/23/2020 15:53:22,
    WorkspaceId: 5083989094170624,
    ID: 6655767935451136
)
  

Go

{
    Id:6655767935451136 
    Amount:400000 
    Name:Iron Bank S.A. 
    TaxId:20.018.183/0001-80 
    StreetLine1:Av. Faria Lima, 1844 
    StreetLine2:CJ 13 
    District:Itaim Bibi 
    City:São Paulo 
    StateCode:SP 
    ZipCode:01500-000 
    Due:2020-05-21 02:59:59.999999 +0000 +0000 
    Fine:2.5
    Interest:1.3 
    OverdueLimit:5
    Descriptions:[] 
    Discounts:[map[date:2020-04-26T02:59:59.999999+00:00 percentage:10]]
    Tags:[war supply invoice #1234] 
    ReceiverName:Winterfell S.A.
    ReceiverTaxId:71.735.814/0001-12
    Fee:0 
    Line:34191.09107 44555.427309 71444.640008 4 92570000400000 
    BarCode:34191826100004000001091007175647307144464000 
    Status:created 
    TransactionIds:[] 
    WorkspaceId:5083989094170624
    Created:2020-04-23 03:18:33.515597 +0000 +0000 
    OurNumber:10445554
}
  

Clojure

{:amount 400000,
 :fee 0,
 :tags ["war supply" "invoice #1234"],
 :street-line-1 "Av. Faria Lima, 1844",
 :name "Iron Bank S.A.",
 :state-code "SP",
 :city "São Paulo",
 :tax-id "20.018.183/0001-80",
 :our-number "10445145",
 :transaction-ids [],
 :overdue-limit 5,
 :receiver-name "Winterfell S.A."
 :receiver-tax-id "71.735.814/0001-12"
 :created "2020-04-23T19:14:43.125462+00:00",
 :discounts
 [{:date "2020-04-26T02:59:59.999999+00:00", :percentage 10.0}],
 :due "2020-05-21T02:59:59.999999+00:00",
 :street-line-2 "CJ 13",
 :line "34191.09107 07322.097309 71444.640008 1 82610000400000",
 :status "created",
 :interest 1.3,
 :id "6655767935451136",
 :fine 2.5,
 :zip-code "01500-000",
 :bar-code "34191826100004000001091007322097307144464000",
 :descriptions [],
 :district "Itaim Bibi"}
  

Curl

{
    "message": "Boleto successfully deleted",
    "boleto": {
        "id": "6655767935451136",
        "status": "created",
        "line": "34191.09107 07175.647309 71444.640008 1 82610000400000",
        "barCode": "34191826100004000001091007175647307144464000",
        "amount": 400000,
        "due": "2020-05-21T02:59:59.999999+00:00",
        "name": "Iron Bank S.A.",
        "taxId": "20.018.183/0001-80",
        "fine": 2.5,
        "interest": 1.3,
        "ourNumber": "10445145",
        "transactionIds": [],
        "overdueLimit": 5,
        "receiverName": "Winterfell S.A.",
        "receiverTaxId": "71.735.814/0001-12",
        "streetLine1": "Av. Faria Lima, 1844",
        "streetLine2": "CJ 13",
        "district": "Itaim Bibi",
        "city": "São Paulo",
        "stateCode": "SP",
        "zipCode": "01500-000",
        "tags": ["War supply", "Invoice #1234"],
        "workspaceId": "5083989094170624",
        "fee": 0,
        "descriptions": [],
        "discounts": [
            {
                "percentage": 10,
                "date": "2020-04-25"
            }
        ],
        "workspaceId": "5083989094170624"
    }
}
  

Get a Boleto PDF

Get a downloadable boleto PDF file. This route is public and does not require the usual authentication headers. However, if you request an invalid boleto ID too many times, your IP will be blocked for this specific route.

Parameters

id REQUIRED

Id of the boleto entity

hiddenFields OPTIONAL

List of fields to be hidden in Boleto pdf. Example: ["customerAddress"].

layout OPTIONAL

PDF layout. Available options are "default" (full page) and "booklet" ("carnê").

ENDPOINT
GET /v2/boleto/:id/pdf
REQUEST

Python

import starkbank

pdf = starkbank.boleto.pdf("6655767935451136")

with open("boleto.pdf", "wb") as file:
    file.write(pdf)
  

Javascript

const starkbank = require('starkbank');
const fs = require('fs').promises;

(async() => {
    let pdf = await starkbank.boleto.pdf('6655767935451136');
    await fs.writeFile('boleto.pdf', pdf);
})();
  

PHP

$pdf = StarkBank\Boleto::pdf("6655767935451136");

$fp = fopen('boleto.pdf', 'w');
fwrite($fp, $pdf);
fclose($fp);
  

Java

import java.io.File;
import java.io.InputStream;
import java.nio.file.StandardCopyOption;
import com.starkbank.*;

InputStream pdf = Boleto.pdf("6655767935451136");

java.nio.file.Files.copy(
    pdf,
    new File("boleto.pdf").toPath(),
    StandardCopyOption.REPLACE_EXISTING
);
  

Ruby

require('starkbank')

pdf = StarkBank::Boleto.pdf('6655767935451136')

File.open('boleto.pdf', 'w') { |file| file.write(pdf) }
  

Elixir

pdf = StarkBank.Boleto.pdf!("6655767935451136")

file = File.open!("boleto.pdf", [:write])
IO.binwrite(file, pdf)
File.close(file)
  

C#

byte[] pdf = Boleto.Pdf("6655767935451136");

System.IO.File.WriteAllBytes("boleto.pdf", pdf);
  

Go

package main

import (
    "fmt"
    "github.com/starkbank/sdk-go/starkbank/boleto"
)

func main() {

    pdf, err := boleto.Pdf("6655767935451136", nil)
    if err.Errors != nil {
        for _, e := range err.Errors {
            fmt.Printf("code: %s, message: %s", e.Code, e.Message)
        }
    }

    errFile := ioutil.WriteFile("boleto.pdf", pdf, 0666)
    if errFile != nil {
        fmt.Print(errFile)
    }
}
  

Clojure

(clojure.java.io/copy
  (starkbank.boleto/pdf "6655767935451136")
  (clojure.java.io/file "boleto.pdf"))
  

Curl

curl --location --request GET '{{baseUrl}}/v2/boleto/6655767935451136/pdf?layout=booklet' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}'
  

List Boleto logs

Get a paged list of boleto logs. A log tracks a change in the boleto entity according to its life cycle.

Parameters

after OPTIONAL

Filter entities created after this date.

before OPTIONAL

Filter entities created before this date.

boletoIds OPTIONAL

Array of boleto ids that are linked to the logs you desire.

cursor OPTIONAL

String used to get the next batch of results. Our SDKs handle this for you.

fields OPTIONAL

List of strings to filter response JSON keys. Not available in the SDKs.

limit OPTIONAL

Number of results per cursor. Max = 100.

types OPTIONAL

Filters logs by log types.

ENDPOINT
GET /v2/boleto/log
REQUEST

Python

import starkbank

logs = starkbank.boleto.log.query(
    after="2020-04-01",
    before="2020-04-30"
)

for log in logs:
    print(log)
  

Javascript

const starkbank = require('starkbank');

(async() => {
    let logs = await starkbank.boleto.log.query({
        after: '2020-04-01',
        before: '2020-04-30',
    });

    for await (let log of logs) {
        console.log(log);
    }
})();
  

PHP

$logs = StarkBank\Boleto\Log::query([
    "after" => "2020-04-01",
    "before" => "2020-04-30"
]);

foreach($logs as $log){
    print_r($log);
}
  

Java

import com.starkbank.*;
import com.starkbank.utils.Generator;
import java.util.HashMap;

HashMap<String, Object> params = new HashMap<>();
params.put("after", "2020-04-01");
params.put("before", "2020-04-30");
Generator<Boleto.Log> logs = Boleto.Log.query(params);

for (Boleto.Log log : logs){
    System.out.println(log);
}
  

Ruby

require('starkbank')

logs = StarkBank::Boleto::Log.query(
    after: '2020-04-01',
    before: '2020-04-30'
)

logs.each do |log|
    puts log
end
  

Elixir

logs = StarkBank.Boleto.Log.query!(
    after: "2020-04-01",
    before: "2020-04-30"
)

for log <- logs do
    log |> IO.inspect
end
  

C#

using System;
using System.Collections.Generic;

IEnumerable<StarkBank.Boleto.Log> logs = StarkBank.Boleto.Log.Query(
    after: new DateTime(2020, 4, 1),
    before: new DateTime(2020, 4, 30)
);

foreach(StarkBank.Boleto.Log log in logs)
{
    Console.WriteLine(log);
}
  

Go

package main

import (
    "fmt"
    "time"
    "github.com/starkbank/sdk-go/starkbank/boleto/log"
)

func main() {

    var params = map[string]interface{}{}
    params["after"] = time.Date(2020, 4, 1, 0, 0, 0, 0, time.UTC)
    params["before"] = time.Date(2020, 4, 30, 0, 0, 0, 0, time.UTC)
    
    logs, errorChannel := log.Query(params, nil)

    loop:
    for {
        select {
        case err := <-errorChannel:
            if err.Errors != nil {
                for _, e := range err.Errors {
                    fmt.Printf("code: %s, message: %s", e.Code, e.Message)
                }
            }
        case log, ok := <-logs:
            if !ok {
                break loop
            }
            fmt.Printf("%+v", log)
        }
    }
}
  

Clojure

(def logs
  (starkbank.boleto.log/query
    {
      :after "2020-4-1"
      :before "2020-4-30"
    }))
(dorun (map println logs))
  

Curl

curl --location --request GET '{{baseUrl}}/v2/boleto/log?after=2020-04-01&before=2020-04-30' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}'
  
RESPONSE

Python

Log(
    id=6465045294743552,
    created=2020-04-24 23:46:14.703951,
    errors=[],
    type=paid,
    boleto=Boleto(
        id=6655767935451136,
        amount=400000,
        bar_code=34191826100004000001091007175647307144464000,
        city=São Paulo,
        created=2020-04-23 23:36:08.129614,
        descriptions=[],
        discounts=[{'date': '2020-04-26T02:59:59.999999+00:00', 'percentage': 10.0}],
        district=Itaim Bibi,
        due=2020-05-21,
        fee=0,
        fine=2.5,
        interest=1.3,
        line=34191.09107 07175.647309 71444.640008 1 82610000400000,
        name=Iron Bank S.A.,
        our_number=10445145,
        transaction_ids=[],
        overdue_limit=5,
        receiver_name=Winterfell S. A.,
        receiver_tax_id=71.735.814/0001-12,
        state_code=SP,
        status=created,
        street_line_1=Av. Faria Lima, 1844,
        street_line_2=CJ 13,
        tags=['war supply', 'invoice #1234'],
        tax_id=20.018.183/0001-80,
        zip_code=01500-000
        workspace_id=5083989094170624
    )
)
  

Javascript

Log {
    id: '6465045294743552',
    created: '2020-04-24T08:00:06.900961+00:00',
    type: 'paid',
    errors: [],
    boleto: {
        id: '6655767935451136',
        amount: 400000,
        name: 'Iron Bank S.A.',
        taxId: '20.018.183/0001-80',
        streetLine1: 'Av. Faria Lima, 1844',
        streetLine2: 'CJ 13',
        district: 'Itaim Bibi',
        city: 'São Paulo',
        stateCode: 'SP',
        zipCode: '01500-000',
        due: '2020-05-21T02:59:59.999999+00:00',
        fine: 2.5,
        interest: 1.3,
        ourNumber: '10445145',
        transactionIds: [],
        overdueLimit: 5,
        receiverName: 'Winterfell S.A.',
        receiverTaxId: '71.735.814/0001-12',
        tags: [ 'war supply', 'invoice #1234' ],
        descriptions: [],
        discounts: [ { date: '2020-04-26T02:59:59.999999+00:00', percentage: 10 } ],
        fee: 0,
        line: '34191.09107 07176.307309 71444.640008 1 82610000400000',
        barCode: '34191826100004000001091007175647307144464000',
        status: 'created',
        created: '2020-04-23T23:36:10.789288+00:00',
        workspaceId: '5083989094170624'
    }
}
  

PHP

StarkBank\Boleto\Log Object
(
    [id] => 6465045294743552
    [created] => DateTime Object
        (
            [date] => 2020-04-24 18:10:41.196079
            [timezone_type] => 1
            [timezone] => +00:00
        )

    [type] => paid
    [errors] => Array
        (
        )

    [boleto] => StarkBank\Boleto Object
        (
            [id] => 6655767935451136
            [amount] => 400000
            [name] => Iron Bank S.A.
            [taxId] => 20.018.183/0001-80
            [streetLine1] => Av. Faria Lima, 1844
            [streetLine2] => CJ 13
            [district] => Itaim Bibi
            [city] => São Paulo
            [stateCode] => SP
            [zipCode] => 01500-000
            [due] => DateTime Object
                (
                    [date] => 2020-05-21 02:59:59.999999
                    [timezone_type] => 1
                    [timezone] => +00:00
                )
                                
            [fine] => 2.5
            [interest] => 1.3
            [ourNumber] => 10445145
            [transactionIds] => Array
                (
                )
            [overdueLimit] => 5
            [receiverName] => Winterfell S.A.
            [receiverTaxId] => 71.735.814/0001-12
            [tags] => Array
                (
                    [0] => war supply
                    [1] => invoice #1234
                )
                                
            [descriptions] => Array
                (
                )
                                
            [discounts] => Array
                (
                    [0] => Array
                        (
                            [date] => 2020-04-26T02:59:59.999999+00:00
                            [percentage] => 10
                        )
                                
                )
                                
            [fee] => 0
            [line] => 34191.09107 07150.227309 71444.640008 7 82610000400000
            [barCode] => 34197826100004000001091007150227307144464000
            [status] => created
            [created] => DateTime Object
                (
                    [date] => 2020-04-22 20:12:56.830070
                    [timezone_type] => 1
                    [timezone] => +00:00
                )
            [workspaceId] => 5083989094170624
        )
)
  

Java

Log({
    "id": "6465045294743552",
    "created": "2020-04-24T00:10:01+00:00",
    "type": "paid",
    "errors": [],
    "boleto": {
        "id": "6655767935451136",
        "amount": "400000",
        "name": "Iron Bank S.A.",
        "taxId": "20.018.183/0001-80",
        "streetLine1": "Av. Faria Lima, 1844",
        "streetLine2": "CJ 13",
        "district": "Itaim Bibi",
        "city": "São Paulo",
        "stateCode": "SP",
        "zipCode": "01500-000",
        "due": "2020-04-21T02:59:59.999999+00:00",
        "fine": 2.5,
        "interest": 1.3,
        "ourNumber": "10445145",
        "workspaceId": "5083989094170624",
        "transactionIds": [],
        "overdueLimit": 5,
        "receiverName": "Winterfell S.A.",
        "receiverTaxId": "71.735.814/0001-12",
        "tags": ["war supply", "invoice #1234"],
        "descriptions": [],
        "discounts": [
            {"date": "2020-04-26T02:59:59.999999+00:00", "percentage": 10.0}
        ],
        "fee": 0,
        "line": "34191.09107 07027.987309 71444.640008 5 82310000400000",
        "barCode": "34191826100004000001091007175647307144464000",
        "status": "created",
        "created": "2020-04-23T23:28:13+00:00"
        "workspaceId": "5083989094170624"
    }
})
  

Ruby

log(
    id: 6465045294743552,
    created: 2020-04-24T00:10:01+00:00,
    type: paid,
    errors: [],
    boleto: boleto(
        id: 6655767935451136,
        amount: 400000,
        name: Iron Bank S.A.,
        tax_id: 20.018.183/0001-80,
        street_line_1: Av. Faria Lima, 1844,
        street_line_2: CJ 13,
        district: Itaim Bibi,
        city: São Paulo,
        state_code: SP,
        zip_code: 01500-000,
        due: 2020-05-21T02:59:59.999999+00:00,
        fine: 2.5,
        interest: 1.3,
        our_number: 10445145,
        transaction_ids: [],
        overdue_limit: 5,
        receiver_name: Winterfell S.A.,
        receiver_tax_id: 71.735.814/0001-12,
        tags: ["war supply", "invoice #1234"],
        descriptions: [],
        discounts: [{"date"=>"2020-04-26T02:59:59.999999+00:00", "percentage"=>10.0}],
        fee: 0,
        line: 34191.09107 07149.917309 71444.640008 1 82610000400000,
        bar_code: 34191826100004000001091007149917307144464000,
        status: created,
        created: 2020-04-23T19:59:25+00:00
        workspace_id: 5083989094170624
    )
)
  

Elixir

%StarkBank.Boleto.Log {
    id: "6465045294743552",
    created: ~U[2020-04-24 00:23:07.841300Z],
    errors: [],
    type: "paid",
    boleto: %StarkBank.Boleto {
        amount: 400000,
        bar_code: "34191826100004000001091007175647307144464000",
        city: "São Paulo",
        created: ~U[2020-04-23 17:41:58.458035Z],
        descriptions: [],
        discounts: [
            %{"date" => "2020-04-26T02:59:59.999999+00:00", "percentage" => 10.0}
        ],
        district: "Itaim Bibi",
        due: ~U[2020-05-21 02:59:59.999999Z],
        fee: 0,
        fine: 2.5,
        id: "6655767935451136",
        interest: 1.3,
        line: "34191.09107 07156.837309 71444.640008 8 82610000400000",
        name: "Iron Bank S.A.",
        our_number: "10445145",
        transaction_ids: [],
        overdue_limit: 5,
        receiver_name: "Winterfell S.A.",
        receiver_tax_id: "71.735.814/0001-12",
        state_code: "SP",
        status: "created",
        street_line_1: "Av. Faria Lima, 1844",
        street_line_2: "CJ 13",
        tags: ["war supply", "invoice #1234"],
        tax_id: "20.018.183/0001-80",
        zip_code: "01500-000",
        workspace_id: "5083989094170624"
    }
}
  

C#

Log(
    ID: 6465045294743552,
    Created: 04/24/2020 16:00:04,
    Type: paid,
    Errors: {  },
    Boleto: Boleto(
        Amount: 400000,
        Name: Iron Bank S.A.,
        TaxID: 20.018.183/0001-80,
        StreetLine1: Av. Faria Lima, 1844,
        StreetLine2: CJ 13,
        District: Itaim Bibi,
        City: Sao Paulo,
        StateCode: SP,
        ZipCode: 01500-000,
        Due: 05/21/2020 23:59:59,
        Fine: 2.5,
        Interest: 1.3,
        OverdueLimit: 5,
        OurNumber: 10445145,
        TransactionIds: {  },
        ReceiverName: Wintefell S.A.,
        ReceiverTaxID: 71.735.814/0001-12,
        Tags: { war supply, invoice #1234 },
        Descriptions: {  },
        Discounts: { { { date, 2020-04-26T02:59:59.999999+00:00 }, { percentage, 10 } } },
        Fee: 0,
        Line: 34191.09107 07159.647309 71444.640008 1 82610000400000,
        BarCode: 34191826100004000001091007159647307144464000,
        Status: created,
        Created: 04/23/2020 15:53:22,
        WorkspaceId: 5083989094170624
        ID: 6655767935451136
    )
)
  

Go

{
    Id:6465045294743552 
    Boleto:{
        Id:6655767935451136 
        Amount:400000 
        Name:Iron Bank S.A. 
        TaxId:20.018.183/0001-80 
        StreetLine1:Av. Faria Lima, 1844 
        StreetLine2:CJ 13 
        District:Itaim Bibi 
        City:São Paulo 
        StateCode:SP 
        ZipCode:01500-000 
        Due:2020-05-21 02:59:59.999999 +0000 +0000 
        Fine:2.5
        Interest:1.3 
        OverdueLimit:5
        Descriptions:[] 
        Discounts:[map[date:2020-04-26T02:59:59.999999+00:00 percentage:10]]
        Tags:[war supply invoice #1234] 
        ReceiverName:Winterfell S.A.
        ReceiverTaxId:71.735.814/0001-12
        Fee:0 
        Line:34191.09107 44555.427309 71444.640008 4 92570000400000 
        BarCode:34191826100004000001091007175647307144464000 
        Status:created 
        TransactionIds:[] 
        WorkspaceId:5083989094170624
        Created:2020-04-23 03:18:33.515597 +0000 +0000 
        OurNumber:10445554
    } 
    Errors:[] 
    Type:paid 
    Created:2020-04-24 01:00:06.702991 +0000 +0000
}
  

Clojure

{:id "6465045294743552",
 :created "2020-04-24T19:16:03.818700+00:00",
 :errors [],
 :type "paid",
 :boleto
 {:amount 400000,
  :fee 0,
  :tags ["war supply" "invoice #1234"],
  :street-line-1 "Av. Faria Lima, 1844",
  :name "Iron Bank S.A.",
  :state-code "SP",
  :city "São Paulo",
  :tax-id "20.018.183/0001-80",
  :our-number "10445145",
  :transaction-ids [],
  :overdue-limit 5,
  :receiver-name "Winterfell S.A."
  :receiver-tax-id "71.735.814/0001-12"
  :created "2020-04-23T19:14:43.125462+00:00",
  :discounts
  [{:date "2020-04-26T02:59:59.999999+00:00", :percentage 10.0}],
  :due "2020-05-21T02:59:59.999999+00:00",
  :street-line-2 "CJ 13",
  :line "34191.09107 07322.097309 71444.640008 1 82610000400000",
  :status "created",
  :interest 1.3,
  :id "6655767935451136",
  :fine 2.5,
  :zip-code "01500-000",
  :bar-code "34191826100004000001091007322097307144464000",
  :descriptions [],
  :district "Itaim Bibi"}}
  

Curl

{
    "cursor": null,
    "logs": [
        {
            "id": "6465045294743552",
            "created": "2020-04-24T23:00:08.338233+00:00",
            "errors": [],
            "type": "paid",
            "boleto": {
                "id": "6655767935451136",
                "status": "created",
                "line": "34191.09107 07175.647309 71444.640008 1 82610000400000",
                "barCode": "34191826100004000001091007175647307144464000",
                "amount": 400000,
                "due": "2020-05-21T02:59:59.999999+00:00",
                "name": "Iron Bank S.A.",
                "taxId": "20.018.183/0001-80",
                "fine": 2.5,
                "interest": 1.3,
                "ourNumber": "10445145",
                "transactionIds": [],
                "overdueLimit": 5,
                "receiverName": "Winterfell S.A.",
                "receiverTaxId": "71.735.814/0001-12",
                "streetLine1": "Av. Faria Lima, 1844",
                "streetLine2": "CJ 13",
                "district": "Itaim Bibi",
                "city": "São Paulo",
                "stateCode": "SP",
                "zipCode": "01500-000",
                "tags": ["War supply", "Invoice #1234"],
                "workspaceId": "5083989094170624",
                "fee": 0,
                "descriptions": [],
                "discounts": [
                    {
                        "percentage": 10, 
                        "date": "2020-04-25"
                    }
                ],
                "workspaceId": "5083989094170624"
            }
        }
    ]
}
  

Get a Boleto Log

Get a single boleto log by its id.

Parameters

id REQUIRED

Id of the log entity

fields OPTIONAL

List of strings to filter response JSON keys. Not available in the SDKs.

ENDPOINT
GET /v2/boleto/log/:id
REQUEST

Python

import starkbank

log = starkbank.boleto.log.get("6465045294743552")

print(log)
  

Javascript

const starkbank = require('starkbank');

(async() => {
    let log = await starkbank.boleto.log.get('6465045294743552');
    console.log(log);
})();
  

PHP

$log = StarkBank\Boleto\Log::get("6465045294743552");

print_r($log);
  

Java

import com.starkbank.*;

Boleto.Log log = Boleto.Log.get("6465045294743552");

System.out.println(log);
  

Ruby

require('starkbank')

log = StarkBank::Boleto::Log.get('6465045294743552')

puts log
  

Elixir

log = StarkBank.Boleto.Log.get!("6465045294743552")

log |> IO.inspect
  

C#

using System;

StarkBank.Boleto.Log log = StarkBank.Boleto.Log.Get("6465045294743552");

Console.WriteLine(log);
  

Go

package main

import (
    "fmt"
    "github.com/starkbank/sdk-go/starkbank/boleto/log"
)

func main() {

    log, err := log.Get("6465045294743552", nil)
    if err.Errors != nil {
        for _, e := range err.Errors {
            fmt.Printf("code: %s, message: %s", e.Code, e.Message)
        }
    }

    fmt.Printf("%+v", log)
}
  

Clojure

(def log (starkbank.boleto.log/get "6465045294743552"))
(println log)
  

Curl

curl --location --request GET '{{baseUrl}}/v2/boleto/log/6465045294743552' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}'
  
RESPONSE

Python

Log(
    id=6465045294743552,
    created=2020-04-24 23:46:14.703951,
    errors=[],
    type=paid,
    boleto=Boleto(
        id=6655767935451136,
        amount=400000,
        bar_code=34191826100004000001091007175647307144464000,
        city=São Paulo,
        created=2020-04-23 23:36:08.129614,
        descriptions=[],
        discounts=[{'date': '2020-04-26T02:59:59.999999+00:00', 'percentage': 10.0}],
        district=Itaim Bibi,
        due=2020-05-21,
        fee=0,
        fine=2.5,
        interest=1.3,
        line=34191.09107 07175.647309 71444.640008 1 82610000400000,
        name=Iron Bank S.A.,
        our_number=10445145,
        transaction_ids=[],
        overdue_limit=5,
        receiver_name=Winterfell S. A.,
        receiver_tax_id=71.735.814/0001-12,
        state_code=SP,
        status=created,
        street_line_1=Av. Faria Lima, 1844,
        street_line_2=CJ 13,
        tags=['war supply', 'invoice #1234'],
        tax_id=20.018.183/0001-80,
        zip_code=01500-000,
        workspace_id=5083989094170624
    )
)
  

Javascript

Log {
    id: '6465045294743552',
    created: '2020-04-24T08:00:06.900961+00:00',
    type: 'paid',
    errors: [],
    boleto: {
        id: '6655767935451136',
        amount: 400000,
        name: 'Iron Bank S.A.',
        taxId: '20.018.183/0001-80',
        streetLine1: 'Av. Faria Lima, 1844',
        streetLine2: 'CJ 13',
        district: 'Itaim Bibi',
        city: 'São Paulo',
        stateCode: 'SP',
        zipCode: '01500-000',
        due: '2020-05-21T02:59:59.999999+00:00',
        fine: 2.5,
        interest: 1.3,
        ourNumber: '10445145',
        transactionIds: [],
        overdueLimit: 5,
        receiverName: 'Winterfell S.A.',
        receiverTaxId: '71.735.814/0001-12',
        tags: [ 'war supply', 'invoice #1234' ],
        descriptions: [],
        discounts: [ { date: '2020-04-26T02:59:59.999999+00:00', percentage: 10 } ],
        fee: 0,
        line: '34191.09107 07176.307309 71444.640008 1 82610000400000',
        barCode: '34191826100004000001091007175647307144464000',
        status: 'created',
        created: '2020-04-23T23:36:10.789288+00:00',
        workspaceId: '5083989094170624'
    }
}
  

PHP

StarkBank\Boleto\Log Object
(
    [id] => 6465045294743552
    [created] => DateTime Object
        (
            [date] => 2020-04-24 18:10:41.196079
            [timezone_type] => 1
            [timezone] => +00:00
        )

    [type] => paid
    [errors] => Array
        (
        )

    [boleto] => StarkBank\Boleto Object
        (
            [id] => 6655767935451136
            [amount] => 400000
            [name] => Iron Bank S.A.
            [taxId] => 20.018.183/0001-80
            [streetLine1] => Av. Faria Lima, 1844
            [streetLine2] => CJ 13
            [district] => Itaim Bibi
            [city] => São Paulo
            [stateCode] => SP
            [zipCode] => 01500-000
            [due] => DateTime Object
                (
                    [date] => 2020-05-21 02:59:59.999999
                    [timezone_type] => 1
                    [timezone] => +00:00
                )
                                
            [fine] => 2.5
            [interest] => 1.3
            [ourNumber] => 10445145
            [transactionIds] => Array
                (
                )

            [overdueLimit] => 5
            [receiverName] => Winterfell S.A.
            [receiverTaxId] => 71.735.814/0001-12
            [tags] => Array
                (
                    [0] => war supply
                    [1] => invoice #1234
                )
                                
            [descriptions] => Array
                (
                )
                                
            [discounts] => Array
                (
                    [0] => Array
                        (
                            [date] => 2020-04-26T02:59:59.999999+00:00
                            [percentage] => 10
                        )
                                
                )
                                
            [fee] => 0
            [line] => 34191.09107 07150.227309 71444.640008 7 82610000400000
            [barCode] => 34197826100004000001091007150227307144464000
            [status] => created
            [created] => DateTime Object
                (
                    [date] => 2020-04-22 20:12:56.830070
                    [timezone_type] => 1
                    [timezone] => +00:00
                )

            [workspaceId] => 5083989094170624
        )
)
  

Java

Log({
    "id": "6465045294743552",
    "created": "2020-04-24T00:10:01+00:00",
    "type": "paid",
    "errors": [],
    "boleto": {
        "id": "6655767935451136",
        "amount": "400000",
        "name": "Iron Bank S.A.",
        "taxId": "20.018.183/0001-80",
        "streetLine1": "Av. Faria Lima, 1844",
        "streetLine2": "CJ 13",
        "district": "Itaim Bibi",
        "city": "São Paulo",
        "stateCode": "SP",
        "zipCode": "01500-000",
        "due": "2020-04-21T02:59:59.999999+00:00",
        "fine": 2.5,
        "interest": 1.3,
        "ourNumber": "10445145",
        "workspaceId": "5083989094170624",
        "transactionIds": [],
        "overdueLimit": 5,
        "receiverName": "Winterfell S.A.",
        "receiverTaxId": "71.735.814/0001-12",
        "tags": ["war supply", "invoice #1234"],
        "descriptions": [],
        "discounts": [
            {"date": "2020-04-26T02:59:59.999999+00:00", "percentage": 10.0}
        ],
        "fee": 0,
        "line": "34191.09107 07027.987309 71444.640008 5 82310000400000",
        "barCode": "34191826100004000001091007175647307144464000",
        "status": "created",
        "created": "2020-04-23T23:28:13+00:00",
        "workspaceId": "5083989094170624"
    }
})
  

Ruby

log(
    id: 6465045294743552,
    created: 2020-04-24T00:10:01+00:00,
    type: paid,
    errors: [],
    boleto: boleto(
        id: 6655767935451136,
        amount: 400000,
        name: Iron Bank S.A.,
        tax_id: 20.018.183/0001-80,
        street_line_1: Av. Faria Lima, 1844,
        street_line_2: CJ 13,
        district: Itaim Bibi,
        city: São Paulo,
        state_code: SP,
        zip_code: 01500-000,
        due: 2020-05-21T02:59:59.999999+00:00,
        fine: 2.5,
        interest: 1.3,
        our_number: 10445145,
        transaction_ids: [],
        overdue_limit: 5,
        receiver_name: Winterfell S.A.,
        receiver_tax_id: 71.735.814/0001-12,
        tags: ["war supply", "invoice #1234"],
        descriptions: [],
        discounts: [{"date"=>"2020-04-26T02:59:59.999999+00:00", "percentage"=>10.0}],
        fee: 0,
        line: 34191.09107 07149.917309 71444.640008 1 82610000400000,
        bar_code: 34191826100004000001091007149917307144464000,
        status: created,
        created: 2020-04-23T19:59:25+00:00,
        workspace_id: 5083989094170624
    )
)
  

Elixir

%StarkBank.Boleto.Log {
    id: "6465045294743552",
    created: ~U[2020-04-24 00:23:07.841300Z],
    errors: [],
    type: "paid",
    boleto: %StarkBank.Boleto {
        amount: 400000,
        bar_code: "34191826100004000001091007175647307144464000",
        city: "São Paulo",
        created: ~U[2020-04-23 17:41:58.458035Z],
        descriptions: [],
        discounts: [
            %{"date" => "2020-04-26T02:59:59.999999+00:00", "percentage" => 10.0}
        ],
        district: "Itaim Bibi",
        due: ~U[2020-05-21 02:59:59.999999Z],
        fee: 0,
        fine: 2.5,
        id: "6655767935451136",
        interest: 1.3,
        line: "34191.09107 07156.837309 71444.640008 8 82610000400000",
        name: "Iron Bank S.A.",
        our_number: "10445145",
        transaction_ids: [],
        overdue_limit: 5,
        receiver_name: "Winterfell S.A.",
        receiver_tax_id: "71.735.814/0001-12",
        state_code: "SP",
        status: "created",
        street_line_1: "Av. Faria Lima, 1844",
        street_line_2: "CJ 13",
        tags: ["war supply", "invoice #1234"],
        tax_id: "20.018.183/0001-80",
        zip_code: "01500-000",
        workspace_id: "5083989094170624"
    }
}
  

C#

Log(
    ID: 6465045294743552,
    Created: 04/24/2020 16:00:04,
    Type: paid,
    Errors: {  },
    Boleto: Boleto(
        Amount: 400000,
        Name: Iron Bank S.A.,
        TaxID: 20.018.183/0001-80,
        StreetLine1: Av. Faria Lima, 1844,
        StreetLine2: CJ 13,
        District: Itaim Bibi,
        City: Sao Paulo,
        StateCode: SP,
        ZipCode: 01500-000,
        Due: 05/21/2020 23:59:59,
        Fine: 2.5,
        Interest: 1.3,
        OverdueLimit: 5,
        OurNumber: 10445145,
        TransactionIds: {  },
        ReceiverName: Wintefell S.A.,
        ReceiverTaxID: 71.735.814/0001-12,
        Tags: { war supply, invoice #1234 },
        Descriptions: {  },
        Discounts: { { { date, 2020-04-26T02:59:59.999999+00:00 }, { percentage, 10 } } },
        Fee: 0,
        Line: 34191.09107 07159.647309 71444.640008 1 82610000400000,
        BarCode: 34191826100004000001091007159647307144464000,
        Status: created,
        Created: 04/23/2020 15:53:22,
        WorkspaceId: 5083989094170624,
        ID: 6655767935451136
    )
)
  

Go

{
    Id:6465045294743552 
    Boleto:{
        Id:6655767935451136 
        Amount:400000 
        Name:Iron Bank S.A. 
        TaxId:20.018.183/0001-80 
        StreetLine1:Av. Faria Lima, 1844 
        StreetLine2:CJ 13 
        District:Itaim Bibi 
        City:São Paulo 
        StateCode:SP 
        ZipCode:01500-000 
        Due:2020-05-21 02:59:59.999999 +0000 +0000 
        Fine:2.5
        Interest:1.3 
        OverdueLimit:5
        Descriptions:[] 
        Discounts:[map[date:2020-04-26T02:59:59.999999+00:00 percentage:10]]
        Tags:[war supply invoice #1234] 
        ReceiverName:Winterfell S.A.
        ReceiverTaxId:71.735.814/0001-12
        Fee:0 
        Line:34191.09107 44555.427309 71444.640008 4 92570000400000 
        BarCode:34191826100004000001091007175647307144464000 
        Status:created 
        TransactionIds:[] 
        WorkspaceId:5083989094170624
        Created:2020-04-23 03:18:33.515597 +0000 +0000 
        OurNumber:10445554
    } 
    Errors:[] 
    Type:paid 
    Created:2020-04-24 01:00:06.702991 +0000 +0000
}
  

Clojure

{:id "6465045294743552",
 :created "2020-04-24T19:16:03.818700+00:00",
 :errors [],
 :type "paid",
 :boleto
 {:amount 400000,
  :fee 0,
  :tags ["war supply" "invoice #1234"],
  :street-line-1 "Av. Faria Lima, 1844",
  :name "Iron Bank S.A.",
  :state-code "SP",
  :city "São Paulo",
  :tax-id "20.018.183/0001-80",
  :our-number "10445145",
  :transaction-ids [],
  :overdue-limit 5,
  :receiver-name "Winterfell S.A."
  :receiver-tax-id "71.735.814/0001-12"
  :created "2020-04-23T19:14:43.125462+00:00",
  :discounts
  [{:date "2020-04-26T02:59:59.999999+00:00", :percentage 10.0}],
  :due "2020-05-21T02:59:59.999999+00:00",
  :street-line-2 "CJ 13",
  :line "34191.09107 07322.097309 71444.640008 1 82610000400000",
  :status "created",
  :interest 1.3,
  :id "6655767935451136",
  :fine 2.5,
  :zip-code "01500-000",
  :bar-code "34191826100004000001091007322097307144464000",
  :descriptions [],
  :district "Itaim Bibi"}}
  

Curl

{
    "log": {
        "id": "6465045294743552",
        "created": "2020-04-24T23:00:08.338233+00:00",
        "errors": [],
        "type": "paid",
        "boleto": {
            "id": "6655767935451136",
            "status": "created",
            "line": "34191.09107 07175.647309 71444.640008 1 82610000400000",
            "barCode": "34191826100004000001091007175647307144464000",
            "amount": 400000,
            "due": "2020-05-21T02:59:59.999999+00:00",
            "name": "Iron Bank S.A.",
            "taxId": "20.018.183/0001-80",
            "fine": 2.5,
            "interest": 1.3,
            "ourNumber": "10445145",
            "transactionIds": [],
            "overdueLimit": 5,
            "receiverName": "Winterfell S.A.",
            "receiverTaxId": "71.735.814/0001-12",
            "streetLine1": "Av. Faria Lima, 1844",
            "streetLine2": "CJ 13",
            "district": "Itaim Bibi",
            "city": "São Paulo",
            "stateCode": "SP",
            "zipCode": "01500-000",
            "tags": ["War supply", "Invoice #1234"],
            "workspaceId": "5083989094170624",
            "fee": 0,
            "descriptions": [],
            "discounts": [
                {
                    "percentage": 10, 
                    "date": "2020-04-25"
                }
            ],
            "workspaceId": "5083989094170624"
        }
    }
}
  

Boleto Holmes

Honoring the famous Sherlock Holmes, this feature allows your application to investigate updated boleto status according to CIP in less than an hour.

Here we will teach you how to create and manage your Boleto Holmes. Ideally, since results are asynchronous, you should register a Boleto Holmes webhook subscription in order to receive the investigation results instead of polling.

Holmes Status

Each boleto has a status that can change over time according to its life cycle:

boleto-holmes-status

Holmes Log

Every time we modify a Boleto Holmes, we create a log. Logs are pretty useful for understanding the life cycle of each Holmes and the changes that happened to it. Here is the possible event flow:

boleto-holmes-log

The Boleto Holmes object

Attributes

id STRING

Unique id for the boleto holmes.

boletoId STRING

Investigated boleto entity ID.

created STRING

Creation datetime. Example: "2020-04-23T23:00:00.000000+00:00".

result STRING

Result of the investigation. Options: "paid", "canceled", "registered".

status STRING

Current holmes status. Options: "created", "solving", "solved".

tags LIST OF STRINGS

Tags associated with the boleto holmes.

updated STRING

Last update datetime. Example: "2020-04-23T23:00:00.000000+00:00".

Create Boleto Holmes

Use this route to verify the updated status of boletos generated at Stark Bank according to CIP.

Parameters

boletoId REQUIRED

Investigated boleto entity ID. ex: '5656565656565656'

tags OPTIONAL

Array of strings to tag the entity for future queries. All tags will be converted to lowercase.

ENDPOINT
POST /v2/boleto-holmes
REQUEST

Python

import starkbank

holmes = starkbank.boletoholmes.create([
    starkbank.BoletoHolmes(
        boleto_id="5656565656565656",
        tags=["sherlock", "holmes"],
    )
])

for holmes in holmes:
    print(holmes)
  

Javascript

const starkbank = require('starkbank');

(async() => {
    let holmes = await starkbank.boletoHolmes.create([
        {
            boletoId: '5656565656565656',
            tags: ['sherlock', 'holmes'],
        }
    ])

    for (let holmes of holmes) {
        console.log(holmes);
    }
})();
  

PHP

use StarkBank\BoletoHolmes;

$holmes = [new BoletoHolmes([
    "boletoId" => "5656565656565656",
    "tags" => ["sherlock", "holmes"]
])];

$boletoHolmes = BoletoHolmes::create($holmes)[0];

foreach($boletoHolmes as $sherlock){
    print_r($sherlock);
}
  

Java

import com.starkbank.*;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

List<BoletoHolmes> holmes = new ArrayList<>();
HashMap<String, Object> dataHolmes = new HashMap<>();
dataHolmes.put("boletoId", "5656565656565656");
dataHolmes.put("tags", new String[]{"sherlock", "holmes"});
holmes.add(new BoletoHolmes(dataHolmes));

holmes = BoletoHolmes.create(holmes);

for (BoletoHolmes sherlock : holmes){
    System.out.println(sherlock);
}
  

Ruby

require('starkbank')

holmes = StarkBank::BoletoHolmes.create([
    StarkBank::BoletoHolmes.new(
        boleto_id: '5656565656565656',
        tags: ['sherlock', 'holmes']
    )
])

holmes.each do |sherlock|
    puts sherlock
end
  

Elixir

holmes = StarkBank.BoletoHolmes.create!(
    [
        %StarkBank.BoletoHolmes{
            boleto_id: "5656565656565656",
            tags: ["sherlock", "holmes"],
        }
    ]
) |> IO.inspect
  

C#

using System;
using System.Collections.Generic;

List<StarkBank.BoletoHolmes> holmes = StarkBank.BoletoHolmes.Create(
    new List<StarkBank.BoletoHolmes>() {
        new BoletoHolmes(
            boletoID: "5656565656565656",
            tags: new List<string> { "sherlock", "holmes" }
        )
    }
);

foreach(StarkBank.BoletoHolmes sherlock in holmes)
{
    Console.WriteLine(sherlock);
}
  

Go

package main

import (
    "fmt"
    "github.com/starkbank/sdk-go/starkbank/boletoholmes"
)

func main() {

    holmes, err := boletoholmes.Create(
        []boletoholmes.BoletoHolmes{
            {
                BoletoId: "4933519247671296",
                Tags: []string{"sherlock", "holmes"},
            },
        }, nil)
    if err.Errors != nil {
        for _, e := range err.Errors {
            fmt.Printf("code: %s, message: %s", e.Code, e.Message)
        }
    }

    for _, sherlock := range holmes {
        fmt.Printf("%+v", sherlock)
    }
}
  

Clojure

def holmes (starkbank.boleto-holmes/create
[{
    :boleto-id "5656565656565656"
    :tags ["sherlock" "holmes"]
}]))

(doseq [sherlock holmes]
    (println sherlock))
  

Curl

curl --location --request POST '{{baseUrl}}/v2/boleto-holmes' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}' 
--header 'Content-Type: application/json' 
--data-raw '{
    "holmes": [
        {
            "boletoId": "5656565656565656",
            "tags": ["sherlock", "holmes"],
        },
    ]
}'
  
RESPONSE

Python

BoletoHolmes(
    boleto_id=5656565656565656,
    created=2020-07-23 00:07:51.069587,
    id=3232323232323232,
    result=,
    status=solving,
    tags=["sherlock", "holmes"],
    updated=2020-07-23 00:07:51.069597
)
  

Javascript

BoletoHolmes {
    boletoId: '5656565656565656',
    created: '2020-07-23T00:07:40.611174+00:00',
    id: '3232323232323232',
    result: '',
    status: 'solving',
    tags: ['sherlock', 'holmes'],
    updated: '2020-07-23T00:07:51.611174+00:00'
}
  

PHP

StarkBank\BoletoHolmes Object
(
    [id] => 3232323232323232
    [boletoId] => 5656565656565656
    [tags] => Array
        (
            [0] => sherlock
            [1] => holmes
        )

    [status] => solving
    [result] =>
    [created] => DateTime Object
        (
            [date] => 2020-07-23 00:07:51.532473
            [timezone_type] => 1
            [timezone] => +00:00
        )

    [updated] => DateTime Object
        (
            [date] => 2020-07-23 00:07:51.532473
            [timezone_type] => 1
            [timezone] => +00:00
        )
)
  

Java

BoletoHolmes({
    "tags": [
        "sherlock",
        "holmes"
    ],
    "boletoId": "5656565656565656",
    "status": "solving",
    "result": "",
    "created": "2020-07-23T00:07:51.176283+00:00",
    "updated": "2020-07-23T00:07:51.176290+00:00",
    "id": "3232323232323232"
})
  

Ruby

boletoholmes(
    id: 3232323232323232,
    boleto_id: 5656565656565656,
    tags: ["sherlock", "holmes"],
    status: solving,
    result: ,
    created: 2020-07-23T00:07:51+00:00,
    updated: 2020-07-23T00:07:51+00:00
)
  

Elixir

  StarkBank.BoletoHolmes{
    boleto_id: "5656565656565656",
    created: ~U[2020-07-23 00:07:51.256963Z],
    id: "3232323232323232",
    result: "",
    status: "solving",
    tags: ["sherlock", "holmes"],
    updated: ~U[2020-07-23 00:07:51.256969Z]
}
  

C#

BoletoHolmes(
    BoletoID: '5656565656565656',
    Created: 07/23/2020 00:07:51,
    ID: 3232323232323232,
    Result: ,
    Status: solving,
    Tags: { sherlock, holmes },
    Updated: 07/23/2020 00:07:51,
)
  

Go

{
    Id:3232323232323232
    BoletoId:5656565656565656
    Tags:[sherlock holmes]
    Status:solving
    Result:
    Created:2020-07-23 00:07:51.351907 +0000 +0000
    Updated:2020-07-23 00:07:51.351914 +0000 +0000
}
  

Clojure

{
    :id 3232323232323232,
    :boleto-id 5656565656565656,
    :status solving,
    :result,
    :tags [sherlock holmes],
    :created 2020-07-23T00:07:51.467925+00:00,
    :updated 2020-07-23T00:07:51.467931+00:00
}
  

Curl

{
    "message": "Boleto Holmes successfully created",
    "holmes": [
        {
            "boletoId": "5656565656565656",
            "created": "2020-07-23T00:07:51.611174+00:00",
            "id": "3232323232323232",
            "result": "",
            "status": "solving",
            "tags": ["sherlock", "holmes"],
            "updated": "2020-07-23T00:07:51.611174+00:00"
        }
    ]
}
  

List Boleto Holmes

Get a list of non-deleted boletos in chunks of at most 100. If you need smaller chunks, use the limit parameter.

Parameters

after OPTIONAL

Filter entities created after this date.

before OPTIONAL

Filter entities created before this date.

boletoId OPTIONAL

String to get boletos holmes that refer to a specific boleto ID.

cursor OPTIONAL

String used to get the next batch of results. Our SDKs handle this for you.

fields OPTIONAL

List of strings to filter response JSON keys. Not available in the SDKs.

ids OPTIONAL

List of ids to filter retrieved objects. ex: ['5656565656565656', '4545454545454545']

limit OPTIONAL

Number of results per cursor. Max = 100.

status OPTIONAL

Filter holmes by the specified status.

tags OPTIONAL

Filter entities that contain the specified tags.

ENDPOINT
GET /v2/boleto-holmes
REQUEST

Python

import starkbank

holmes = starkbank.boletoholmes.query(
    boleto_id="5656565656565656",
    after="2020-07-01",
    before="2020-07-30"
)

for holmes in holmes:
    print(holmes)
  

Javascript

const starkbank = require('starkbank');

(async() => {
    let holmes = await starkbank.boletoHolmes.query({
        boletoId: "5656565656565656",
        after: '2020-07-01',
        before: '2020-07-30',
    });

    for await (let holmes of holmes) {
        console.log(holmes);
    }
})();
  

PHP

use StarkBank\BoletoHolmes;

$holmes = iterator_to_array(BoletoHolmes::query([
    "boletoId" => "5656565656565656",
    "after" => "2020-07-01",
    "before" => "2020-07-30"
]));

foreach($holmes as $sherlock){
    print_r($sherlock);
}
  

Java

import com.starkbank.*;
import java.util.HashMap;
import com.starkbank.utils.Generator;

HashMap<String, Object> params = new HashMap<>();
params.put("boletoId", "5656565656565656");
params.put("after", "2020-07-01");
params.put("before", "2020-07-30");
Generator<BoletoHolmes> holmes = BoletoHolmes.query(params);

for (BoletoHolmes sherlock : holmes){
    System.out.println(sherlock);
}
  

Ruby

require('starkbank')

holmes = StarkBank::BoletoHolmes.query(
    boleto_id: '5656565656565656',
    after: '2020-07-01',
    before: '2020-07-30'
).to_a

holmes.each do |sherlock|
    puts sherlock
end
  

Elixir

holmes = StarkBank.BoletoHolmes.query!(
    boleto_id: "5656565656565656",
    after: "2020-07-01",
    before: "2020-07-30"
)

for holme <- holmes do
    holme |> IO.inspect
end
  

C#

using System;
using System.Collections.Generic;

IEnumerable<StarkBank.BoletoHolmes> holmes = StarkBank.BoletoHolmes.Query(
    boletoId: "5656565656565656",
    after: new DateTime(2020, 7, 1),
    before: new DateTime(2020, 7, 30)
);

foreach (StarkBank.BoletoHolmes sherlock in holmes) {
    Console.WriteLine(sherlock);
}
  

Go

package main

import (
    "fmt"
    "time"
    "github.com/starkbank/sdk-go/starkbank/boletoholmes"
)

func main() {

    var params = map[string]interface{}{}
    params["after"] = time.Date(2020, 7, 1, 0, 0, 0, 0, time.UTC)
    params["before"] = time.Date(2020, 7, 30, 0, 0, 0, 0, time.UTC)

    holmes, errorChannel := boletoholmes.Query(params, nil)

    loop:
    for {
        select {
        case err := <-errorChannel:
            if err.Errors != nil {
                for _, e := range err.Errors {
                    fmt.Printf("code: %s, message: %s", e.Code, e.Message)
                }
            }
        case sherlock, ok := <-holmes:
            if !ok {
                break loop
            }
            fmt.Printf("%+v", sherlock)
        }
    }
}
  

Clojure

(def holmes (starkbank.boleto-holmes/query {:boletoId 5656565656565656, :after "2020-07-01", :before "2020-07-30"}))

(doseq [sherlock holmes]
    (println sherlock))
  

Curl

curl --location --request GET '{{baseUrl}}/v2/boleto-holmes?boletoId=5656565656565656&after=2020-07-01&before=2020-07-30' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}'
  
RESPONSE

Python

BoletoHolmes(
    boleto_id=5656565656565656,
    created=2020-07-23 00:07:51.069587,
    id=3232323232323232,
    result=paid,
    status=solved,
    tags=["sherlock", "holmes"],
    updated=2020-07-23 00:07:51.069597
)
  

Javascript

BoletoHolmes {
    boletoId: '5656565656565656',
    created: '2020-07-23T00:07:40.611174+00:00',
    id: '3232323232323232',
    result: '',
    status: 'solving',
    tags: ['sherlock', 'holmes'],
    updated: '2020-07-23T00:07:51.611174+00:00'
}
  

PHP

StarkBank\BoletoHolmes Object
(
    [id] => 3232323232323232
    [boletoId] => 5656565656565656
    [tags] => Array
        (
            [0] => sherlock
            [1] => holmes
        )

    [status] => solving
    [result] =>
    [created] => DateTime Object
        (
            [date] => 2020-07-23 00:07:51.532473
            [timezone_type] => 1
            [timezone] => +00:00
        )

    [updated] => DateTime Object
        (
            [date] => 2020-07-23 00:07:51.532473
            [timezone_type] => 1
            [timezone] => +00:00
        )
)
  

Java

BoletoHolmes({
    "tags": [
        "sherlock",
        "holmes"
    ],
    "boletoId": "5656565656565656",
    "status": "solving",
    "result": "",
    "created": "2020-07-23T00:07:51.176283+00:00",
    "updated": "2020-07-23T00:07:51.176290+00:00",
    "id": "3232323232323232"
})
  

Ruby

boletoholmes(
    id: 3232323232323232,
    boleto_id: 5656565656565656,
    tags: ["sherlock", "holmes"],
    status: solving,
    result: ,
    created: 2020-07-23T00:07:51+00:00,
    updated: 2020-07-23T00:07:51+00:00
)
  

Elixir

%StarkBank.BoletoHolmes{
    boleto_id: "5656565656565656",
    created: ~U[2020-07-23 00:07:51.256963Z],
    id: "3232323232323232",
    result: "",
    status: "solving",
    tags: ["sherlock", "holmes"],
    updated: ~U[2020-07-23 00:07:51.256969Z]
}
  

C#

BoletoHolmes(
    BoletoID: '5656565656565656',
    Created: 07/23/2020 00:07:51,
    ID: 3232323232323232,
    Result: ,
    Status: solving,
    Tags: { sherlock, holmes },
    Updated: 07/23/2020 00:07:51,
)
  

Go

{
    Id:3232323232323232
    BoletoId:5656565656565656
    Tags:[sherlock holmes]
    Status:solving
    Result:
    Created:2020-07-23 00:07:51.351907 +0000 +0000
    Updated:2020-07-23 00:07:51.351914 +0000 +0000
}
  

Clojure

{
    :id 3232323232323232,
    :boleto-id 5656565656565656,
    :status solving,
    :result,
    :tags [sherlock holmes],
    :created 2020-07-23T00:07:51.467925+00:00,
    :updated 2020-07-23T00:07:51.467931+00:00
}
  

Curl

{
    "cursor": null,
    "holmes": [
        {
            "boletoId": "5656565656565656",
            "created": "2020-07-23T00:07:51.611174+00:00",
            "id": "3232323232323232",
            "result": "",
            "status": "solving",
            "tags": ["sherlock", "holmes"],
            "updated": "2020-07-23T00:07:51.611174+00:00"
        }
    ]
}
  

Get a Boleto Holmes

Get a single boleto holmes by its id.

Parameters

id REQUIRED

Id of the boleto holmes entity.

fields OPTIONAL

List of strings to filter response JSON keys. Not available in the SDKs.

ENDPOINT
GET /v2/boleto-holmes/:id
REQUEST

Python

import starkbank

holmes = starkbank.boletoholmes.get("3232323232323232")

print(holmes)
  

Javascript

const starkbank = require('starkbank');

(async() => {
    let holmes = await starkbank.boletoHolmes.get('3232323232323232');

    console.log(holmes);
})();
  

PHP

use StarkBank\BoletoHolmes;

$sherlock = BoletoHolmes::get("3232323232323232");

print_r($sherlock);
  

Java

import com.starkbank.*;

BoletoHolmes sherlock = BoletoHolmes.get("3232323232323232");

System.out.println(sherlock);
  

Ruby

require('starkbank')

sherlock = StarkBank::BoletoHolmes.get('3232323232323232')

puts sherlock
  

Elixir

sherlock = StarkBank.BoletoHolmes.get!("3232323232323232")

|> IO.inspect
  

C#

using System;

StarkBank.BoletoHolmes sherlock = StarkBank.BoletoHolmes.Get("3232323232323232");

Console.WriteLine(sherlock);
  

Go

package main

import (
    "fmt"
    "github.com/starkbank/sdk-go/starkbank/boletoholmes"
)

func main() {

    sherlock, err := boletoholmes.Get("3232323232323232", nil)
    if err.Errors != nil {
        for _, e := range err.Errors {
            fmt.Printf("code: %s, message: %s", e.Code, e.Message)
        }
    }

    fmt.Printf("%+v", sherlock)
}
  

Clojure

(def holmes (starkbank.boleto-holmes/get "3232323232323232"))

(println holmes)
  

Curl

curl --location --request GET '{{baseUrl}}/v2/boleto-holmes/3232323232323232' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}'
  
RESPONSE

Python

BoletoHolmes(
    boleto_id=5656565656565656,
    created=2020-07-23 00:07:51.069587,
    id=3232323232323232,
    result=,
    status=solving,
    tags=["sherlock", "holmes"],
    updated=2020-07-23 00:07:51.069597
)
  

Javascript

BoletoHolmes {
    boletoId: '5656565656565656',
    created: '2020-07-23T00:07:40.611174+00:00',
    id: '3232323232323232',
    result: '',
    status: 'solving',
    tags: ['sherlock', 'holmes'],
    updated: '2020-07-23T00:07:51.611174+00:00'
}
  

PHP

StarkBank\BoletoHolmes Object
(
    [id] => 3232323232323232
    [boletoId] => 5656565656565656
    [tags] => Array
        (
            [0] => sherlock
            [1] => holmes
        )

    [status] => solving
    [result] =>
    [created] => DateTime Object
        (
            [date] => 2020-07-23 00:07:51.532473
            [timezone_type] => 1
            [timezone] => +00:00
        )

    [updated] => DateTime Object
        (
            [date] => 2020-07-23 00:07:51.532473
            [timezone_type] => 1
            [timezone] => +00:00
        )
)
  

Java

BoletoHolmes({
    "tags": [
        "sherlock",
        "holmes"
    ],
    "boletoId": "5656565656565656",
    "status": "solving",
    "result": "",
    "created": "2020-07-23T00:07:51.176283+00:00",
    "updated": "2020-07-23T00:07:51.176290+00:00",
    "id": "3232323232323232"
})
  

Ruby

boletoholmes(
    id: 3232323232323232,
    boleto_id: 5656565656565656,
    tags: ["sherlock", "holmes"],
    status: solving,
    result: ,
    created: 2020-07-23T00:07:51+00:00,
    updated: 2020-07-23T00:07:51+00:00
)
  

Elixir

%StarkBank.BoletoHolmes{
    boleto_id: "5656565656565656",
    created: ~U[2020-07-23 00:07:51.256963Z],
    id: "3232323232323232",
    result: "",
    status: "solving",
    tags: ["sherlock", "holmes"],
    updated: ~U[2020-07-23 00:07:51.256969Z]
}
  

C#

BoletoHolmes(
    BoletoID: '5656565656565656',
    Created: 07/23/2020 00:07:51,
    ID: 3232323232323232,
    Result: ,
    Status: solving,
    Tags: { sherlock, holmes },
    Updated: 07/23/2020 00:07:51,
)
  

Go

 {
    Id:3232323232323232
    BoletoId:5656565656565656
    Tags:[sherlock holmes]
    Status:solving
    Result:
    Created:2020-07-23 00:07:51.351907 +0000 +0000
    Updated:2020-07-23 00:07:51.351914 +0000 +0000
}
  

Clojure

 {
    :id 3232323232323232,
    :boleto-id 5656565656565656,
    :status solving,
    :result,
    :tags [sherlock holmes],
    :created 2020-07-23T00:07:51.467925+00:00,
    :updated 2020-07-23T00:07:51.467931+00:00
}
  

Curl

 {
    "holmes": [
        {
            "boletoId": "5656565656565656",
            "created": "2020-07-23T00:07:51.611174+00:00",
            "id": "3232323232323232",
            "result": "",
            "status": "solving",
            "tags": ["sherlock", "holmes"],
            "updated": "2020-07-23T00:07:51.611174+00:00"
        }
    ]
}
  

List Boleto Holmes Logs

Get a paged list of all boleto holmes logs. A log tracks a change in the holmes entity according to its life cycle.

Parameters

after OPTIONAL

Filter entities created after this date.

before OPTIONAL

Filter entities created before this date.

cursor OPTIONAL

String used to get the next batch of results. Our SDKs handle this for you.

fields OPTIONAL

List of strings to filter response JSON keys. Not available in the SDKs.

holmesIds OPTIONAL

Filter logs by Holmes IDs

limit OPTIONAL

Number of results per cursor. Max = 100.

types OPTIONAL

Filters logs by log types.

ENDPOINT
GET /v2/boleto-holmes/log
REQUEST

Python

import starkbank

logs = starkbank.boletoholmes.log.query(
    after="2020-07-01",
    before="2020-07-30"
)

for log in logs:
    print(log)
  

Javascript

const starkbank = require('starkbank');

(async() => {
    let logs = await starkbank.boletoHolmes.log.query({
        after: '2020-07-01',
        before: '2020-07-30',
    });

    for await (let log of logs) {
        console.log(log);
    }
})();
  

PHP

use StarkBank\BoletoHolmes\Log;

$logs = iterator_to_array(Log::query([
    "after" => "2020-07-01",
    "before" => "2020-07-30"
]));

foreach($logs as $log){
    print_r($log);
}
  

Java

import com.starkbank.*;
import java.util.HashMap;
import com.starkbank.utils.Generator;

HashMap<String, Object> params = new HashMap<>();
params.put("after", "2020-07-01");
params.put("before", "2020-07-30");
Generator<BoletoHolmes.Log> logs = BoletoHolmes.Log.query(params);

for (BoletoHolmes.Log log : logs){
    System.out.println(log);
}
  

Ruby

require('starkbank')

logs = StarkBank::BoletoHolmes::Log.query(
    after: '2020-07-01',
    before: '2020-07-30'
).to_a

logs.each do |log|
    puts log
end
  

Elixir

logs = StarkBank.BoletoHolmes.Log.query!(
    after: "2020-07-01",
    before: "2020-07-30"
)

for log <- logs do
    log |> IO.inspect
end
  

C#

using System;
using System.Collections.Generic;

IEnumerable<StarkBank.BoletoHolmes.Log> logs = StarkBank.BoletoHolmes.Log.Query(
    after: new DateTime(2020, 7, 1),
    before: new DateTime(2020, 7, 30)
);

foreach(StarkBank.BoletoHolmes.Log log in logs)
{
    Console.WriteLine(log);
}
  

Go

package main

import (
    "fmt"
    "time"
    "github.com/starkbank/sdk-go/starkbank/boletoholmes/log"
)

func main() {

    var params = map[string]interface{}{}
    params["after"] = time.Date(2020, 7, 1, 0, 0, 0, 0, time.UTC)
    params["before"] = time.Date(2020, 7, 30, 0, 0, 0, 0, time.UTC)

    logs, errorChannel := log.Query(params, nil)

    loop:
    for {
        select {
        case err := <-errorChannel:
            if err.Errors != nil {
                for _, e := range err.Errors {
                    fmt.Printf("code: %s, message: %s", e.Code, e.Message)
                }
            }
        case log, ok := <-logs:
            if !ok {
                break loop
            }
            fmt.Printf("%+v", log)
        }
    }
}
  

Clojure

(def logs (starkbank.boleto-holmes.log/query {:after "2020-07-01", :before "2020-07-30"}))

(doseq [log logs]
    (println log))
  

Curl

curl --location --request GET '{{baseUrl}}/v2/boleto-holmes/log?after=2020-07-01&before=2020-07-30' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}'
  
RESPONSE

Python

Log(
    id=1010101010101010,
    created=2020-07-24 17:58:32.075347,
    type=solved,
    holmes=BoletoHolmes(
        boleto_id=5656565656565656,
        created=2020-07-23 00:07:51.069587,
        id=3232323232323232,
        result=paid,
        status=solved,
        tags=["sherlock", "holmes"],
        updated=2020-07-23 00:07:51.069597
    ),
    updated=2020-07-24 17:58:32.075347,
)
  

Javascript

Log {
    id: '1010101010101010',
    created: '2020-07-24T17:58:06.423525+00:00',
    type: 'solved',
    holmes: {
        boletoId: '5656565656565656',
        created: '2020-07-23T00:07:51.611174+00:00',
        id: '3232323232323232',
        result: 'paid',
        status: 'solved',
        tags: ['sherlock', 'holmes'],
        updated: '2020-07-23T00:07:51.611174+00:00'
    },
    updated: '2020-07-24T17:58:06.423525+00:00',
}
  

PHP

StarkBank\BoletoHolmes\Log Object
(
    [id] => 1010101010101010
    [holmes] => StarkBank\BoletoHolmes Object
        (
            [id] => 3232323232323232
            [boletoId] => 5656565656565656
            [tags] => Array
                (
                    [0] => sherlock
                    [1] => holmes
                )

            [status] => solved
            [result] => paid
            [created] => DateTime Object
                (
                    [date] => 2020-07-23 00:07:51.532473
                    [timezone_type] => 1
                    [timezone] => +00:00
                )
            [updated] => DateTime Object
                (
                    [date] => 2020-07-23 00:07:51.532473
                    [timezone_type] => 1
                    [timezone] => +00:00
                )

        )

    [type] => solved
    [created] => DateTime Object
        (
            [date] => 2020-07-24 17:58:01.424426
            [timezone_type] => 1
            [timezone] => +00:00
        )
    [updated] => DateTime Object
        (
            [date] => 2020-07-24 17:58:01.424426
            [timezone_type] => 1
            [timezone] => +00:00
        )

)
  

Java

Log({
    "created": "2020-07-24T17:58:01.459913+00:00",
    "updated": "2020-07-24T17:58:01.459913+00:00",
    "type": "solved",
    "holmes": {
        "tags": [
        "sherlock",
        "holmes"
        ],
        "boletoId": "5656565656565656",
        "status": "solved",
        "result": "paid",
        "created": "2020-07-23T00:07:51.176283+00:00",
        "updated": "2020-07-23T00:07:51.127831+00:00",
        "id": "3232323232323232"
    },
    "id": "1010101010101010"
})
  

Ruby

log(
    id: 1010101010101010,
    holmes: boletoholmes(
        id: 3232323232323232,
        boleto_id: 5656565656565656,
        tags: ["sherlock", "holmes"],
        status: solved,
        result: paid,
        created: 2020-07-23T00:07:51+00:00,
        updated: 2020-07-23T00:07:51+00:00
    ),
    type: solved,
    created: 2020-04-27T17:58:01+00:00,
    updated: 2020-04-27T17:58:01+00:00
)
  

Elixir

%StarkBank.BoletoHolmes.Log{
    created: ~U[2020-07-24 17:58:01.030661Z],
    updated: ~U[2020-07-24 17:58:01.030661Z],
    holmes: %StarkBank.BoletoHolmes{
        boleto_id: "5656565656565656",
        created: ~U[2020-07-23 00:07:51.256963Z],
        id: "3232323232323232",
        result: "paid",
        status: "solved",
        tags: ["sherlock", "holmes"],
        updated: ~U[2020-07-23 00:07:51.438203Z]
    },
    id: "1010101010101010",
    type: "solved"
}
  

C#

Log(
    ID: 1010101010101010,
    Created: 24/07/2020 17:58:52,
    Updated: 24/07/2020 17:58:52,
    Type: solved,
    Holmes: BoletoHolmes(
        BoletoID: '5656565656565656',
        Created: 07/23/2020 00:07:51,
        ID: 3232323232323232,
        Result: paid,
        Status: solved,
        Tags: { sherlock, holmes },
        Updated: 07/23/2020 00:07:51,
    )
)
  

Go

{
    Id:1010101010101010
    Holmes:{
        Id:3232323232323232
        BoletoId:5656565656565656
        Tags:[sherlock holmes]
        Status:solved
        Result:paid
        Created:2020-07-23 00:07:51.581547 +0000 +0000
        Updated:2020-07-23 00:07:51.860171 +0000 +0000
    }
    Errors:[]
    Type:solved
    Created:2020-04-27 17:58:01.602964 +0000 +0000
    Updated:2020-04-27 17:58:01.602964 +0000 +0000
}
  

Clojure

{
    :id 1010101010101010,
    :created 2020-07-24T17:58:01.743039+00:00,
    :updated 2020-07-24T17:58:01.743039+00:00,
    :type solved,
    :holmes {
        :id 3232323232323232,
        :boleto-id 5656565656565656,
        :status solved,
        :result paid,
        :tags [sherlock holmes],
        :created 2020-07-23T00:07:51.467925+00:00,
        :updated 2020-07-23T00:07:51.294078+00:00
    }
}
  

Curl

{
    "cursor": null,
    "logs": [
        {
            "id": "1010101010101010",
            "created": "2020-07-24T17:58:08.338233+00:00",
            "updated": "2020-07-24T17:58:08.338233+00:00",
            "errors": [],
            "type": "solved",
            "holmes": {
                "boletoId": "5656565656565656",
                "created": "2020-07-23T00:07:51.611174+00:00",
                "id": "3232323232323232",
                "result": "paid",
                "status": "solved",
                "tags": ["sherlock", "holmes"],
                "updated": "2020-07-23T00:07:51.611174+00:00"
            }
        }
    ]
}
  

Get a Boleto Holmes Log

Get a single boleto holmes log by its id.

Parameters

id REQUIRED

Id of the log entity

fields OPTIONAL

List of strings to filter response JSON keys. Not available in the SDKs.

ENDPOINT
GET /v2/boleto-holmes/log/:id
REQUEST

Python

import starkbank

log = starkbank.boletoholmes.log.get("1010101010101010")

print(log)
  

Javascript

const starkbank = require('starkbank');

(async() => {
    let log = await starkbank.boletoHolmes.log.get('1010101010101010');

    console.log(log);
})();
  

PHP

use StarkBank\BoletoHolmes\Log;

$log = Log::get("1010101010101010");

print_r($log)
  

Java

import com.starkbank.*;

BoletoHolmes.Log log = BoletoHolmes.Log.get("1010101010101010");

System.out.println(log);
  

Ruby

require('starkbank')

log = StarkBank::BoletoHolmes::Log.get('1010101010101010')

puts log
  

Elixir

log = StarkBank.BoletoHolmes.Log.get!("1010101010101010")

|> IO.inspect
  

C#

using System;

StarkBank.BoletoHolmes.Log log = StarkBank.BoletoHolmes.Log.Get("1010101010101010");

Console.WriteLine(log);
  

Go

package main

import (
    "fmt"
    "github.com/starkbank/sdk-go/starkbank/boletoholmes/log"
)

func main() {

    log, err := log.Get("6382022373146624", nil)
    if err.Errors != nil {
        for _, e := range err.Errors {
            fmt.Printf("code: %s, message: %s", e.Code, e.Message)
        }
    }

    fmt.Printf("%+v", log)
}
  

Clojure

(def log (starkbank.boleto-holmes.log/get "5702929231118336"))

(println log)
  

Curl

curl --location --request GET '{{baseUrl}}/v2/boleto-holmes/log/1010101010101010' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}'
  
RESPONSE

Python

Log(
    id=1010101010101010,
    created=2020-07-24 17:58:32.075347,
    updated=2020-07-24 17:58:32.075347,
    type=solved,
    holmes=BoletoHolmes(
        boleto_id=5656565656565656,
        created=2020-07-23 00:07:51.069587,
        id=3232323232323232,
        result=paid,
        status=solved,
        tags=["sherlock", "holmes"],
        updated=2020-07-23 00:07:51.069597
    )
)
  

Javascript

Log {
    id: '1010101010101010',
    created: '2020-07-24T17:58:06.423525+00:00',
    updated: '2020-07-24T17:58:06.423525+00:00',
    type: 'solved',
    holmes: {
        boletoId: '5656565656565656',
        created: '2020-07-23T00:07:51.611174+00:00',
        id: '3232323232323232',
        result: 'paid',
        status: 'solved',
        tags: ['sherlock', 'holmes'],
        updated: '2020-07-23T00:07:51.611174+00:00'
    }
}
  

PHP

StarkBank\BoletoHolmes\Log Object
(
    [id] => 1010101010101010
    [holmes] => StarkBank\BoletoHolmes Object
        (
            [id] => 3232323232323232
            [boletoId] => 5656565656565656
            [tags] => Array
                (
                    [0] => sherlock
                    [1] => holmes
                )

            [status] => solved
            [result] => paid
            [created] => DateTime Object
                (
                    [date] => 2020-07-23 00:07:51.532473
                    [timezone_type] => 1
                    [timezone] => +00:00
                )
            [updated] => DateTime Object
                (
                    [date] => 2020-07-23 00:07:51.532473
                    [timezone_type] => 1
                    [timezone] => +00:00
                )

        )

    [type] => solved
    [created] => DateTime Object
        (
            [date] => 2020-07-24 17:58:01.424426
            [timezone_type] => 1
            [timezone] => +00:00
        )
    [updated] => DateTime Object
        (
            [date] => 2020-07-24 17:58:01.424426
            [timezone_type] => 1
            [timezone] => +00:00
        )

)
  

Java

Log({
    "created": "2020-07-24T17:58:01.459913+00:00",
    "updated": "2020-07-24T17:58:01.459913+00:00",
    "type": "solved",
    "holmes": {
        "tags": [
        "sherlock",
        "holmes"
        ],
        "boletoId": "5656565656565656",
        "status": "solved",
        "result": "paid",
        "created": "2020-07-23T00:07:51.176283+00:00",
        "updated": "2020-07-23T00:07:51.127831+00:00",
        "id": "3232323232323232"
    },
    "id": "1010101010101010"
})
  

Ruby

log(
    id: 1010101010101010,
    holmes: boletoholmes(
        id: 3232323232323232,
        boleto_id: 5656565656565656,
        tags: ["sherlock", "holmes"],
        status: solved,
        result: paid,
        created: 2020-07-23T00:07:51+00:00,
        updated: 2020-07-23T00:07:51+00:00
    ),
    type: solved,
    created: 2020-04-27T17:58:01+00:00,
    updated: 2020-04-27T17:58:01+00:00
)
  

Elixir

%StarkBank.BoletoHolmes.Log{
    created: ~U[2020-07-24 17:58:01.030661Z],
    updated: ~U[2020-07-24 17:58:01.030661Z],
    holmes: %StarkBank.BoletoHolmes{
        boleto_id: "5656565656565656",
        created: ~U[2020-07-23 00:07:51.256963Z],
        id: "3232323232323232",
        result: "paid",
        status: "solved",
        tags: ["sherlock", "holmes"],
        updated: ~U[2020-07-23 00:07:51.438203Z]
    },
    id: "1010101010101010",
    type: "solved"
}
  

C#

Log(
    ID: 1010101010101010,
    Created: 07/24/2020 17:58:52,
    Updated: 07/24/2020 17:58:52,
    Type: solved,
    Holmes: BoletoHolmes(
        BoletoID: '5656565656565656',
        Created: 07/23/2020 00:07:51,
        ID: 3232323232323232,
        Result: paid,
        Status: solved,
        Tags: { sherlock, holmes },
        Updated: 07/23/2020 00:07:51,
    )
)
  

Go

{
    Id:1010101010101010
    Holmes:{
        Id:3232323232323232
        BoletoId:5656565656565656
        Tags:[sherlock holmes]
        Status:solved
        Result:paid
        Created:2020-07-23 00:07:51.581547 +0000 +0000
        Updated:2020-07-23 00:07:51.860171 +0000 +0000
    }
    Errors:[]
    Type:solved
    Created:2020-04-27 17:58:01.602964 +0000 +0000
    Updated:2020-04-27 17:58:01.602964 +0000 +0000
}
  

Clojure

{
    :id 1010101010101010,
    :created 2020-07-24T17:58:01.743039+00:00,
    :updated 2020-07-24T17:58:01.743039+00:00,
    :type solved,
    :holmes {
        :id 3232323232323232,
        :boleto-id 5656565656565656,
        :status solved,
        :result paid,
        :tags [sherlock holmes],
        :created 2020-07-23T00:07:51.467925+00:00,
        :updated 2020-07-23T00:07:51.294078+00:00
    }
}
  

Curl

{
    "log": {
        "id": "1010101010101010",
        "created": "2020-07-24T17:58:08.338233+00:00",
        "updated": "2020-07-24T17:58:08.338233+00:00",
        "errors": [],
        "type": "solved",
        "holmes": {
            "boletoId": "5656565656565656",
            "created": "2020-07-23T00:07:51.611174+00:00",
            "id": "3232323232323232",
            "result": "paid",
            "status": "solved",
            "tags": ["sherlock", "holmes"],
            "updated": "2020-07-23T00:07:51.611174+00:00"
        }
    }
}
  

Split

The Split resource is used to split an Invoice or Boleto between different receivers.

The Split object

Attributes

id STRING

Unique id for the split.

amount INTEGER

Split amount in cents.

created STRING

Creation datetime. Example: "2020-04-23T23:00:00.000000+00:00".

externalId STRING

Unique external ID for the split.

receiverId STRING

ID of the split receiver.

scheduled STRING

Scheduled transfer datetime. Example: "2020-04-23T23:00:00.000000+00:00".

source STRING

Source of the split.

status STRING

Current split status.

tags LIST OF STRINGS

Tags associated with the split.

updated STRING

Last update datetime. Example: "2020-04-23T23:00:00.000000+00:00".

List Splits

Get a list of Splits in chunks of at most 100. If you need smaller chunks, use the limit parameter.

Parameters

after OPTIONAL

Filter entities created after this date.

before OPTIONAL

Filter entities created before this date.

cursor OPTIONAL

String used to get the next batch of results. Our SDKs handle this for you.

fields OPTIONAL

List of strings to filter response JSON keys. Not available in the SDKs.

ids OPTIONAL

List of strings to get specific entities by ids.

limit OPTIONAL

Number of results per cursor. Max = 100.

receiverIds OPTIONAL

list of receiver ids to filter retrieved objects. ex: ['5656565656565656', '4545454545454545'].

status OPTIONAL

Filter splits by the specified status.

tags OPTIONAL

Filter entities that contain the specified tags.

ENDPOINT
GET /v2/split
REQUEST

Python

import starkbank

splits = starkbank.split.query(
    after="2024-01-30",
    before="2024-02-01",
    limit=1
)

for split in splits:
    print(split)
  

Javascript

Not yet available. Please contact us if you need this SDK.
  

PHP

use StarkBank\Split;

$splits = iterator_to_array(Split::query(["limit" => 10, "before" => new DateTime("now")]));

foreach($splits as $split) {
  print_r($split);
}
  

Java

import com.starkbank.*;
import java.util.Map;
import java.util.HashMap;

Map params = new HashMap<>();
params.put("limit", 1);

Generator splits = Split.query(params);

for (Split split : splits) {
    System.out.println(split);
}
  

Ruby

Not yet available. Please contact us if you need this SDK.
  

Elixir

Not yet available. Please contact us if you need this SDK.
  

C#

Not yet available. Please contact us if you need this SDK.
  

Go

Not yet available. Please contact us if you need this SDK.
  

Clojure

Not yet available. Please contact us if you need this SDK.
  

Curl

curl --location --request GET '{{baseUrl}}/v2/split?after=2024-01-30&before=2024-02-01' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}'
  
RESPONSE

Python

Split(
	amount=10000,
	created=2024-01-30 16:10:59.874663,
	external_id=invoice/5163468596445184/receiver/5143677177430016,
	id=5745664021495808,
	receiver_id=5143677177430016,
	scheduled=2024-01-30 16:10:59.840821,
	source=invoice/5163468596445184,
	status=created,
	tags=['invoice/5163468596445184'],
	updated=2024-01-30 16:21:03.973723
)  

Javascript

Not yet available. Please contact us if you need this SDK.
  

PHP

StarkBank\Split Object
(
  [id] => 5105697184284672
  [amount] => 159
  [receiverId] => 5706627130851328
  [source] => invoice/4952232030109696
  [externalId] => invoice/4952232030109696/receiver/5706627130851328
  [tags] => Array
      (
          [0] => invoice/4952232030109696
      )

  [scheduled] =>
  [status] => success
  [created] =>
  [updated] =>
)
  

Java

Split({
    "amount": 10000,
    "created": "2024-01-30 16:10:59.874824",
    "external_id": invoice/5163468596445184/receiver/5706627130851328,
    "id": 5182714068074496,
    "receiver_id": 5706627130851328,
    "scheduled": "2024-01-30 16:10:59.840821",
    "source": invoice/5163468596445184,
    "status": created,
    "tags": ['invoice/5163468596445184'],
    "updated": 2024-01-30 16:10:59.874829
})
  

Ruby

Not yet available. Please contact us if you need this SDK.
  

Elixir

Not yet available. Please contact us if you need this SDK.
  

C#

Not yet available. Please contact us if you need this SDK.
  

Go

Not yet available. Please contact us if you need this SDK.
  

Clojure

Not yet available. Please contact us if you need this SDK.
  

Curl

{
    "cursor": null,
    "splits": [
        {
            "amount": 10000,
            "created": "2023-10-23T23:40:04.809130+00:00",
            "externalId": "invoice/6394476721340416/receiver/5644004762845184",
            "id": "5714489739575296",
            "receiverId": "5644004762845184",
            "scheduled": "2023-11-01T10:00:00+00:00",
            "source": "invoice/6394476721340416",
            "status": "success",
            "tags": [],
            "updated": "2023-11-01T09:51:02.985959+00:00"
        }
    ]
}
  

Get a Split

Get a single Split by its id.

Parameters

id REQUIRED

Id of the Split entity

fields OPTIONAL

List of strings to filter response JSON keys. Not available in the SDKs.

ENDPOINT
GET /v2/split/:id
REQUEST

Python

import starkbank

split = starkbank.split.get("5155165527080960")

print(split)

  

Javascript

Not yet available. Please contact us if you need this SDK.
  

PHP

use StarkBank\Split;

$split = Split::get("5155165527080960");

print_r($split);
  

Java

import com.starkbank.*;

Split split = Split.get("5155165527080960");

System.out.println(split);
  

Ruby

Not yet available. Please contact us if you need this SDK.
  

Elixir

Not yet available. Please contact us if you need this SDK.
  

C#

Not yet available. Please contact us if you need this SDK.
  

Go

Not yet available. Please contact us if you need this SDK.
  

Clojure

Not yet available. Please contact us if you need this SDK.
  

Curl

curl --location --request GET '{{baseUrl}}/v2/split/5155165527080960' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}'
  
RESPONSE

Python

Split(
	amount=10000,
	created=2024-01-30 16:10:59.874824,
	external_id=invoice/5163468596445184/receiver/5706627130851328,
	id=5155165527080960,
	receiver_id=5706627130851328,
	scheduled=2024-01-30 16:10:59.840821,
	source=invoice/5163468596445184,
	status=created,
	tags=['invoice/5163468596445184'],
	updated=2024-01-30 16:10:59.874829
)
  

Javascript

Not yet available. Please contact us if you need this SDK.
    

PHP

StarkBank\Split Object
(
  [id] => 5155165527080960
  [amount] => 159
  [receiverId] => 5706627130851328
  [source] => invoice/4952232030109696
  [externalId] => invoice/4952232030109696/receiver/5706627130851328
  [tags] => Array
      (
          [0] => invoice/4952232030109696
      )

  [scheduled] =>
  [status] => success
  [created] =>
  [updated] =>
)
  

Java

Split({
    "amount": 10000,
    "created": "2024-01-30 16:10:59.874824",
    "external_id": invoice/5163468596445184/receiver/5706627130851328,
    "id": 5155165527080960,
    "receiver_id": 5706627130851328,
    "scheduled": "2024-01-30 16:10:59.840821",
    "source": invoice/5163468596445184,
    "status": created,
    "tags": ['invoice/5163468596445184'],
    "updated": 2024-01-30 16:10:59.874829
})
  

Ruby

Not yet available. Please contact us if you need this SDK.
  

Elixir

Not yet available. Please contact us if you need this SDK.
}
  

C#

Not yet available. Please contact us if you need this SDK.

  

Go

Not yet available. Please contact us if you need this SDK.
  

Clojure

Not yet available. Please contact us if you need this SDK.
  

Curl

{
    "split": {
        "amount": 10000,
        "created": "2024-01-30 16:10:59.874824",
        "external_id": invoice/5163468596445184/receiver/5706627130851328,
        "id": 5155165527080960,
        "receiver_id": 5706627130851328,
        "scheduled": "2024-01-30 16:10:59.840821",
        "source": invoice/5163468596445184,
        "status": created,
        "tags": ['invoice/5163468596445184'],
        "updated": 2024-01-30 16:10:59.874829
    }
}
  

List Split Logs

Get a paged list of Split logs. A log tracks a change in the Split entity according to its life cycle.

Parameters

after OPTIONAL

Filter entities created after this date.

before OPTIONAL

Filter entities created before this date.

cursor OPTIONAL

String used to get the next batch of results. Our SDKs handle this for you.

fields OPTIONAL

List of strings to filter response JSON keys. Not available in the SDKs.

limit OPTIONAL

Number of results per cursor. Max = 100.

splitIds OPTIONAL

Array of Split ids that are linked to the logs you desire.

types OPTIONAL

Filters logs by log types.

ENDPOINT
GET /v2/split/log
REQUEST

Python

import starkbank

logs = starkbank.split.log.query(
    after="2020-10-01",
    before="2020-10-30"
)
for log in logs:
  print(log)
  

Javascript

Not yet available. Please contact us if you need this SDK.
  

PHP

use StarkBank\Split\Log;

$splitLogs = iterator_to_array(Log::query(["limit" => 10]));

foreach($splitLogs as log) {
  print_r($log);
}
  

Java

import com.starkbank.*;
import java.util.Map;
import java.util.HashMap;

Map params = new HashMap<>();
params.put("limit", 1);

Generator logs = split.Log.query(params);

for (Split.Log log : logs) {
    System.out.println(log);
}
  

Ruby

Not yet available. Please contact us if you need this SDK.
  

Elixir

Not yet available. Please contact us if you need this SDK.
  

C#

Not yet available. Please contact us if you need this SDK.
  

Go

Not yet available. Please contact us if you need this SDK.
  

Clojure

Not yet available. Please contact us if you need this SDK.
  

Curl

curl --location --request GET '{{baseUrl}}/v2/split-receiver/log?limit=1' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}'
  
RESPONSE

Python

Log(
	created=2024-01-30 16:21:03.459601,
	errors=None,
	id=5659211052613632,
	split=Split(
		amount=10000,
		created=2024-01-30 16:10:59.874663,
		external_id=invoice/5163468596445184/receiver/5143677177430016,
		id=5745664021495808,
		receiver_id=5143677177430016,
		scheduled=2024-01-30 16:10:59.840821,
		source=invoice/5163468596445184,
		status=created,
		tags=['invoice/5163468596445184'],
		updated=2024-01-30 16:21:04.002158
	),
	type=created
)
  

Javascript

Not yet available. Please contact us if you need this SDK.
  

PHP

StarkBank\Split\Log Object
(
    [id] => 5730447380185088
    [created] => DateTime Object
        (
            [date] => 2024-03-08 10:10:07.198713
            [timezone_type] => 1
            [timezone] => +00:00
        )

    [type] => success
    [errors] =>
    [split] => StarkBank\Split Object
        (
            [id] => 5128899402924032
            [amount] => 37
            [receiverId] => 5706627130851328
            [source] => invoice/5120509326917632
            [externalId] => invoice/5120509326917632/receiver/5706627130851328
            [tags] => Array
                (
                    [0] => invoice/5120509326917632
                )

            [scheduled] =>
            [status] => success
            [created] =>
            [updated] =>
        )

)
  

Java

Log({
    "created": "2024-01-30T20:32:56.214350+00:00",
    "id": "5079983684845568",
    "split": {
        "amount": 10000,
        "created": "2023-10-23T23:40:04.809130+00:00",
        "externalId": "invoice/6394476721340416/receiver/5644004762845184",
        "id": "5714489739575296",
        "receiverId": "5644004762845184",
        "scheduled": "2023-11-01T10:00:00+00:00",
        "source": "invoice/6394476721340416",
        "status": "success",
        "tags": [],
        "updated": "2023-11-01T09:51:03.015157+00:00"
    },
"type": "success"
})
  

Ruby

Not yet available. Please contact us if you need this SDK.
  

Elixir

Not yet available. Please contact us if you need this SDK.
  

C#

Not yet available. Please contact us if you need this SDK.
  

Go

Not yet available. Please contact us if you need this SDK.
  

Clojure

Not yet available. Please contact us if you need this SDK.
  

Curl

{
    "cursor": null,
    "logs": [
        {
            "created": "2023-11-01T09:51:02.882114+00:00",
            "id": "5729450050191360",
            "split": {
                "amount": 10000,
                "created": "2023-10-23T23:40:04.809130+00:00",
                "externalId": "invoice/6394476721340416/receiver/5644004762845184",
                "id": "5714489739575296",
                "receiverId": "5644004762845184",
                "scheduled": "2023-11-01T10:00:00+00:00",
                "source": "invoice/6394476721340416",
                "status": "success",
                "tags": [],
                "updated": "2023-11-01T09:51:03.015157+00:00"
            },
            "type": "success"
        }
    ]
}
  

Get a Split Log

Get a single Split Log by its id.

Parameters

id REQUIRED

Id of the log entity.

fields OPTIONAL

List of strings to filter response JSON keys. Not available in the SDKs.

ENDPOINT
GET /v2/split/log/:id
REQUEST

Python

import starkbank

log = starkbank.split.log.get("5729450050191360")

print(log)
  

Javascript

Not yet available. Please contact us if you need this SDK.
  

PHP

use StarkBank\Split\Log;

$splitLog = Log::get("5729450050191360");
print_r($splitLog);
  

Java

import com.starkbank.*;

Split.Log log = Split.Log.get("5729450050191360");

System.out.println(log);
  

Ruby

Not yet available. Please contact us if you need this SDK.
  

Elixir

Not yet available. Please contact us if you need this SDK.
  

C#

Not yet available. Please contact us if you need this SDK.
  

Go

Not yet available. Please contact us if you need this SDK.
  

Clojure

Not yet available. Please contact us if you need this SDK.
  

Curl

curl --location --request GET '{{baseUrl}}/v2/split/log/5729450050191360' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}'
  
RESPONSE

Python

Log(
	created=2024-01-30 16:21:03.459601,
	errors=None,
	id=5729450050191360,
	split=Split(
		amount=10000,
		created=2024-01-30 16:10:59.874663,
		external_id=invoice/5163468596445184/receiver/5143677177430016,
		id=5745664021495808,
		receiver_id=5143677177430016,
		scheduled=2024-01-30 16:10:59.840821,
		source=invoice/5163468596445184,
		status=success,
		tags=['invoice/5163468596445184'],
		updated=2024-01-30 16:21:04.002158
	),
	type=success
)
  

Javascript

Not yet available. Please contact us if you need this SDK.
  

PHP

StarkBank\Split\Log Object
(
    [id] => 5729450050191360
    [created] => DateTime Object
        (
            [date] => 2024-03-08 10:10:07.198713
            [timezone_type] => 1
            [timezone] => +00:00
        )

    [type] => success
    [errors] =>
    [split] => StarkBank\Split Object
        (
            [id] => 5128899402924032
            [amount] => 37
            [receiverId] => 5706627130851328
            [source] => invoice/5120509326917632
            [externalId] => invoice/5120509326917632/receiver/5706627130851328
            [tags] => Array
                (
                    [0] => invoice/5120509326917632
                )

            [scheduled] =>
            [status] => success
            [created] =>
            [updated] =>
        )

)
  

Java

Log({
	"created": "2024-01-30 16:21:03.459601",
	"errors": None,
	"id": 5729450050191360,
	"split": Split({
		"amount": 10000,
		"created":" 2024-01-30 16:10:59.874663",
		"external_id": invoice/5163468596445184/receiver/5143677177430016,
		"id": 5745664021495808,
		"receiver_id": 5143677177430016,
		"scheduled": "2024-01-30 16:10:59.840821",
		"source": invoice/5163468596445184,
		"status": success,
		"tags": ['invoice/5163468596445184'],
		"updated": "2024-01-30 16:21:04.002158"
	}),
	"type": success
})
  

Ruby

Not yet available. Please contact us if you need this SDK.
  

Elixir

Not yet available. Please contact us if you need this SDK.
  

C#

Not yet available. Please contact us if you need this SDK.
  

Go

Not yet available. Please contact us if you need this SDK.
  

Clojure

Not yet available. Please contact us if you need this SDK.
  

Curl

{
    "cursor": null,
    "logs": [
        {
            "created": "2023-11-01T09:51:02.882114+00:00",
            "id": "5729450050191360",
            "split": {
                "amount": 10000,
                "created": "2023-10-23T23:40:04.809130+00:00",
                "externalId": "invoice/6394476721340416/receiver/5644004762845184",
                "id": "6742710681600000",
                "receiverId": "5644004762845184",
                "scheduled": "2023-11-01T10:00:00+00:00",
                "source": "invoice/6394476721340416",
                "status": "success",
                "tags": [],
                "updated": "2023-11-01T09:51:03.015157+00:00"
            },
            "type": "success"
        }
    ]
}
  

Split Receiver

You can create a Receiver to an Invoice or Boleto split by using the Split Receiver resource.

The Split Receiver object

Attributes

id STRING

Unique id for the split receiver.

accountNumber STRING

Receiver bank account number.

accountType STRING

Receiver bank account type. Options: "checking", "savings", "salary", "payment".

bankCode STRING

Receiver bank code or ISPB.

branchCode STRING

Receiver bank account branch.

created STRING

Creation datetime. Example: "2020-04-23T23:00:00.000000+00:00".

name STRING

Receiver full name.

status STRING

Current split receiver status.

tags LIST OF STRINGS

Tags associated with the split receiver.

taxId STRING

Receiver CPF or CNPJ.

updated STRING

Last update datetime. Example: "2020-04-23T23:00:00.000000+00:00".

Create Split Receiver

Send a list of Split Receiver objects for creation in the Stark Bank API

Parameters

accountNumber REQUIRED

receiver bank account number. Use '-' before the verifier digit. ex: '876543-2'

accountType REQUIRED

Receiver bank account type. This parameter only has effect on Pix SplitReceivers. ex: 'checking', 'savings', 'salary' or 'payment'

bankCode REQUIRED

Code of the receiver bank institution in Brazil. If an ISPB (8 digits) is informed, a PIX splitReceiver will be created, else a Ted will be issued. ex: '20018183' or '341'

branchCode REQUIRED

Receiver bank account branch. Use '-' in case there is a verifier digit. ex: '1357-9'

name REQUIRED

Receiver full name. ex: 'Anthony Edward Stark'

taxId REQUIRED

Receiver account tax ID (CPF or CNPJ) with or without formatting. ex: '01234567890' or '20.018.183/0001-80'

tags OPTIONAL

list of strings for reference when searching for receivers. ex: ['seller/123456']

ENDPOINT
POST /v2/split-receiver
REQUEST

Python

import starkbank

receiver = starkbank.splitreceiver.create(
      receiver=starkbank.SplitReceiver(
        name="Daenerys Targaryen Stormborn",
        tax_id="594.739.480-42",
        bank_code="665",
        branch_code="2201",
        account_number="76543-8",
        account_type="salary"
    )
)

print(receiver)  

Javascript

Not yet available. Please contact us if you need this SDK.
  

PHP

use StarkBank\SplitReceiver;

$receivers = [
  new SplitReceiver([
      "name"=> "John Snow",
      "taxId"=> "01234567890",
      "bankCode"=> "18236120",
      "branchCode"=> "0001",
      "accountNumber"=> "10000-0",
      "accountType"=> "checking",
      "tags"=> ["war supplies"],
  ]),
  new SplitReceiver([
      "name"=> "Arya Stark",
      "taxId"=> "01234567890",
      "bankCode"=> "18236120",
      "branchCode"=> "0001",
      "accountNumber"=> "10000-0",
      "accountType"=> "checking",
      "tags"=> ["war supplies"],
  ]),
];
$receivers = SplitReceiver::create($receivers);

print_r($receivers);
  

Java

import com.starkbank.*;
import java.util.Map;
import java.util.List;
import java.util.HashMap;
import java.util.ArrayList;

Map<String, Object> data = new HashMap<>();
data.put("name", "Daenerys Targaryen Stormborn");
data.put("taxId", "594.739.480-42");
data.put("bankCode", "665");
data.put("branchCode", "2201");
data.put("accountNumber", "76543-8");
data.put("accountType", "salary");

SplitReceiver receiver = SplitReceiver.create(new SplitReceiver(data));

System.out.println(receiver);  

Ruby

Not yet available. Please contact us if you need this SDK.
  

Elixir

Not yet available. Please contact us if you need this SDK.
  

C#

Not yet available. Please contact us if you need this SDK.
  

Go

Not yet available. Please contact us if you need this SDK.
  

Clojure

Not yet available. Please contact us if you need this SDK.
  

Curl

curl --location --request POST '{{baseUrl}}/v2/split-receiver' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}' 
--header 'Content-Type: application/json' 
--data-raw '{
    "receivers": [
        {
            "name": "Daenerys Targaryen Stormborn",
            "taxId": "594.739.480-42",
            "bankCode": "665",
            "branchCode": "2201",
            "accountNumber": "76543-8",
            "accountType": "salary"
        }
    ]
}'
  
RESPONSE

Python

SplitReceiver(
	account_number=76543-8,
	account_type=salary,
	bank_code=665,
	branch_code=2201,
	created=2024-01-30 20:17:12.586145,
	id=5710191014182912,
	name=Daenerys Targaryen Stormborn,
	status=created,
	tags=[],
	tax_id=594.739.480-42,
	updated=2024-01-30 20:17:12.586152
)
  

Javascript

Not yet available. Please contact us if you need this SDK.
        

PHP

(
  [0] => StarkBank\SplitReceiver Object
      (
          [id] => 5741077466185728
          [name] => John Snow
          [taxId] => 012.345.678-90
          [bankCode] => 18236120
          [branchCode] => 0001
          [accountNumber] => 10000-0
          [accountType] => checking
          [tags] => Array
              (
                  [0] => war supplies
              )

          [status] => created
          [created] => DateTime Object
              (
                  [date] => 2024-03-08 19:34:38.416934
                  [timezone_type] => 1
                  [timezone] => +00:00
              )

          [updated] =>
      )

  [1] => StarkBank\SplitReceiver Object
      (
          [id] => 5178127512764416
          [name] => Arya Stark
          [taxId] => 012.345.678-90
          [bankCode] => 18236120
          [branchCode] => 0001
          [accountNumber] => 10000-0
          [accountType] => checking
          [tags] => Array
              (
                  [0] => war supplies
              )

          [status] => created
          [created] => DateTime Object
              (
                  [date] => 2024-03-08 19:34:38.417140
                  [timezone_type] => 1
                  [timezone] => +00:00
              )

          [updated] =>
      )

)
  

Java

SplitReceiver({
	"accountNumber": 76543-8,
	"accountType": salary,
	"bankCode": 665,
	"branchCode": 2201,
	"created": 2024-01-30 20:17:12.586145,
	"id": 5710191014182912,
	"name": Daenerys Targaryen Stormborn,
	"status": created,
	"tags": [],
	"taxId": 594.739.480-42,
	"updated": 2024-01-30 20:17:12.586152
})
  

Ruby

Not yet available. Please contact us if you need this SDK.
  

Elixir

Not yet available. Please contact us if you need this SDK.
  

C#

Not yet available. Please contact us if you need this SDK.
  

Go

Not yet available. Please contact us if you need this SDK.
  

Clojure

Not yet available. Please contact us if you need this SDK.
  

Curl

{
    "receivers": [
        {
            "accountNumber": "76543-8",
            "accountType": "salary",
            "bankCode": "665",
            "branchCode": "2201",
            "created": "2024-01-30T20:32:56.182031+00:00",
            "id": "5642933638266880",
            "name": "Daenerys Targaryen Stormborn",
            "status": "created",
            "tags": [],
            "taxId": "594.739.480-42",
            "updated": "2024-01-30T20:32:56.182039+00:00"
        }
    ]
}
  

List Split Receivers

Get a list of Split Receivers in chunks of at most 100. If you need smaller chunks, use the limit parameter.

Parameters

after OPTIONAL

Filter entities created after this date.

before OPTIONAL

Filter entities created before this date.

cursor OPTIONAL

String used to get the next batch of results. Our SDKs handle this for you.

fields OPTIONAL

List of strings to filter response JSON keys. Not available in the SDKs.

ids OPTIONAL

List of strings to get specific entities by ids.

limit OPTIONAL

Number of results per cursor. Max = 100.

receiverIds OPTIONAL

List of receiver ids to filter retrieved objects. ex: ['5656565656565656', '4545454545454545'].

status OPTIONAL

Filter split receivers by the specified status.

tags OPTIONAL

Filter entities that contain the specified tags.

taxId OPTIONAL

filter for splitReceivers sent to the specified tax ID. ex: '012.345.678-90'

transactionIds OPTIONAL

List of transaction IDs linked to the desired splitReceivers. ex: ['5656565656565656', '4545454545454545']

ENDPOINT
GET /v2/split-receiver
REQUEST

Python

import starkbank

receivers = starkbank.splitreceiver.query(limit=1)

for receiver in receivers:
    print(receiver)
  

Javascript

Not yet available. Please contact us if you need this SDK.
  

PHP

use StarkBank\SplitReceiver;

$splitReceivers = iterator_to_array(SplitReceiver::query(["limit" => 10, "before" => new DateTime("now")]));
foreach($splitReceivers as $splitReceiver) {
  print_r($splitReceiver);
}
  

Java

import com.starkbank.*;
import java.util.Map;
import java.util.HashMap;

Map params = new HashMap<>();
params.put("limit", 1);

Generator receivers = SplitReceiver.query(params);

for (SplitReceiver receiver : receivers) {
    System.out.println(receiver);
}
  

Ruby

Not yet available. Please contact us if you need this SDK.
  

Elixir

Not yet available. Please contact us if you need this SDK.
  

C#

Not yet available. Please contact us if you need this SDK.
  

Go

Not yet available. Please contact us if you need this SDK.
  

Clojure

Not yet available. Please contact us if you need this SDK.
  

Curl

curl --location --request GET '{{baseUrl}}/v2/split-receiver?after=2024-01-01&before=2024-12-01' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}'
  
RESPONSE

Python

SplitReceiver(
	account_number=73068305-0,
	account_type=salary,
	bank_code=18236120,
	branch_code=250,
	created=2024-01-30 20:17:12.586344,
	id=5147241060761600,
	name=Lucille Jette,
	status=created,
	tags=[],
	tax_id=949.887.518-99,
	updated=2024-01-30 20:17:13.685002
)
  

Javascript

Not yet available. Please contact us if you need this SDK.
    

PHP

StarkBank\SplitReceiver Object
(
    [id] => 5077405228072960
    [name] => Arya Stark
    [taxId] => 012.345.678-90
    [bankCode] => 18236120
    [branchCode] => 0001
    [accountNumber] => 10000-0
    [accountType] => checking
    [tags] => Array
        (
            [0] => war supplies
        )

    [status] => created
    [created] => DateTime Object
        (
            [date] => 2024-03-08 19:35:29.107252
            [timezone_type] => 1
            [timezone] => +00:00
        )

    [updated] =>
)
  

Java

SplitReceiver({
    "accountNumber": "76543-8",
    "accountType": "salary",
    "bankCode": "665",
    "branchCode": "2201",
    "created": "2024-01-30T20:32:56.182031+00:00",
    "id": "5642933638266880",
    "name": "Daenerys Targaryen Stormborn",
    "status": "created",
    "tags": [],
    "taxId": "594.739.480-42",
    "updated": "2024-01-30T20:32:56.310309+00:00"

})
  

Ruby

Not yet available. Please contact us if you need this SDK.
  

Elixir

Not yet available. Please contact us if you need this SDK.
}
  

C#

Not yet available. Please contact us if you need this SDK.

  

Go

Not yet available. Please contact us if you need this SDK.
  

Clojure

Not yet available. Please contact us if you need this SDK.
  

Curl

{
    "cursor": null,
    "receivers": [
        {
            "accountNumber": "76543-8",
            "accountType": "salary",
            "bankCode": "665",
            "branchCode": "2201",
            "created": "2024-01-30T20:32:56.182031+00:00",
            "id": "5642933638266880",
            "name": "Daenerys Targaryen Stormborn",
            "status": "created",
            "tags": [],
            "taxId": "594.739.480-42",
            "updated": "2024-01-30T20:32:56.310309+00:00"
        }
    ]
}
  

Get a Split Receiver

Retrieve a single Split Receiver object previously created in the Stark Bank API by its id.

Parameters

id REQUIRED

Id of the Split Receiver entity

fields OPTIONAL

List of strings to filter response JSON keys. Not available in the SDKs.

ENDPOINT
GET /v2/split-receiver/:id
REQUEST

Python

import starkbank

receiver = starkbank.splitreceiver.get("5155165527080960")

print(receiver)
  

Javascript

Not yet available. Please contact us if you need this SDK.
  

PHP

use StarkBank\SplitReceiver;

$splitReceiver = SplitReceiver::get("5155165527080960");

print_r($splitReceiver);
  

Java

import com.starkbank.*;

SplitReceiver receiver = SplitReceiver.get("5155165527080960");

System.out.println(receiver);
  

Ruby

Not yet available. Please contact us if you need this SDK.
  

Elixir

Not yet available. Please contact us if you need this SDK.
  

C#

Not yet available. Please contact us if you need this SDK.
  

Go

Not yet available. Please contact us if you need this SDK.
  

Clojure

Not yet available. Please contact us if you need this SDK.
  

Curl

curl --location --request GET '{{baseUrl}}/v2/split-receiver/5155165527080960' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}'
  
RESPONSE

Python

SplitReceiver(
	account_number=73068305-0,
	account_type=salary,
	bank_code=18236120,
	branch_code=250,
	created=2024-01-30 20:17:12.586344,
	id=5155165527080960,
	name=Lucille Jette,
	status=created,
	tags=[],
	tax_id=949.887.518-99,
	updated=2024-01-30 20:17:13.685002
)
  

Javascript

Not yet available. Please contact us if you need this SDK.
    

PHP

StarkBank\SplitReceiver Object
(
    [id] => 5155165527080960
    [name] => Arya Stark
    [taxId] => 012.345.678-90
    [bankCode] => 18236120
    [branchCode] => 0001
    [accountNumber] => 10000-0
    [accountType] => checking
    [tags] => Array
        (
            [0] => war supplies
        )

    [status] => created
    [created] => DateTime Object
        (
            [date] => 2024-03-08 19:35:29.107252
            [timezone_type] => 1
            [timezone] => +00:00
        )

    [updated] =>
)
  

Java

SplitReceiver({
    "accountNumber": "76543-8",
    "accountType": "salary",
    "bankCode": "665",
    "branchCode": "2201",
    "created": "2024-01-30T20:32:56.182031+00:00",
    "id": "5155165527080960",
    "name": "Daenerys Targaryen Stormborn",
    "status": "created",
    "tags": [],
    "taxId": "594.739.480-42",
    "updated": "2024-01-30T20:32:56.310309+00:00"

})
  

Ruby

Not yet available. Please contact us if you need this SDK.
  

Elixir

Not yet available. Please contact us if you need this SDK.
}
  

C#

Not yet available. Please contact us if you need this SDK.

  

Go

Not yet available. Please contact us if you need this SDK.
  

Clojure

Not yet available. Please contact us if you need this SDK.
  

Curl

{
    "receiver": {
        "accountNumber": "76543-8",
        "accountType": "salary",
        "bankCode": "665",
        "branchCode": "2201",
        "created": "2024-01-30T20:32:56.182031+00:00",
        "id": "5155165527080960",
        "name": "Daenerys Targaryen Stormborn",
        "status": "created",
        "tags": [],
        "taxId": "594.739.480-42",
        "updated": "2024-01-30T20:32:56.310309+00:00"
    }
}  

List Split Receiver Logs

Get a paged list of Split Receiver logs. A log tracks a change in the Split Receiver entity according to its life cycle.

Parameters

after OPTIONAL

Filter entities created after this date.

before OPTIONAL

Filter entities created before this date.

cursor OPTIONAL

String used to get the next batch of results. Our SDKs handle this for you.

fields OPTIONAL

List of strings to filter response JSON keys. Not available in the SDKs.

limit OPTIONAL

Number of results per cursor. Max = 100.

receiverIds OPTIONAL

List of Split Receiver ids to filter retrieved objects. ex: ['5656565656565656', '4545454545454545'].

types OPTIONAL

filter retrieved objects by event types. ex: 'processing' or 'success'

ENDPOINT
GET /v2/split-receiver/log
REQUEST

Python

import starkbank

log = starkbank.splitreceiver.log.get(
    after="2024-10-30",
    before="2024-10-01"
)

print(log)
  

Javascript

Not yet available. Please contact us if you need this SDK.
  

PHP

use StarkBank\SplitReceiver\Log;

$splitReceiverLogs = iterator_to_array(Log::query(["limit" => 10]));

foreach($splitReceiverLogs as log) {
  print_r($log);
}
    

Java

import com.starkbank.*;
import java.util.Map;
import java.util.HashMap;

Map params = new HashMap<>();
params.put("limit", 1);

Generator logs = SplitReceiver.Log.query(params);

for (Split.Log log : logs) {
    System.out.println(log);
}
  

Ruby

Not yet available. Please contact us if you need this SDK.
  

Elixir

Not yet available. Please contact us if you need this SDK.
  

C#

Not yet available. Please contact us if you need this SDK.
  

Go

Not yet available. Please contact us if you need this SDK.
  

Clojure

Not yet available. Please contact us if you need this SDK.
  

Curl

curl --location --request GET '{{baseUrl}}/v2/split-receiver/log?limit=1' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}'
  
RESPONSE

Python

Log(
	created=2024-01-30 20:17:12.611535,
	errors=None,
	id=4865766084050944,
	receiver=SplitReceiver(
		account_number=73068305-0,
		account_type=salary,
		bank_code=18236120,
		branch_code=250,
		created=2024-01-30 20:17:12.586344,
		id=5147241060761600,
		name=Lucille Jette,
		status=created,
		tags=[],
		tax_id=949.887.518-99,
		updated=2024-01-30 20:17:13.712424
	),
	type=created
)  

Javascript

Not yet available. Please contact us if you need this SDK.
  

PHP

StarkBank\SplitReceiver\Log Object
(
    [id] => 4795930251362304
    [created] => DateTime Object
        (
            [date] => 2024-03-08 19:35:29.140174
            [timezone_type] => 1
            [timezone] => +00:00
        )

    [type] => created
    [errors] =>
    [splitReceiver] => StarkBankSplitReceiver Object
        (
            [id] => 5077405228072960
            [name] => Maria
            [taxId] => 012.345.678-90
            [bankCode] => 18236120
            [branchCode] => 0001
            [accountNumber] => 10000-0
            [accountType] => checking
            [tags] => Array
                (
                    [0] => test sdk-php
                )

            [status] => created
            [created] => DateTime Object
                (
                    [date] => 2024-03-08 19:35:29.107252
                    [timezone_type] => 1
                    [timezone] => +00:00
                )

            [updated] =>
        )

)
  

Java

Log({
  "created": "2024-01-30T20:32:56.214350+00:00",
  "id": "5079983684845568",
  "receiver": {
      "accountNumber": "76543-8",
      "accountType": "salary",
      "bankCode": "665",
      "branchCode": "2201",
      "created": "2024-01-30T20:32:56.182031+00:00",
      "id": "5642933638266880",
      "name": "Daenerys Targaryen Stormborn",
      "status": "created",
      "tags": [],
      "taxId": "594.739.480-42",
      "updated": "2024-01-30T20:32:56.335505+00:00"
  },
  "type": "created"
})
  

Ruby

Not yet available. Please contact us if you need this SDK.
  

Elixir

Not yet available. Please contact us if you need this SDK.
  

C#

Not yet available. Please contact us if you need this SDK.
  

Go

Not yet available. Please contact us if you need this SDK.
  

Clojure

Not yet available. Please contact us if you need this SDK.
  

Curl

{
    "cursor": null,
    "logs": [
        {
            "created": "2024-01-30T20:32:56.214350+00:00",
            "id": "5079983684845568",
            "receiver": {
                "accountNumber": "76543-8",
                "accountType": "salary",
                "bankCode": "665",
                "branchCode": "2201",
                "created": "2024-01-30T20:32:56.182031+00:00",
                "id": "5642933638266880",
                "name": "Daenerys Targaryen Stormborn",
                "status": "created",
                "tags": [],
                "taxId": "594.739.480-42",
                "updated": "2024-01-30T20:32:56.335505+00:00"
            },
            "type": "created"
        }
    ]
}
  

Get a Split Receiver Log

Get a single Split Receiver Log by its id.

Parameters

id REQUIRED

Id of the log entity.

fields OPTIONAL

List of strings to filter response JSON keys. Not available in the SDKs.

ENDPOINT
GET /v2/split-receiver/log/:id
REQUEST

Python

import starkbank

log = starkbank.splitreceiver.log.get("5155165527080960")

print(log)
  

Javascript

Not yet available. Please contact us if you need this SDK.
  

PHP

use StarkBank\SplitReceiver\Log;

$splitReceiverLogs = Log::get("5155165527080960");

print_r($splitReceiverLogs);
  

Java

import com.starkbank.*;

SplitReceiver.Log log = SplitReceiver.Log.get("5155165527080960");

System.out.println(log);
  

Ruby

Not yet available. Please contact us if you need this SDK.
  

Elixir

Not yet available. Please contact us if you need this SDK.
  

C#

Not yet available. Please contact us if you need this SDK.
  

Go

Not yet available. Please contact us if you need this SDK.
  

Clojure

Not yet available. Please contact us if you need this SDK.
  

Curl

curl --location --request GET '{{baseUrl}}/v2/split-receiver/log/5155165527080960' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}'
  
RESPONSE

Python

Log(
	created=2024-01-30 20:17:12.611535,
	errors=None,
	id=5155165527080960,
	receiver=SplitReceiver(
		account_number=73068305-0,
		account_type=salary,
		bank_code=18236120,
		branch_code=250,
		created=2024-01-30 20:17:12.586344,
		id=5147241060761600,
		name=Lucille Jette,
		status=created,
		tags=[],
		tax_id=949.887.518-99,
		updated=2024-01-30 20:17:13.712424
	),
	type=created
)  

Javascript

Not yet available. Please contact us if you need this SDK.
  

PHP

StarkBank\SplitReceiver\Log Object
(
    [id] => 4795930251362304
    [created] => DateTime Object
        (
            [date] => 2024-03-08 19:35:29.140174
            [timezone_type] => 1
            [timezone] => +00:00
        )

    [type] => created
    [errors] =>
    [splitReceiver] => StarkBank\SplitReceiver Object
        (
            [id] => 5077405228072960
            [name] => Maria
            [taxId] => 012.345.678-90
            [bankCode] => 18236120
            [branchCode] => 0001
            [accountNumber] => 10000-0
            [accountType] => checking
            [tags] => Array
                (
                    [0] => test sdk-php
                )

            [status] => created
            [created] => DateTime Object
                (
                    [date] => 2024-03-08 19:35:29.107252
                    [timezone_type] => 1
                    [timezone] => +00:00
                )

            [updated] =>
        )

)
  

Java

Log({
  "created": "2024-01-30T20:32:56.214350+00:00",
  "id": "5155165527080960",
  "receiver": {
      "accountNumber": "76543-8",
      "accountType": "salary",
      "bankCode": "665",
      "branchCode": "2201",
      "created": "2024-01-30T20:32:56.182031+00:00",
      "id": "5642933638266880",
      "name": "Daenerys Targaryen Stormborn",
      "status": "created",
      "tags": [],
      "taxId": "594.739.480-42",
      "updated": "2024-01-30T20:32:56.335505+00:00"
  },
  "type": "created"
})
  

Ruby

Not yet available. Please contact us if you need this SDK.
  

Elixir

Not yet available. Please contact us if you need this SDK.
  

C#

Not yet available. Please contact us if you need this SDK.
  

Go

Not yet available. Please contact us if you need this SDK.
  

Clojure

Not yet available. Please contact us if you need this SDK.
  

Curl

{
    "log": {
        "created": "2024-01-30T20:32:56.214350+00:00",
        "id": "5155165527080960",
        "receiver": {
            "accountNumber": "76543-8",
            "accountType": "salary",
            "bankCode": "665",
            "branchCode": "2201",
            "created": "2024-01-30T20:32:56.182031+00:00",
            "id": "5642933638266880",
            "name": "Daenerys Targaryen Stormborn",
            "status": "created",
            "tags": [],
            "taxId": "594.739.480-42",
            "updated": "2024-01-30T20:32:56.335505+00:00"
        },
        "type": "created"
    }
}
  

Split Profile

The Split Profile resource is used to configure the behavior of split operations.

The Split Profile object

Attributes

id STRING

Unique id for the split profile.

created STRING

Creation datetime. Example: "2020-04-23T23:00:00.000000+00:00".

delay INTEGER

Time in milliseconds the amount stays at the workspace.

interval STRING

Frequency of transfer. Options: "day", "week", "month".

status STRING

Current split profile status.

tags LIST OF STRINGS

Tags associated with the split profile.

updated STRING

Last update datetime. Example: "2020-04-23T23:00:00.000000+00:00".

Put a Split Profile

Send a list containing a single Split Profile object. If the object has already been created, its rules will be updated.

Parameters

delay OPTIONAL

How long the amount will stay at the workspace in milliseconds

interval OPTIONAL

Frequency of transfer, default "week". Options: "day", "week", "month"

tags OPTIONAL

List of strings for reference when searching for profiles. ex: ["test profile"]

ENDPOINT
PUT /v2/split-profile
REQUEST

Python

import starkbank

payload ={
    "interval": "day",
    "delay": 0
}
splitprofile = starkbank.splitprofile.update([payload])

for profile in splitprofile:
  print(profile)

    

Javascript

Not yet available. Please contact us if you need this SDK.
    

PHP

use StarkBank\SplitProfile;

$profile = [
  new SplitProfile([
      "interval"=> "day",
      "delay"=> 0,
  ]),
];
$profile = SplitProfile::put($profile);
print_r($profile)
  

Java

Not yet available. Please contact us if you need this SDK.
    

Ruby

Not yet available. Please contact us if you need this SDK.
    

Elixir

Not yet available. Please contact us if you need this SDK.
    

C#

Not yet available. Please contact us if you need this SDK.
    

Go

Not yet available. Please contact us if you need this SDK.
    

Clojure

Not yet available. Please contact us if you need this SDK.
    

Curl

  curl --location --request PUT '{{baseUrl}}/v2/split-profile' 
  --header 'Access-Id: {{accessId}}' 
  --header 'Access-Time: {{accessTime}}' 
  --header 'Access-Signature: {{accessSignature}}'
  --data '{
    "profiles": [
        {
            "interval": "day",
            "delay": 0
        }
    ]
}'
    
RESPONSE

Python

SplitProfile(
  created=2023-10-24 00:23:08.831127,
  delay=0,
  id=6206954716266496,
  interval=day,
  status=created,
  tags=[],
  updated=2024-02-26 17:56:13.304200
)
    

Javascript

Not yet available. Please contact us if you need this SDK.
      

PHP

StarkBank\SplitProfile Object
(
  [0] => StarkBank\SplitProfile Object
      (
          [id] => 6206954716266496
          [interval] => day
          [delay] => 0
          [tags] => Array
              (
              )
          [status] => created
          [created] => DateTime Object
              (
                  [date] => 2023-10-24 00:23:08.831127
                  [timezone_type] => 1
                  [timezone] => +00:00
              )
          [updated] => DateTime Object
              (
                  [date] => 2024-03-08 18:13:40.980533
                  [timezone_type] => 1
                  [timezone] => +00:00
              )
      )
)
    

Java

Not yet available. Please contact us if you need this SDK.
    

Ruby

Not yet available. Please contact us if you need this SDK.
    

Elixir

Not yet available. Please contact us if you need this SDK.
  }
    

C#

Not yet available. Please contact us if you need this SDK.

    

Go

Not yet available. Please contact us if you need this SDK.
    

Clojure

Not yet available. Please contact us if you need this SDK.
    

Curl

{
  "profiles": [
      {
          "created": "2023-10-23T23:04:57.558292+00:00",
          "delay": 0,
          "id": "5634161670881280",
          "interval": "day",
          "status": "created",
          "tags": [],
          "updated": "2024-02-26T17:59:37.507079+00:00"
      }
  ]
}
    

List Split Profiles

Get a list of Split Profiles in chunks of up to 100. If you need smaller chunks, use the limit parameter.

Parameters

after OPTIONAL

Filter entities created after this date.

before OPTIONAL

Filter entities created before this date.

cursor OPTIONAL

String used to get the next batch of results. Our SDKs handle this for you.

fields OPTIONAL

List of strings to filter response JSON keys. Not available in the SDKs.

ids OPTIONAL

List of strings to get specific entities by ids.

limit OPTIONAL

Number of results per cursor. Max = 100.

status OPTIONAL

Filter split profiles by the specified status.

tags OPTIONAL

Filter entities that contain the specified tags.

ENDPOINT
GET /v2/split-profile
REQUEST

Python

import starkbank

splitprofiles = starkbank.splitprofile.query(limit=2)

for profile in splitprofiles:
    print(profile)
  

Javascript

Not yet available. Please contact us if you need this SDK.
  

PHP

use StarkBank\SplitProfile;

$splitProfiles = iterator_to_array(SplitProfile::query(["limit" => 10, "before" => new DateTime("now")]));

foreach ($splitProfiles as $splitProfile) {
  print_r($splitProfile);
}
  

Java

  Not yet available. Please contact us if you need this SDK.
    

Ruby

Not yet available. Please contact us if you need this SDK.
  

Elixir

Not yet available. Please contact us if you need this SDK.
  

C#

Not yet available. Please contact us if you need this SDK.
  

Go

Not yet available. Please contact us if you need this SDK.
  

Clojure

Not yet available. Please contact us if you need this SDK.
  

Curl

curl --location --request GET '{{baseUrl}}/v2/split-profile?limit=2' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}'
  
RESPONSE

Python

SplitProfile(
    created=2023-10-24 00:23:08.831127,
    delay=0,
    id=6206954716266496,
    interval=day,
    status=created,
    tags=[],
    updated=2024-02-26 17:56:13.539948
)
  

Javascript

Not yet available. Please contact us if you need this SDK.
    

PHP

StarkBank\SplitProfile Object
(
    [id] => 6206954716266496
    [interval] => day
    [delay] => 0
    [tags] => Array
        (
        )

    [status] => created
    [created] => DateTime Object
        (
            [date] => 2023-10-24 00:23:08.831127
            [timezone_type] => 1
            [timezone] => +00:00
        )

    [updated] => DateTime Object
        (
            [date] => 2024-03-08 18:13:41.241784
            [timezone_type] => 1
            [timezone] => +00:00
        )

)
  

Java

Not yet available. Please contact us if you need this SDK.
  

Ruby

Not yet available. Please contact us if you need this SDK.
  

Elixir

Not yet available. Please contact us if you need this SDK.
}
  

C#

Not yet available. Please contact us if you need this SDK.

  

Go

Not yet available. Please contact us if you need this SDK.
  

Clojure

Not yet available. Please contact us if you need this SDK.
  

Curl

{
  "cursor": null,
  "profiles": [
      {
          "created": "2023-10-23T23:04:57.558292+00:00",
          "delay": 0,
          "id": "5634161670881280",
          "interval": "day",
          "status": "created",
          "tags": [],
          "updated": "2024-02-26T17:59:37.655935+00:00"
      }
  ]
}
  

Get a Split Profile

Retrieve a single Split Profile object by its ID, which was previously created.

Parameters

id REQUIRED

Id of the Split Profile entity

fields OPTIONAL

List of strings to filter response JSON keys. Not available in the SDKs.

ENDPOINT
GET /v2/split-profile/:id
REQUEST

Python

import starkbank

splitprofile = starkbank.splitprofile.get(5634161670881280)

print(splitprofile)
  

Javascript

Not yet available. Please contact us if you need this SDK.
  

PHP

use StarkBank\SplitProfile;

$splitProfile = SplitProfile::get("5634161670881280");
print_r($splitprofile);
    

Java

    Not yet available. Please contact us if you need this SDK.
  

Ruby

Not yet available. Please contact us if you need this SDK.
  

Elixir

Not yet available. Please contact us if you need this SDK.
  

C#

Not yet available. Please contact us if you need this SDK.
  

Go

Not yet available. Please contact us if you need this SDK.
  

Clojure

Not yet available. Please contact us if you need this SDK.
  

Curl

curl --location --request GET '{{baseUrl}}/v2/split-profile/5634161670881280' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}'
  
RESPONSE

Python

SplitProfile(
  created=2023-10-24 00:23:08.831127,
  delay=0,
  id=6206954716266496,
  interval=day,
  status=created,
  tags=[],
  updated=2024-02-26 17:56:13.539948
)
  

Javascript

Not yet available. Please contact us if you need this SDK.
    

PHP

StarkBank\SplitProfile Object
(
  [0] => StarkBank\SplitProfile Object
      (
          [id] => 6206954716266496
          [interval] => day
          [delay] => 0
          [tags] => Array
              (
              )
          [status] => created
          [created] => DateTime Object
              (
                  [date] => 2023-10-24 00:23:08.831127
                  [timezone_type] => 1
                  [timezone] => +00:00
              )
          [updated] => DateTime Object
              (
                  [date] => 2024-03-08 18:13:40.980533
                  [timezone_type] => 1
                  [timezone] => +00:00
              )
      )
)
  

Java

Not yet available. Please contact us if you need this SDK.
  

Ruby

Not yet available. Please contact us if you need this SDK.
  

Elixir

Not yet available. Please contact us if you need this SDK.
}
  

C#

Not yet available. Please contact us if you need this SDK.

  

Go

Not yet available. Please contact us if you need this SDK.
  

Clojure

Not yet available. Please contact us if you need this SDK.
  

Curl

{
  "profile": {
      "created": "2023-10-23T23:04:57.558292+00:00",
      "delay": 0,
      "id": "5634161670881280",
      "interval": "day",
      "status": "created",
      "tags": [],
      "updated": "2024-02-26T17:59:37.655935+00:00"
  }
}
  

List Split Profile Logs

Get a paged list of Split Profile logs. A log tracks a change in the Split Profile entity according to its life cycle.

Parameters

after OPTIONAL

Filter entities created after this date.

before OPTIONAL

Filter entities created before this date.

cursor OPTIONAL

String used to get the next batch of results. Our SDKs handle this for you.

fields OPTIONAL

List of strings to filter response JSON keys. Not available in the SDKs.

limit OPTIONAL

Number of results per cursor. Max = 100.

profileIds OPTIONAL

List of Split Profile ids to filter retrieved objects. ex: ['5656565656565656', '4545454545454545'].

types OPTIONAL

filter retrieved objects by event types. ex: 'processing' or 'success'

ENDPOINT
GET /v2/split-profile/log
REQUEST

Python

import starkbank

logs = starkbank.splitprofile.log.query(limit=10)

for log in logs:
  print(log)
  

Javascript

Not yet available. Please contact us if you need this SDK.
  

PHP

use StarkBank\SplitProfile\Log;

$splitProfileLogs = iterator_to_array(Log::query(["limit" => 10]));

foreach ($splitProfileLogs as $log) {
  print_r($log);
}
  

Java

Not yet available. Please contact us if you need this SDK.
  

Ruby

Not yet available. Please contact us if you need this SDK.
  

Elixir

Not yet available. Please contact us if you need this SDK.
  

C#

Not yet available. Please contact us if you need this SDK.
  

Go

Not yet available. Please contact us if you need this SDK.
  

Clojure

Not yet available. Please contact us if you need this SDK.
  

Curl

curl --location --request GET '{{baseUrl}}/v2/split-profile/log?limit=10' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}'
  
RESPONSE

Python

Log(
  created=2024-02-26 17:56:13.326078,
  errors=None,
  id=5746640992337920,
  profile=SplitProfile(
    created=2023-10-24 00:23:08.831127,
    delay=0,
    id=6206954716266496,
    interval=day,
    status=created,
    tags=[],
    updated=2024-02-26 17:56:13.581938
  ),
  type=updated
)
  

Javascript

Not yet available. Please contact us if you need this SDK.
  

PHP

StarkBank\SplitProfile\Log Object
(
  [id] => 5662484329398272
  [created] => DateTime Object
      (
          [date] => 2024-03-08 18:13:41.007739
          [timezone_type] => 1
          [timezone] => +00:00
      )

  [type] => updated
  [errors] =>
  [splitProfile] => StarkBank\SplitProfile Object
      (
          [id] => 6206954716266496
          [interval] => day
          [delay] => 0
          [tags] => Array
              (
              )

          [status] => created
          [created] => DateTime Object
              (
                  [date] => 2023-10-24 00:23:08.831127
                  [timezone_type] => 1
                  [timezone] => +00:00
              )

          [updated] => DateTime Object
              (
                  [date] => 2024-03-08 18:13:41.285270
                  [timezone_type] => 1
                  [timezone] => +00:00
              )

      )

)
  

Java

Not yet available. Please contact us if you need this SDK.
  

Ruby

Not yet available. Please contact us if you need this SDK.
  

Elixir

Not yet available. Please contact us if you need this SDK.
  

C#

Not yet available. Please contact us if you need this SDK.
  

Go

Not yet available. Please contact us if you need this SDK.
  

Clojure

Not yet available. Please contact us if you need this SDK.
  

Curl

{
  "cursor": null,
  "logs": [
      {
          "created": "2024-02-26T17:59:37.520886+00:00",
          "id": "5716856266555392",
          "profile": {
              "created": "2023-10-23T23:04:57.558292+00:00",
              "delay": 0,
              "id": "5634161670881280",
              "interval": "day",
              "status": "created",
              "tags": [],
              "updated": "2024-02-26T17:59:37.688751+00:00"
          },
          "type": "updated"
      },
      {
          "created": "2024-02-23T18:16:59.012225+00:00",
          "id": "5189852773482496",
          "profile": {
              "created": "2023-10-23T23:04:57.558292+00:00",
              "delay": 0,
              "id": "5634161670881280",
              "interval": "day",
              "status": "created",
              "tags": [],
              "updated": "2024-02-26T17:59:37.688623+00:00"
          },
          "type": "updated"
      },
      {
          "created": "2023-10-23T23:04:57.583386+00:00",
          "id": "5071211717459968",
          "profile": {
              "created": "2023-10-23T23:04:57.558292+00:00",
              "delay": 604800,
              "id": "5634161670881280",
              "interval": "month",
              "status": "created",
              "tags": [],
              "updated": "2024-02-26T17:59:37.688481+00:00"
          },
          "type": "created"
      }
  ]
}
  

Get a Split Profile Log

Get a single Split Profile Log by its id.

Parameters

id REQUIRED

Id of the log entity.

fields OPTIONAL

List of strings to filter response JSON keys. Not available in the SDKs.

ENDPOINT
GET /v2/split-profile/log/:id
REQUEST

Python

import starkbank

log = starkbank.splitprofile.log.get("5634161670881280")

print(log)
  

Javascript

Not yet available. Please contact us if you need this SDK.
  

PHP

use StarkBank\SplitProfile\Log;

$splitProfileLog = Log::get("5634161670881280");

print_r($splitProfileLog);
    

Java

Not yet available. Please contact us if you need this SDK.
  

Ruby

Not yet available. Please contact us if you need this SDK.
  

Elixir

Not yet available. Please contact us if you need this SDK.
  

C#

Not yet available. Please contact us if you need this SDK.
  

Go

Not yet available. Please contact us if you need this SDK.
  

Clojure

Not yet available. Please contact us if you need this SDK.
  

Curl

curl --location --request GET '{{baseUrl}}/v2/split-profile/log/5634161670881280' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}'
  
RESPONSE

Python

Log(
  created=2024-02-26 17:56:13.326078,
  errors=None,
  id=5746640992337920,
  profile=SplitProfile(
    created=2023-10-24 00:23:08.831127,
    delay=0,
    id=6206954716266496,
    interval=day,
    status=created,
    tags=[],
    updated=2024-02-26 17:56:13.581938
  ),
  type=updated
)
  

Javascript

Not yet available. Please contact us if you need this SDK.
  

PHP

StarkBank\SplitProfile\Log Object
(
    [id] => 5662484329398272
    [created] => DateTime Object
        (
            [date] => 2024-03-08 18:13:41.007739
            [timezone_type] => 1
            [timezone] => +00:00
        )

    [type] => updated
    [errors] =>
    [splitProfile] => StarkBank\SplitProfile Object
        (
            [id] => 6206954716266496
            [interval] => day
            [delay] => 0
            [tags] => Array
                (
                )

            [status] => created
            [created] => DateTime Object
                (
                    [date] => 2023-10-24 00:23:08.831127
                    [timezone_type] => 1
                    [timezone] => +00:00
                )

            [updated] => DateTime Object
                (
                    [date] => 2024-03-08 18:13:41.285270
                    [timezone_type] => 1
                    [timezone] => +00:00
                )

        )

)
  

Java

Not yet available. Please contact us if you need this SDK.
  

Ruby

Not yet available. Please contact us if you need this SDK.
  

Elixir

Not yet available. Please contact us if you need this SDK.
  

C#

Not yet available. Please contact us if you need this SDK.
  

Go

Not yet available. Please contact us if you need this SDK.
  

Clojure

Not yet available. Please contact us if you need this SDK.
  

Curl

{
  "log": {
      "created": "2023-10-23T23:04:57.583386+00:00",
      "id": "5071211717459968",
      "profile": {
          "created": "2023-10-23T23:04:57.558292+00:00",
          "delay": 604800,
          "id": "5634161670881280",
          "interval": "month",
          "status": "created",
          "tags": [],
          "updated": "2024-02-26T17:59:37.688481+00:00"
      },
      "type": "created"
  }
}
  

Invoice Pull Subscription

An Invoice Pull Subscription is a recurring payment agreement between a payer and a receiver, authorized through the Pix Automatic infrastructure. Once active, it allows the receiver to periodically trigger automatic debits by issuing invoices that match the agreed conditions such as amount, frequency, and billing cycle without requiring new consent for each transaction.

You can use asynchronous webhooks to monitor status changes.

Invoice Pull Subscription Status

Invoice Pull Subscriptions will follow the following life cycle: invoice-pull-subscription-status

Invoice Pull Subscription Logs

Every time either you or Stark Bank makes a change to an Invoice Pull Subscription, we create a log. Logs are pretty useful for understanding the life cycle of each Invoice Pull Subscription and the changes that happened to it. Here you can see the flow of possible logs: invoice-pull-subscription-log

The Invoice Pull Subscription object

Attributes

id STRING

Unique id for the subscription.

amount INTEGER

Fixed amount to be charged every cycle in cents.

amountMinLimit INTEGER

Minimum amount limit in cents.

bacenId STRING

Central Bank identifier.

brcode STRING

BR Code for the subscription.

created STRING

Creation datetime. Example: "2020-04-23T23:00:00.000000+00:00".

displayDescription STRING

Description presented to the payer.

due STRING

Due date for payer approval or denial.

end STRING

Final date of the subscription.

externalId STRING

Unique external ID to prevent duplicate subscriptions.

interval STRING

Cycle definition. Options: "week", "month", "quarter", "semester", "year".

name STRING

Debtor full name.

pullMode STRING

Defines if pull requests are automatic or manual.

pullRetryLimit INTEGER

Number of retries allowed. Options: 0, 3.

referenceCode STRING

Unique reference code for the contract.

start STRING

Expected date to settle first pull request.

status STRING

Current subscription status.

tags LIST OF STRINGS

Tags associated with the subscription.

taxId STRING

Debtor CPF or CNPJ.

type STRING

Subscription journey type. Options: "push", "qrcode", "qrcodeAndPayment", "paymentAndOrQrCode".

updated STRING

Last update datetime. Example: "2020-04-23T23:00:00.000000+00:00".

Create Invoice Pull Subscriptions

Use this route to create new invoice pull subscriptions.

Parameters

displayDescription REQUIRED

Description to be presented to the payer.

externalId REQUIRED

Safe string that must be unique among all your Invoice PullSubscriptions to prevent duplicates.

interval REQUIRED

Cycle definition of the Invoice Pull Requests. Options are "week", "month", "quarter", "semester" and "year".

name REQUIRED

Name of the debtor.

pullMode REQUIRED

Defines if the invoice pull requests will be made automatically by Stark Bank or manually by the company.

pullRetryLimit REQUIRED

Defines how many times the receiver is able to create Invoice Pull Requests for retries. Options are "0" and "3".

referenceCode REQUIRED

Safe string that must be unique among all your Pix Subscriptions and represent a contract.

start REQUIRED

Expected date to settle the first Invoice Pull Request.

taxId REQUIRED

Tax id of the debtor.

type REQUIRED

Subscription journey type. Options: "push", "qrcode", "qrcodeAndPayment" or "paymentAndOrQrCode".

amount CONDITIONALLY REQUIRED

Fixed amount to be charged every cycle. Required if the subscription has a fixed amount.

amountMinLimit CONDITIONALLY REQUIRED

Minimum amount limit that the payer can set to be charged every cycle. Required if the subscription has a variable amount.

data CONDITIONALLY REQUIRED

Additional data required for some types of invoice pull subscription.

For the push type, this field sets the payer's account details. For the qrcodeAndPayment or paymentAndOrQrCode types, this field sets the immediate payment parameters. This field is not required for the qrcode type.

due OPTIONAL

Due date for answering with an approval or denial. If not provided, defaults to 2 days after creation.

end OPTIONAL

Determines the final date of the subscription.

tags OPTIONAL

Array of strings to tag the entity for future queries. All tags will be converted to lowercase.

ENDPOINT
POST /v2/invoice-pull-subscription
REQUEST

Python

import starkbank

subscriptions = starkbank.invoicepullsubscription.create([
    starkbank.InvoicePullSubscription(
        amount=0,
        amount_min_limit=5000,
        data={
            "account_number": "9123900000",
            "bank_code": "05097757",
            "branch_code": "1126",
            "tax_id": "20.018.183/0001-80"
        },
        display_description="Dragon Travel Fare",
        external_id="b7e6a2c2-8e2b-4c1a-9e2a-123456789abc",
        interval="month",
        name="John Snow",
        pull_mode="manual",
        pull_retry_limit=3,
        start="2025-09-14T00:00:00Z",
        end="2025-10-14T00:00:00Z",
        reference_code="contract-12345",
        tags=[],
        tax_id="012.345.678-90",
        type="push"
    ),
])

for subscription in subscriptions:
    print(subscription)
  

Javascript

const starkbank = require('starkbank');

(async() => {
    let subscriptions = await starkbank.invoicePullSubscription.create([
        {
        amount: 0,
        amountMinLimit: 5000,
        data: {
            accountNumber: '9123900000',
            bankCode: '05097757',
            branchCode: '1126',
            taxId: '20.018.183/0001-80'
        },
        displayDescription: 'Dragon Travel Fare',
        externalId: 'e0ef6c02-f58e-44cd-b04d-e914d4df9405',
        interval: 'month',
        name: 'John Snow',
        pullMode: 'manual',
        pullRetryLimit: 3,
        start: '2025-09-14',
        end: '2025-10-14',
        referenceCode: 'contract-12345',
        tags: [],
        taxId: '012.345.678-90',
        type: 'push'
        }
    ]);

    for (let subscription of subscriptions) {
        console.log(subscription);
    }
})();
  

PHP

$subscriptions = StarkBankInvoicePullSubscription::create([
    new InvoicePullSubscription([
        "amount" => 0,
        "amountMinLimit" => 5000,
        "data" => [
            "accountNumber" => "9123900000",
            "bankCode" => "05097757",
            "branchCode" => "1126",
            "taxId" => "20.018.183/0001-80"
        ],
        "displayDescription" => "Dragon Travel Fare",
        "due" => '2025-10-27',
        "end" => '2025-10-27',
        "externalId" => "php-1553222241",
        "interval" => "month",
        "name" => "John Snow",
        "pullMode" => "manual",
        "pullRetryLimit" => 3,
        "referenceCode" => "contract-12345",
        "start" => '2025-09-22',
        "tags" => [],
        "taxId" => "012.345.678-90",
        "type" => "push",
    ])

foreach ($subscriptions as $subscription) {
    print_r($subscription);
}
  

Java

import com.starkbank.*;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

List subscriptions = new ArrayList<>();

HashMap classData = new HashMap<>();
classData.put("start", "2025-09-30");
classData.put("interval", "month");
classData.put("pullMode", "manual");
classData.put("pullRetryLimit", 3L);
classData.put("type", "push");
classData.put("amount", 0L);
classData.put("amountMinLimit", 5000L);
classData.put("displayDescription", "Dragon Travel Fare");
classData.put("externalId", "a119bc87-68ac-4558-8a54-22196beebf67");
classData.put("referenceCode", "contract-12345");
classData.put("end", "2025-10-30");
classData.put("name", "John Snow");
classData.put("taxId", "012.345.678-90");
classData.put("tags", new String[]{});

HashMap data = new HashMap<>();
data.put("accountNumber", "9123900000");
data.put("bankCode", "05097757");
data.put("branchCode", "1126");
data.put("taxId", "20.018.183/0001-80");

classData.put("data", data);

subscriptions.add(new InvoicePullSubscription(classData));

subscriptions = InvoicePullSubscription.create(subscriptions);

for (InvoicePullSubscription subscription : subscriptions) {
    System.out.println(subscription);
}
  

Ruby

Not yet available. Please contact us if you need this SDK.
  

Elixir

Not yet available. Please contact us if you need this SDK.
  

C#

using System;
using System.Collections.Generic;

List<StarkBank.InvoicePullSubscription> subscriptions = StarkBank.InvoicePullSubscription.Create(
    new List<StarkBank.InvoicePullSubscription> {
        new InvoicePullSubscription(
            amount: 1000000,
            amountMinLimit: 5000,
            data: new Dictionary<string, object> {
            {"accountNumber", "9123900000"},
            {"bankCode", "05097757"},
            {"branchCode", "1126"},
            {"taxId", "20.018.183/0001-80"}
            },
            displayDescription: "Dragon Travel Fare",
            externalID: "f4a4c70b-bf5a-400d-8eae-685128691645",
            interval: "month",
            name: "John Snow",
            pullMode: "manual",
            pullRetryLimit: 3,
            start: new DateTime(2025, 9, 14, 0, 0, 0, DateTimeKind.Utc),
            end: new DateTime(2025, 10, 14, 0, 0, 0, DateTimeKind.Utc),
            referenceCode: "contract-12345",
            tags: new List<string>(),
            taxID: "012.345.678-90",
            type: "push"
        )
    }
);

foreach (StarkBank.InvoicePullSubscription subscription in subscriptions)
{
    Console.WriteLine(subscription);
}
  

Go

package main

import (
    "fmt"
    "time"
    "github.com/starkbank/sdk-go/starkbank/invoicepullsubscription"
)

func main() {

    start := time.Date(2025, 11, 3, 0, 0, 0, 0, time.UTC)
    end := time.Date(2025, 12, 3, 0, 0, 0, 0, time.UTC)
	due := time.Date(2025, 11, 3, 0, 0, 0, 0, time.UTC)
    data := map[string]interface{}{
			"amount":   400000,
			"due":      &due,
			"fine":     2.5,
			"interest": 1.3,
	}

    invoicePullSubscription, err := invoicepullsubscription.Create(
        []invoicepullsubscription.InvoicePullSubscription{
            {
              Amount:            1000000,
              AmountMinLimit:    5000,
              Data:              data,
              DisplayDescription: "Dragon Travel Fare",
              ExternalId:        fmt.Sprintf("my_external_id_xwewe"),
              Interval:          "month",
              Name:              "John Snow",
              PullMode:          "manual",
              PullRetryLimit:    3,
              Start:             &start,
              End:               &end,
              ReferenceCode:     "contract-12345",
              Tags:              []string{},
              TaxId:             "012.345.678-90",
              Type:              "paymentAndOrQrcode",
            },
        }, nil)

    if err.Errors != nil {
        for _, e := range err.Errors {
            fmt.Printf("code: %s, message: %s", e.Code, e.Message)
        }
    }

    subscription := invoicePullSubscription[0]
    fmt.Printf("%+v", subscription)
}

Clojure

Not yet available. Please contact us if you need this SDK.
  

Curl

curl --location --request POST '{{baseUrl}}/v2/invoice-pull-subscription' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}' 
--header 'Content-Type: application/json' 
--data-raw '{
    "subscriptions": [
        {
        "amount": 0,
        "amountMinLimit": 5000,
        "data": {
            "accountNumber": "9123900000",
            "bankCode": "05097757",
            "branchCode": "1126",
            "taxId": "20.018.183/0001-80"
        },
        "displayDescription": "Dragon Travel Fare",
        "externalId": "b7e6a2c2-8e2b-4c1a-9e2a-123456789abc",
        "interval": "month",
        "name": "John Snow",
        "pullMode": "manual",
        "pullRetryLimit": 3,
        "start": "2025-09-14",
        "end": "2025-10-14",
        "referenceCode": "contract-12345",
        "tags": [],
        "taxId": "012.345.678-90",
        "type": "push"
        }
    ]
}'
  
RESPONSE

Python

InvoicePullSubscription(
    amount=0,
    amount_min_limit=5000,
    bacen_id=RR2001818320250904xDUK7RgCRT4,
    created=2025-09-04 20:57:33.833777,
    data={'accountNumber': '9123900000', 'bankCode': '05097757', 'branchCode': '1126', 'taxId': '20.018.183/0001-80'},
    display_description=Dragon Travel Fare,
    due=2025-09-14 00:00:00,
    end=2025-10-14 00:00:00,
    external_id=b7e6a2c2-8e2b-4c1a-9e2a-123456789abc,
    id=5656565656565656,
    interval=month,
    name=John Snow,
    pull_mode=manual,
    pull_retry_limit=3,
    reference_code=contract-12345,
    start=2025-09-14 00:00:00,
    status=active,
    tags=[],
    tax_id=012.345.678-90,
    type=push,
    updated=2025-09-14 00:00:00
)
  

Javascript

InvoicePullSubscription {
  id: '4656724615102464',
  start: '2025-09-14T03:00:00+00:00',
  interval: 'month',
  pullMode: 'manual',
  pullRetryLimit: 3,
  type: 'push',
  amount: 0,
  amountMinLimit: 5000,
  displayDescription: 'Dragon Travel Fare',
  due: '2025-09-11T21:42:35.878330+00:00',
  externalId: 'e0ef6c02-f58e-44cd-b04d-e914d4df9405',
  referenceCode: 'contract-12345',
  end: '2025-10-14T03:00:00+00:00',
  data: {
    accountNumber: '9123900000',
    bankCode: '05097757',
    branchCode: '1126',
    taxId: '20.018.183/0001-80'
  },
  name: 'John Snow',
  taxId: '012.345.678-90',
  tags: [],
  status: 'created',
  bacenId: 'RR2001818320250909WDW2JAoiyB2',
  installmentId: null,
  created: '2025-09-09T21:42:36.419070+00:00',
  updated: '2025-09-09T21:42:36.419078+00:00',
  brcode: ''
}
  

PHP

StarkBankInvoicePullSubscription Object
(
    [id] => 6673352286535680
    [start] => DateTime Object
        (
            [date] => 2025-09-22 03:00:00.000000
            [timezone_type] => 1
            [timezone] => +00:00
        )

    [interval] => month
    [pullMode] => manual
    [pullRetryLimit] => 3
    [type] => push
    [amount] => 0
    [amountMinLimit] => 5000
    [displayDescription] => Dragon Travel Fare
    [due] => DateTime Object
        (
            [date] => 2025-10-28 02:59:59.999999
            [timezone_type] => 1
            [timezone] => +00:00
        )

    [externalId] => php-1553222241
    [referenceCode] => contract-12345
    [end] => DateTime Object
        (
            [date] => 2025-10-27 03:00:00.000000
            [timezone_type] => 1
            [timezone] => +00:00
        )

    [data] => Array
        (
            [accountNumber] => 9123900000
            [bankCode] => 05097757
            [branchCode] => 1126
            [taxId] => 20.018.183/0001-80
        )

    [name] => John Snow
    [taxId] => 012.345.678-90
    [tags] => Array
        (
        )

    [status] => created
    [bacenId] => RR39908427202509220UfSNmHYqfy
    [installmentId] => 
    [created] => DateTime Object
        (
            [date] => 2025-09-22 23:44:35.599677
            [timezone_type] => 1
            [timezone] => +00:00
        )

    [updated] => DateTime Object
        (
            [date] => 2025-09-22 23:44:35.599685
            [timezone_type] => 1
            [timezone] => +00:00
        )

    [brcode] => 
)
  

Java

InvoicePullSubscription({
  "start": "2025-09-30T03:00:00+00:00",
  "interval": "month",
  "pullMode": "manual",
  "pullRetryLimit": 3,
  "type": "push",
  "amount": 0,
  "amountMinLimit": 5000,
  "displayDescription": "Dragon Travel Fare",
  "due": "2025-09-27T18:41:26.789072+00:00",
  "externalId": "a119bc87-68ac-4558-8a54-22196beebf67",
  "referenceCode": "contract-12345",
  "end": "2025-10-30T03:00:00+00:00",
  "data": {
    "accountNumber": "9123900000",
    "bankCode": "05097757",
    "branchCode": "1126",
    "taxId": "20.018.183/0001-80"
  },
  "name": "John Snow",
  "taxId": "012.345.678-90",
  "tags": [],
  "status": "created",
  "bacenId": "RR2001818320250925BxZi3SKFhs6",
  "brcode": "",
  "created": "2025-09-25T18:41:27.511033+00:00",
  "updated": "2025-09-25T18:41:27.511041+00:00",
  "id": "6673482343514112"
})
  

Ruby

Not yet available. Please contact us if you need this SDK.
  

Elixir

Not yet available. Please contact us if you need this SDK.
    

C#

InvoicePullSubscription(
  Start: 9/14/2025 12:00:00AM,
  Interval: month,
  PullMode: manual,
  PullRetryLimit: 3,
  Type: push,
  Amount: 1000000,
  AmountMinLimit: 5000,
  DisplayDescription: Dragon Travel Fare,
  Due: 9/11/2025 6:58:02PM,
  ExternalID: f4a4c70b-bf5a-400d-8eae-685128691645,
  ReferenceCode: contract-12345,
  End: 10/14/2025 12:00:00AM,
  Data: System.Collections.Generic.Dictionary`2[System.String,System.Object],
  Name: John Snow,
  TaxID: 012.345.678-90,
  Tags: {  },
  Status: created,
  BacenID: RR2001818320250909fxSoQw3VO04,
  Brcode: ,
  Created: 9/9/2025 6:58:03PM,
  Updated: 9/9/2025 6:58:03PM,
  ID: 4582433332658176
)
    

Go

{
    Id:6061255534051328
    Start:2025-11-03 03:00:00 +0000 +0000
    Interval:month
    PullMode:manual
    PullRetryLimit:3
    Type:paymentAndOrQrcode
    Amount:1000000
    AmountMinLimit:5000
    DisplayDescription:Dragon Travel Fare
    Due:2025-11-01 20:06:30.735371 +0000 +0000
    ExternalId:my_external_id_
    ReferenceCode:contract-12345
    End:2025-12-03 03:00:00 +0000 +0000
    Data:map[accountNumber: amount:400000 bankCode: branchCode: due:2025-11-03 00:00:00 +0000 UTC fine:2.5 interest:1.3 invoiceId:5474875019886592 taxId:]
    Name:John Snow
    TaxId:012.345.678-90
    Tags:[]
    Status:created
    BacenId:RR2001818320251030o9XZjuDVpfU Brcode:00020101021226940014br.gov.bcb.pix2572brcode-h.sandbox.starkinfra.com/v2/cobv/0aca55b5d74c4e4d9ca63ff5b9af7deb5204000053039865802BR5925Stark Bank S.A. - Institu6009Sao Paulo62070503***80930014br.gov.bcb.pix2571brcode-h.sandbox.starkinfra.com/v2/rec/0aca55b5d74c4e4d9ca63ff5b9af7deb6304CA86
    Created:2025-10-30 20:06:31.164797 +0000 +0000
    Updated:2025-10-30 20:06:31.164804 +0000 +0000
}
  

Clojure

Not yet available. Please contact us if you need this SDK.
  

Curl

{
    "message": "Subscriptions successfully created",
    "subscriptions": [
        {
            "amount": 0,
            "amountMinLimit": 5000,
            "bacenId": "RR20018183202509096amQtgYdMTf",
            "brcode": "",
            "created": "2025-09-09T21:34:55.854022+00:00",
            "updated": "2025-09-09T21:34:55.854028+00:00",
            "displayDescription": "Dragon Travel Fare",
            "referenceCode": "contract-12345",
            "due": "2025-09-11T21:34:55.157021+00:00",
            "externalId": "b7e6a2c2-8e2b-4c1a-9e2a-123456789abc",
            "id": "6633844090339328",
            "start": "2025-09-14T03:00:00+00:00",
            "end": "2025-10-14T03:00:00+00:00",
            "interval": "month",
            "data": {
                "accountNumber": "9123900000",
                "bankCode": "05097757",
                "branchCode": "1126",
                "taxId": "20.018.183/0001-80"
            },
            "pullMode": "manual",
            "pullRetryLimit": 3,
            "name": "John Snow",
            "taxId": "012.345.678-90",
            "status": "created",
            "tags": [],
            "type": "push"
        }
    ]
}
  

List Invoice Pull Subscriptions

Here you can list and filter all invoice pull subscriptions you have made. We return it paged.

Parameters

after OPTIONAL

Filter entities created after this date.

before OPTIONAL

Filter entities created before this date.

cursor OPTIONAL

String used to get the next batch of results. Our SDKs handle this for you.

expand OPTIONAL

List of strings to expand the invoice pull subscription information. Options: "data".

fields OPTIONAL

List of strings to filter response JSON keys. Not available in the SDKs.

ids OPTIONAL

List of strings to get specific entities by ids.

limit OPTIONAL

Number of results per cursor. Max = 100.

status OPTIONAL

Filter invoice pull subscriptions by the specified status.

tags OPTIONAL

Filter entities that contain the specified tags.

ENDPOINT
GET /v2/invoice-pull-subscription
REQUEST

Python

import starkbank

subscriptions = starkbank.invoicepullsubscription.query(
    after="2025-09-01",
    before="2025-09-30",
)

for subscription in subscriptions:
    print(subscription)
  

Javascript

const starkbank = require('starkbank');

(async() => {
    let subscriptions = await starkbank.invoicePullSubscription.query({
        after: '2025-09-01',
        before: '2025-09-30',
    });

    for await (let subscription of subscriptions){
        console.log(subscription);
    }
})();
  

PHP

$subscriptions = StarkBankInvoicePullSubscription::query([
    "after" => "2025-09-01",
    "before" => "2025-09-30"
]);

foreach($subscriptions as $subscription) {
    print_r($subscription);
}
  

Java

import com.starkbank.*;
import com.starkbank.utils.Generator;
import java.util.HashMap;

HashMap params = new HashMap<>();
params.put("after", "2025-09-01");
params.put("before", "2025-09-30");
Generator subscriptions = InvoicePullSubscription.query(params);

for (InvoicePullSubscription subscription : subscriptions) {
    System.out.println(subscription);
}
  

Ruby

Not yet available. Please contact us if you need this SDK.
  

Elixir

Not yet available. Please contact us if you need this SDK.
  

C#

using System;

IEnumerable<StarkBank.InvoicePullSubscription> subscriptions = StarkBank.InvoicePullSubscription.Query(
    after: new DateTime(2025, 9, 1),
    before: new DateTime(2025, 9, 30)
);

foreach(StarkBank.InvoicePullSubscription subscription in subscriptions) {
    Console.WriteLine(subscription);
}
  

Go

package main

import (
    "fmt"
    "time"
    "github.com/starkbank/sdk-go/starkbank/invoicepullsubscription"
)

func main() {
    
    var params = map[string]interface{}{}
    params["after"] = time.Date(2025, 10, 1, 0, 0, 0, 0, time.UTC)
    params["before"] = time.Date(2025, 10, 30, 0, 0, 0, 0, time.UTC)

    subscriptions, errorChannel := invoicepullsubscription.Query(params)
    
    loop:
    for {
        select {
        case err := <-errorChannel:
            if err.Errors != nil {
                for _, e := range err.Errors {
                    fmt.Printf("code: %s, message: %s", e.Code, e.Message)
                }
            }
        case subscription, ok := <-subscriptions:
            if !ok {
                break loop
            }
            fmt.Printf("%+v", subscription)
        }
    }
}
  

Clojure

Not yet available. Please contact us if you need this SDK.
  

Curl

curl --location --request GET '{{baseUrl}}/v2/invoice-pull-subscription' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}'
  
RESPONSE

Python

InvoicePullSubscription(
    amount=0,
    amount_min_limit=5000,
    bacen_id=RR2001818320250909WDW2JAoiyB2,
    created=2025-09-09 21:42:36.419070,
    data={'accountNumber': '9123900000', 'bankCode': '05097757', 'branchCode': '1126', 'taxId': '20.018.183/0001-80'},
    display_description=Dragon Travel Fare,
    due=2025-09-11 21:42:35.878330,
    end=2025-10-14 03:00:00,
    external_id=e0ef6c02-f58e-44cd-b04d-e914d4df9405,
    id=4656724615102464,
    interval=month,
    name=John Snow,
    pull_mode=manual,
    pull_retry_limit=3,
    reference_code=contract-12345,
    start=2025-09-14 03:00:00,
    status=active,
    tags=[],
    tax_id=012.345.678-90,
    type=push,
    updated=2025-09-09 21:42:43.694648
)
  

Javascript

InvoicePullSubscription {
  id: '4656724615102464',
  start: '2025-09-14T03:00:00+00:00',
  interval: 'month',
  pullMode: 'manual',
  pullRetryLimit: 3,
  type: 'push',
  amount: 0,
  amountMinLimit: 5000,
  displayDescription: 'Dragon Travel Fare',
  due: '2025-09-11T21:42:35.878330+00:00',
  externalId: 'e0ef6c02-f58e-44cd-b04d-e914d4df9405',
  referenceCode: 'contract-12345',
  end: '2025-10-14T03:00:00+00:00',
  data: {
    accountNumber: '9123900000',
    bankCode: '05097757',
    branchCode: '1126',
    taxId: '20.018.183/0001-80'
  },
  name: 'John Snow',
  taxId: '012.345.678-90',
  tags: [],
  status: 'active',
  bacenId: 'RR2001818320250909WDW2JAoiyB2',
  installmentId: null,
  created: '2025-09-09T21:42:36.419070+00:00',
  updated: '2025-09-09T21:42:43.694648+00:00',
  brcode: ''
}
  

PHP

StarkBankInvoicePullSubscription Object
(
    [id] => 4745120922468352
    [start] => DateTime Object
        (
            [date] => 2025-09-22 03:00:00.000000
            [timezone_type] => 1
            [timezone] => +00:00
        )

    [interval] => month
    [pullMode] => manual
    [pullRetryLimit] => 3
    [type] => paymentAndOrQrcode
    [amount] => 0
    [amountMinLimit] => 5000
    [displayDescription] => Dragon Travel Fare
    [due] => DateTime Object
        (
            [date] => 2025-10-28 02:59:59.999999
            [timezone_type] => 1
            [timezone] => +00:00
        )

    [externalId] => php-321899546
    [referenceCode] => contract-12345
    [end] => DateTime Object
        (
            [date] => 2025-10-27 03:00:00.000000
            [timezone_type] => 1
            [timezone] => +00:00
        )

    [data] => Array
        (
            [accountNumber] => 
            [bankCode] => 
            [branchCode] => 
            [taxId] => 
            [invoiceId] => 5454444799983616
        )

    [name] => John Snow
    [taxId] => 012.345.678-90
    [tags] => Array
        (
        )

    [status] => created
    [bacenId] => RR3990842720250922sE0pvKkcjwQ
    [installmentId] => 
    [created] => DateTime Object
        (
            [date] => 2025-09-22 23:55:59.387197
            [timezone_type] => 1
            [timezone] => +00:00
        )

    [updated] => DateTime Object
        (
            [date] => 2025-09-22 23:55:59.387204
            [timezone_type] => 1
            [timezone] => +00:00
        )

    [brcode] => 00020101021226940014br.gov.bcb.pix2572brcode-h.sandbox.starkinfra.com/v2/cobv/de7659408ca446ae8bd1825b247c2ab05204000053039865802BR5925Stark Sociedade de Credit6009Sao Paulo62070503***80930014br.gov.bcb.pix2571brcode-h.sandbox.starkinfra.com/v2/rec/de7659408ca446ae8bd1825b247c2ab06304F3FD
)
  

Java

InvoicePullSubscription({
  "start": "2025-09-30T03:00:00+00:00",
  "interval": "month",
  "pullMode": "manual",
  "pullRetryLimit": 3,
  "type": "qrcodeAndPayment",
  "amount": 0,
  "amountMinLimit": 5000,
  "displayDescription": "Dragon Travel Fare",
  "due": "2025-09-27T19:16:43.425562+00:00",
  "externalId": "c3c1b1cf-d7ef-4f32-88fa-caa3a7741d11",
  "referenceCode": "contract-12345",
  "end": "2025-10-30T03:00:00+00:00",
  "data": {
    "accountNumber": "",
    "bankCode": "",
    "branchCode": "",
    "taxId": "",
    "invoiceId": "6533210687143936"
  },
  "name": "John Snow",
  "taxId": "012.345.678-90",
  "tags": [],
  "status": "created",
  "bacenId": "RR200181832025092503I3Q63WR3y",
  "brcode": "00020101021226890014br.gov.bcb.pix2567brcode-h.sandbox.starkinfra.com/v2/48d155b0d0e54318bcb236ff8bbf4b8e5204000053039865802BR5925Stark Bank S.A. - Institu6009Sao Paulo62070503***80930014br.gov.bcb.pix2571brcode-h.sandbox.starkinfra.com/v2/rec/48d155b0d0e54318bcb236ff8bbf4b8e6304A469",
  "created": "2025-09-25T19:16:44.314460+00:00",
  "updated": "2025-09-25T19:16:45.832785+00:00",
  "id": "4891450525351936"
})
InvoicePullSubscription({
  "start": "2025-09-30T03:00:00+00:00",
  "interval": "month",
  "pullMode": "manual",
  "pullRetryLimit": 3,
  "type": "qrcode",
  "amount": 0,
  "amountMinLimit": 5000,
  "displayDescription": "Dragon Travel Fare",
  "due": "2025-09-27T19:16:17.982467+00:00",
  "externalId": "4de75b5b-28a0-427a-874f-2aa0ebd67998",
  "referenceCode": "contract-12345",
  "end": "2025-10-30T03:00:00+00:00",
  "data": {
    "accountNumber": "503197811009373",
    "bankCode": "05463212",
    "branchCode": "5955",
    "taxId": "60.967.498/0001-98"
  },
  "name": "John Snow",
  "taxId": "012.345.678-90",
  "tags": [],
  "status": "active",
  "bacenId": "RR2001818320250925gHSuoalowZ4",
  "brcode": "00020101021226180014br.gov.bcb.pix5204000053039865802BR5925Stark Bank S.A. - Institu6009Sao Paulo62070503***80930014br.gov.bcb.pix2571brcode-h.sandbox.starkinfra.com/v2/rec/a8be8168a527464aa3fca7255e719e586304F824",
  "created": "2025-09-25T19:16:18.571610+00:00",
  "updated": "2025-09-25T19:20:39.657424+00:00",
  "id": "6096761516982272"
})
  

Ruby

Not yet available. Please contact us if you need this SDK.
  

Elixir

Not yet available. Please contact us if you need this SDK.
  

C#

InvoicePullSubscription(
  Start: 9/14/2025 12:00:00AM,
  Interval: month,
  PullMode: manual,
  PullRetryLimit: 3,
  Type: push,
  Amount: 0,
  AmountMinLimit: 5000,
  DisplayDescription: Dragon Travel Fare,
  Due: 9/11/2025 6:42:35PM,
  ExternalID: e0ef6c02-f58e-44cd-b04d-e914d4df9405,
  ReferenceCode: contract-12345,
  End: 10/14/2025 12:00:00AM,
  Data: System.Collections.Generic.Dictionary`2[System.String,System.Object],
  Name: John Snow,
  TaxID: 012.345.678-90,
  Tags: {  },
  Status: active,
  BacenID: RR2001818320250909WDW2JAoiyB2,
  Brcode: ,
  Created: 9/9/2025 6:42:36PM,
  Updated: 9/9/2025 6:42:43PM,
  ID: 4656724615102464
)
    

Go

{
    Id:5920644369743872
    Start:2025-11-03 03:00:00 +0000 +0000
    Interval:month
    PullMode:manual
    PullRetryLimit:3
    Type:push
    Amount:1000000
    AmountMinLimit:5000
    DisplayDescription:Dragon Travel Fare
    Due:2025-10-31 18:40:22.174967 +0000 +0000
    ExternalId:my_external_id
    ReferenceCode:contract-12345
    End:2025-12-03 03:00:00 +0000 +0000
    Data:map[accountNumber:9123900000 bankCode:05097757 branchCode:1126 taxId:20.018.183/0001-80]
    Name:John Snow
    TaxId:012.345.678-90
    Tags:[]
    Status:active
    BacenId:RR2001818320251029Lh5Z1T6zApm
    Brcode:
    Created:2025-10-29 18:40:22.898234 +0000 +0000
    Updated:2025-10-29 18:40:32.820757 +0000 +0000
}
  

Clojure

Not yet available. Please contact us if you need this SDK.
  

Curl

{
    "subscriptions": [
        {
            "amount": 0,
            "amountMinLimit": 5000,
            "bacenId": "RR20018183202509096amQtgYdMTf",
            "brcode": "",
            "created": "2025-09-09T21:34:55.854022+00:00",
            "updated": "2025-09-09T21:34:55.854028+00:00",
            "displayDescription": "Dragon Travel Fare",
            "referenceCode": "contract-12345",
            "due": "2025-09-11T21:34:55.157021+00:00",
            "externalId": "b7e6a2c2-8e2b-4c1a-9e2a-123456789abc",
            "id": "6633844090339328",
            "start": "2025-09-14T03:00:00+00:00",
            "end": "2025-10-14T03:00:00+00:00",
            "interval": "month",
            "data": {
                "accountNumber": "9123900000",
                "bankCode": "05097757",
                "branchCode": "1126",
                "taxId": "20.018.183/0001-80"
            },
            "pullMode": "manual",
            "pullRetryLimit": 3,
            "name": "John Snow",
            "taxId": "012.345.678-90",
            "status": "created",
            "tags": [],
            "type": "push"
        }
    ]
}
  

Get an Invoice Pull Subscription

Get a single invoice pull subscription by its id.

Parameters

id REQUIRED

String used to get the specific invoice pull subscription by its ID.

ENDPOINT
GET /v2/invoice-pull-subscription/:id
REQUEST

Python

import starkbank

subscriptions = starkbank.invoicepullsubscription.get("4656724615102464")

for subscription in subscriptions:
    print(subscription)
  

Javascript

const starkbank = require('starkbank');

(async() => {
    let subscriptions = await starkbank.invoicePullSubscription.get("4656724615102464");

    for await (let subscription of subscriptions){
        console.log(subscription);
    }
})();
  

PHP

$subscription = StarkBankInvoicePullSubscription::get("4745120922468352");

print_r($subscription);
  

Java

import com.starkbank.*;

InvoicePullSubscription subscription = InvoicePullSubscription.get("4891450525351936");

System.out.println(subscription);
  

Ruby

Not yet available. Please contact us if you need this SDK.
  

Elixir

Not yet available. Please contact us if you need this SDK.
  

C#

using System;

InvoicePullSubscription subscription = InvoicePullSubscription.Get("4656724615102464");

Console.WriteLine(subscription);
  

Go

package main

import (
    "fmt"
    "github.com/starkbank/sdk-go/starkbank/invoicepullsubscription"
)

func main() {

    subscription, err := invoicepullsubscription.Get("5920644369743872", nil)
    if err.Errors != nil {
        for _, e := range err.Errors {
            fmt.Printf("code: %s, message: %s", e.Code, e.Message)
        }
    }
    fmt.Printf("%+v", subscription)
}
  

Clojure

Not yet available. Please contact us if you need this SDK.
  

Curl

curl --location --request GET '{{baseUrl}}/v2/invoice-pull-subscription/4582433332658176' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}'
  
RESPONSE

Python

InvoicePullSubscription(
    amount=0,
    amount_min_limit=5000,
    bacen_id=RR2001818320250909WDW2JAoiyB2,
    created=2025-09-09 21:42:36.419070,
    data={'accountNumber': '9123900000', 'bankCode': '05097757', 'branchCode': '1126', 'taxId': '20.018.183/0001-80'},
    display_description=Dragon Travel Fare,
    due=2025-09-11 21:42:35.878330,
    end=2025-10-14 03:00:00,
    external_id=e0ef6c02-f58e-44cd-b04d-e914d4df9405,
    id=4656724615102464,
    interval=month,
    name=John Snow,
    pull_mode=manual,
    pull_retry_limit=3,
    reference_code=contract-12345,
    start=2025-09-14 03:00:00,
    status=active,
    tags=[],
    tax_id=012.345.678-90,
    type=push,
    updated=2025-09-09 21:42:43.694648
)
  

Javascript

InvoicePullSubscription {
  id: '4656724615102464',
  start: '2025-09-14T03:00:00+00:00',
  interval: 'month',
  pullMode: 'manual',
  pullRetryLimit: 3,
  type: 'push',
  amount: 0,
  amountMinLimit: 5000,
  displayDescription: 'Dragon Travel Fare',
  due: '2025-09-11T21:42:35.878330+00:00',
  externalId: 'e0ef6c02-f58e-44cd-b04d-e914d4df9405',
  referenceCode: 'contract-12345',
  end: '2025-10-14T03:00:00+00:00',
  data: {
    accountNumber: '9123900000',
    bankCode: '05097757',
    branchCode: '1126',
    taxId: '20.018.183/0001-80'
  },
  name: 'John Snow',
  taxId: '012.345.678-90',
  tags: [],
  status: 'active',
  bacenId: 'RR2001818320250909WDW2JAoiyB2',
  installmentId: null,
  created: '2025-09-09T21:42:36.419070+00:00',
  updated: '2025-09-09T21:42:43.694648+00:00',
  brcode: ''
}
  

PHP

StarkBankInvoicePullSubscription Object
(
    [id] => 4745120922468352
    [start] => DateTime Object
        (
            [date] => 2025-09-22 03:00:00.000000
            [timezone_type] => 1
            [timezone] => +00:00
        )

    [interval] => month
    [pullMode] => manual
    [pullRetryLimit] => 3
    [type] => paymentAndOrQrcode
    [amount] => 0
    [amountMinLimit] => 5000
    [displayDescription] => Dragon Travel Fare
    [due] => DateTime Object
        (
            [date] => 2025-10-28 02:59:59.999999
            [timezone_type] => 1
            [timezone] => +00:00
        )

    [externalId] => php-321899546
    [referenceCode] => contract-12345
    [end] => DateTime Object
        (
            [date] => 2025-10-27 03:00:00.000000
            [timezone_type] => 1
            [timezone] => +00:00
        )

    [data] => Array
        (
            [accountNumber] => 
            [bankCode] => 
            [branchCode] => 
            [taxId] => 
            [invoiceId] => 5454444799983616
        )

    [name] => John Snow
    [taxId] => 012.345.678-90
    [tags] => Array
        (
        )

    [status] => created
    [bacenId] => RR3990842720250922sE0pvKkcjwQ
    [installmentId] => 
    [created] => DateTime Object
        (
            [date] => 2025-09-22 23:55:59.387197
            [timezone_type] => 1
            [timezone] => +00:00
        )

    [updated] => DateTime Object
        (
            [date] => 2025-09-22 23:56:00.743753
            [timezone_type] => 1
            [timezone] => +00:00
        )

    [brcode] => 00020101021226940014br.gov.bcb.pix2572brcode-h.sandbox.starkinfra.com/v2/cobv/de7659408ca446ae8bd1825b247c2ab05204000053039865802BR5925Stark Sociedade de Credit6009Sao Paulo62070503***80930014br.gov.bcb.pix2571brcode-h.sandbox.starkinfra.com/v2/rec/de7659408ca446ae8bd1825b247c2ab06304F3FD
)
  

Java

InvoicePullSubscription({
  "start": "2025-09-30T03:00:00+00:00",
  "interval": "month",
  "pullMode": "manual",
  "pullRetryLimit": 3,
  "type": "qrcodeAndPayment",
  "amount": 0,
  "amountMinLimit": 5000,
  "displayDescription": "Dragon Travel Fare",
  "due": "2025-09-27T19:16:43.425562+00:00",
  "externalId": "c3c1b1cf-d7ef-4f32-88fa-caa3a7741d11",
  "referenceCode": "contract-12345",
  "end": "2025-10-30T03:00:00+00:00",
  "data": {
    "accountNumber": "9935081231275232",
    "bankCode": "01609345",
    "branchCode": "8246",
    "taxId": "830.079.880-39",
    "invoiceId": "6533210687143936"
  },
  "name": "John Snow",
  "taxId": "012.345.678-90",
  "tags": [],
  "status": "active",
  "bacenId": "RR200181832025092503I3Q63WR3y",
  "brcode": "00020101021226890014br.gov.bcb.pix2567brcode-h.sandbox.starkinfra.com/v2/48d155b0d0e54318bcb236ff8bbf4b8e5204000053039865802BR5925Stark Bank S.A. - Institu6009Sao Paulo62070503***80930014br.gov.bcb.pix2571brcode-h.sandbox.starkinfra.com/v2/rec/48d155b0d0e54318bcb236ff8bbf4b8e6304A469",
  "created": "2025-09-25T19:16:44.314460+00:00",
  "updated": "2025-09-25T19:25:12.404204+00:00",
  "id": "4891450525351936"
})
  

Ruby

Not yet available. Please contact us if you need this SDK.
  

Elixir

Not yet available. Please contact us if you need this SDK.
  

C#

InvoicePullSubscription(
  Start: 9/14/2025 12:00:00AM,
  Interval: month,
  PullMode: manual,
  PullRetryLimit: 3,
  Type: push,
  Amount: 0,
  AmountMinLimit: 5000,
  DisplayDescription: Dragon Travel Fare,
  Due: 9/11/2025 6:42:35PM,
  ExternalID: e0ef6c02-f58e-44cd-b04d-e914d4df9405,
  ReferenceCode: contract-12345,
  End: 10/14/2025 12:00:00AM,
  Data: System.Collections.Generic.Dictionary`2[System.String,System.Object],
  Name: John Snow,
  TaxID: 012.345.678-90,
  Tags: {  },
  Status: active,
  BacenID: RR2001818320250909WDW2JAoiyB2,
  Brcode: ,
  Created: 9/9/2025 6:42:36PM,
  Updated: 9/9/2025 6:42:43PM,
  ID: 4656724615102464
)
    

Go

{
    Id:5920644369743872
    Start:2025-11-03 03:00:00 +0000 +0000
    Interval:month
    PullMode:manual
    PullRetryLimit:3
    Type:push
    Amount:1000000
    AmountMinLimit:5000
    DisplayDescription:Dragon Travel Fare
    Due:2025-10-31 18:40:22.174967 +0000 +0000
    ExternalId:my_external_id
    ReferenceCode:contract-12345
    End:2025-12-03 03:00:00 +0000 +0000
    Data:map[accountNumber:9123900000 bankCode:05097757 branchCode:1126 taxId:20.018.183/0001-80]
    Name:John Snow
    TaxId:012.345.678-90
    Tags:[]
    Status:active
    BacenId:RR2001818320251029Lh5Z1T6zApm
    Brcode:
    Created:2025-10-29 18:40:22.898234 +0000 +0000
    Updated:2025-10-29 18:40:32.820757 +0000 +0000
}
  

Clojure

Not yet available. Please contact us if you need this SDK.
  

Curl

{
    "subscriptions": {
        "amount": 0,
        "amountMinLimit": 5000,
        "bacenId": "RR20018183202509096amQtgYdMTf",
        "brcode": "",
        "created": "2025-09-09T21:34:55.854022+00:00",
        "updated": "2025-09-09T21:34:55.854028+00:00",
        "displayDescription": "Dragon Travel Fare",
        "referenceCode": "contract-12345",
        "due": "2025-09-11T21:34:55.157021+00:00",
        "externalId": "b7e6a2c2-8e2b-4c1a-9e2a-123456789abc",
        "id": "6633844090339328",
        "start": "2025-09-14T03:00:00+00:00",
        "end": "2025-10-14T03:00:00+00:00",
        "interval": "month",
        "data": {
            "accountNumber": "9123900000",
            "bankCode": "05097757",
            "branchCode": "1126",
            "taxId": "20.018.183/0001-80"
        },
        "pullMode": "manual",
        "pullRetryLimit": 3,
        "name": "John Snow",
        "taxId": "012.345.678-90",
        "status": "created",
        "tags": [],
        "type": "push"
    }
}
  

Cancel an Invoice Pull Subscription

Cancel an existing invoice pull subscription. The subscription must be with "active" status to be canceled.

Parameters

id REQUIRED

String used to get the specific invoice pull subscription by its ID.

ENDPOINT
DELETE /v2/invoice-pull-subscription/:id
REQUEST

Python

import starkbank

subscriptions = starkbank.invoicepullsubscription.cancel("4656724615102464")

print(subscription)
  

Javascript

const starkbank = require('starkbank');

(async() => {
    let subscription = await starkbank.invoicePullSubscription.cancel("4710331041447936");

    console.log(subscription);
})();
  

PHP

$subscription = StarkBankInvoicePullSubscription::cancel("4745120922468352");

print_r($subscription);
  

Java

import com.starkbank.*;

InvoicePullSubscription subscription = InvoicePullSubscription.cancel("4891450525351936");

System.out.println(subscription);
  

Ruby

Not yet available. Please contact us if you need this SDK.
  

Elixir

Not yet available. Please contact us if you need this SDK.
  

C#

using System;

InvoicePullSubscription subscription = InvoicePullSubscription.Cancel("5951120425877504");

Console.WriteLine(subscription);
  

Go

package main

import (
    "fmt"
    "github.com/starkbank/sdk-go/starkbank/invoicepullsubscription"
)

func main() {

    subscription, err := invoicepullsubscription.Cancel("5920644369743872", nil)
    if err.Errors != nil {
        for _, e := range err.Errors {
            fmt.Printf("code: %s, message: %s", e.Code, e.Message)
        }
    }
    fmt.Printf("%+v", subscription)
}
  

Clojure

Not yet available. Please contact us if you need this SDK.
  

Curl

curl --location --request DELETE '{{baseUrl}}/v2/invoice-pull-subscription/4582433332658176' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}' 
--header 'Content-Type: application/json'
  
RESPONSE

Python

InvoicePullSubscription(
        amount=0,
        amount_min_limit=5000,
        bacen_id=RR2001818320250909WDW2JAoiyB2,
        created=2025-09-09 21:42:36.419070,
        data={'accountNumber': '9123900000', 'bankCode': '05097757', 'branchCode': '1126', 'taxId': '20.018.183/0001-80'},
        display_description=Dragon Travel Fare,
        due=2025-09-11 21:42:35.878330,
        end=2025-10-14 03:00:00,
        external_id=e0ef6c02-f58e-44cd-b04d-e914d4df9405,
        id=4656724615102464,
        interval=month,
        name=John Snow,
        pull_mode=manual,
        pull_retry_limit=3,
        reference_code=contract-12345,
        start=2025-09-14 03:00:00,
        status=active,
        tags=[],
        tax_id=012.345.678-90,
        type=push,
        updated=2025-09-09 21:42:43.694648
)
  

Javascript

InvoicePullSubscription {
  id: '4710331041447936',
  start: '2025-09-14T03:00:00+00:00',
  interval: 'month',
  pullMode: 'manual',
  pullRetryLimit: 3,
  type: 'push',
  amount: 1000000,
  amountMinLimit: 5000,
  displayDescription: 'Dragon Travel Fare',
  due: '2025-09-11T21:45:59.054486+00:00',
  externalId: '878abdf9-738f-4c54-a3a2-b6556939416f',
  referenceCode: 'contract-12345',
  end: '2025-10-14T03:00:00+00:00',
  data: {
    accountNumber: '9123900000',
    bankCode: '05097757',
    branchCode: '1126',
    taxId: '20.018.183/0001-80'
  },
  name: 'John Snow',
  taxId: '012.345.678-90',
  tags: [],
  status: 'active',
  bacenId: 'RR2001818320250909mHJ5ztngywk',
  installmentId: null,
  created: '2025-09-09T21:45:59.496556+00:00',
  updated: '2025-09-09T21:46:07.020712+00:00',
  brcode: ''
}
  

PHP

StarkBankInvoicePullSubscription Object
(
    [id] => 4745120922468352
    [start] => DateTime Object
        (
            [date] => 2025-09-22 03:00:00.000000
            [timezone_type] => 1
            [timezone] => +00:00
        )

    [interval] => month
    [pullMode] => manual
    [pullRetryLimit] => 3
    [type] => paymentAndOrQrcode
    [amount] => 0
    [amountMinLimit] => 5000
    [displayDescription] => Dragon Travel Fare
    [due] => DateTime Object
        (
            [date] => 2025-10-28 02:59:59.999999
            [timezone_type] => 1
            [timezone] => +00:00
        )

    [externalId] => php-321899546
    [referenceCode] => contract-12345
    [end] => DateTime Object
        (
            [date] => 2025-10-27 03:00:00.000000
            [timezone_type] => 1
            [timezone] => +00:00
        )

    [data] => Array
        (
            [accountNumber] => 
            [bankCode] => 
            [branchCode] => 
            [taxId] => 
            [invoiceId] => 5454444799983616
        )

    [name] => John Snow
    [taxId] => 012.345.678-90
    [tags] => Array
        (
        )

    [status] => created
    [bacenId] => RR3990842720250922sE0pvKkcjwQ
    [installmentId] => 
    [created] => DateTime Object
        (
            [date] => 2025-09-22 23:55:59.387197
            [timezone_type] => 1
            [timezone] => +00:00
        )

    [updated] => DateTime Object
        (
            [date] => 2025-09-22 23:56:00.743753
            [timezone_type] => 1
            [timezone] => +00:00
        )

    [brcode] => 00020101021226940014br.gov.bcb.pix2572brcode-h.sandbox.starkinfra.com/v2/cobv/de7659408ca446ae8bd1825b247c2ab05204000053039865802BR5925Stark Sociedade de Credit6009Sao Paulo62070503***80930014br.gov.bcb.pix2571brcode-h.sandbox.starkinfra.com/v2/rec/de7659408ca446ae8bd1825b247c2ab06304F3FD
)
  

Java

InvoicePullSubscription({
  "start": "2025-09-30T03:00:00+00:00",
  "interval": "month",
  "pullMode": "manual",
  "pullRetryLimit": 3,
  "type": "qrcodeAndPayment",
  "amount": 0,
  "amountMinLimit": 5000,
  "displayDescription": "Dragon Travel Fare",
  "due": "2025-09-27T19:16:43.425562+00:00",
  "externalId": "c3c1b1cf-d7ef-4f32-88fa-caa3a7741d11",
  "referenceCode": "contract-12345",
  "end": "2025-10-30T03:00:00+00:00",
  "data": {
    "accountNumber": "9935081231275232",
    "bankCode": "01609345",
    "branchCode": "8246",
    "taxId": "830.079.880-39",
    "invoiceId": "6533210687143936"
  },
  "name": "John Snow",
  "taxId": "012.345.678-90",
  "tags": [],
  "status": "active",
  "bacenId": "RR200181832025092503I3Q63WR3y",
  "brcode": "00020101021226890014br.gov.bcb.pix2567brcode-h.sandbox.starkinfra.com/v2/48d155b0d0e54318bcb236ff8bbf4b8e5204000053039865802BR5925Stark Bank S.A. - Institu6009Sao Paulo62070503***80930014br.gov.bcb.pix2571brcode-h.sandbox.starkinfra.com/v2/rec/48d155b0d0e54318bcb236ff8bbf4b8e6304A469",
  "created": "2025-09-25T19:16:44.314460+00:00",
  "updated": "2025-09-25T19:25:12.404204+00:00",
  "id": "4891450525351936"
})
  

Ruby

Not yet available. Please contact us if you need this SDK.
  

Elixir

Not yet available. Please contact us if you need this SDK.
  

C#

InvoicePullSubscription(
  Start: 9/14/2025 12:00:00AM,
  Interval: month,
  PullMode: manual,
  PullRetryLimit: 3,
  Type: push,
  Amount: 1000000,
  AmountMinLimit: 5000,
  DisplayDescription: Dragon Travel Fare,
  Due: 9/11/2025 6:55:41PM,
  ExternalID: f4a4c70b-bf5a-400d-8eae-685128691645x,
  ReferenceCode: contract-12345,
  End: 10/14/2025 12:00:00AM,
  Data: System.Collections.Generic.Dictionary`2[System.String,System.Object],
  Name: John Snow,
  TaxID: 012.345.678-90,
  Tags: {  },
  Status: active,
  BacenID: RR2001818320250909bdvoEjRhCJ6,
  Brcode: ,
  Created: 9/9/2025 6:55:42PM,
  Updated: 9/9/2025 6:55:51PM,
  ID: 5951120425877504
)
    

Go

{
    Id:5920644369743872
    Start:2025-11-03 03:00:00 +0000 +0000
    Interval:month
    PullMode:manual
    PullRetryLimit:3
    Type:push
    Amount:1000000
    AmountMinLimit:5000
    DisplayDescription:Dragon Travel Fare
    Due:2025-10-31 18:40:22.174967 +0000 +0000
    ExternalId:my_external_id
    ReferenceCode:contract-12345
    End:2025-12-03 03:00:00 +0000 +0000
    Data:map[accountNumber:9123900000 bankCode:05097757 branchCode:1126 taxId:20.018.183/0001-80]
    Name:John Snow
    TaxId:012.345.678-90
    Tags:[]
    Status:active
    BacenId:RR2001818320251029Lh5Z1T6zApm
    Brcode:
    Created:2025-10-29 18:40:22.898234 +0000 +0000
    Updated:2025-10-29 18:40:32.820757 +0000 +0000
}
  

Clojure

Not yet available. Please contact us if you need this SDK.
  

Curl

{
    "message": "Subscription cancellation successfully requested",
    "subscription": {
        "amount": 1000000,
        "amountMinLimit": 5000,
        "bacenId": "RR2001818320250909fxSoQw3VO04",
        "brcode": "",
        "created": "2025-09-09T21:58:03.557191+00:00",
        "updated": "2025-09-09T21:58:11.518639+00:00",
        "displayDescription": "Dragon Travel Fare",
        "referenceCode": "contract-12345",
        "due": "2025-09-11T21:58:02.951121+00:00",
        "externalId": "f4a4c70b-bf5a-400d-8eae-685128691645z",
        "id": "4582433332658176",
        "start": "2025-09-14T03:00:00+00:00",
        "end": "2025-10-14T03:00:00+00:00",
        "interval": "month",
        "data": {
            "accountNumber": "9123900000",
            "bankCode": "05097757",
            "branchCode": "1126",
            "taxId": "20.018.183/0001-80"
        },
        "pullMode": "manual",
        "pullRetryLimit": 3,
        "name": "John Snow",
        "taxId": "012.345.678-90",
        "status": "active",
        "tags": [],
        "type": "push"
    }
}
  

List Invoice Pull Subscription Logs

Get a paged list of invoice pull subscription logs. A log tracks a change in the entity according to its life cycle.

Parameters

after OPTIONAL

Filter entities created after this date.

before OPTIONAL

Filter entities created before this date.

cursor OPTIONAL

String used to get the next batch of results. Our SDKs handle this for you.

fields OPTIONAL

List of strings to filter response JSON keys. Not available in the SDKs.

limit OPTIONAL

Number of results per cursor. Max = 100.

subscriptionIds OPTIONAL

List of strings to get specific entities by ids.

tags OPTIONAL

Filter entities that contain the specified tags.

types OPTIONAL

Filter logs by log types.

ENDPOINT
GET /v2/invoice-pull-subscription/log
REQUEST

Python

import starkbank

logs = starkbank.invoicepullsubscription.log.query(
    after="2025-09-01",
    before="2025-09-30",
)

for log in logs:
    print(log)
  

Javascript

const starkbank = require('starkbank');

(async() => {
    let logs = await starkbank.invoicePullSubscription.Log.query({
        after: '2025-09-01',
        before: '2025-09-30',
    });

    for await (let log of logs){
        console.log(log);
    }
})();
  

PHP

$logs = StarkBankInvoicePullSubscriptionLog::query([
    "after" => "2025-09-01",
    "before" => "2025-09-30"
]);

foreach($logs as $log) {
    print_r($log);
}
  

Java

import com.starkbank.*;
import com.starkbank.utils.Generator;
import java.util.HashMap;

HashMap params = new HashMap<>();
params.put("after", "2025-09-01");
params.put("before", "2025-09-30");
Generator logs = InvoicePullSubscription.Log.query(params);

for (InvoicePullSubscription.Log log : logs) {
    System.out.println(log);
}
  

Ruby

Not yet available. Please contact us if you need this SDK.
  

Elixir

Not yet available. Please contact us if you need this SDK.
  

C#

using System;

IEnumerable<StarkBank.InvoicePullSubscription.Log> logs = StarkBank.InvoicePullSubscription.Log.Query(
    after: new DateTime(2025, 9, 1),
    before: new DateTime(2025, 9, 30)
);

foreach(StarkBank.InvoicePullSubscription.Log log in logs) {
    Console.WriteLine(log);
}
  

Go

package main

import (
    "fmt"
    "time"
    "github.com/starkbank/sdk-go/starkbank/invoicepullsubscription/log"
)

func main() {

    var params = map[string]interface{}{}
    params["after"] = time.Date(2025, 10, 1, 0, 0, 0, 0, time.UTC)
    params["before"] = time.Date(2025, 10, 30, 0, 0, 0, 0, time.UTC)

    logs, errorChannel := log.Query(params, nil)

    loop:
    for {
        select {
        case err := <-errorChannel:
            if err.Errors != nil {
                for _, e := range err.Errors {
                    fmt.Printf("code: %s, message: %s", e.Code, e.Message)
                }
            }
        case log, ok := <-logs:
            if !ok {
                break loop
            }
            fmt.Printf("%+v", log)
        }
    }
}
  

Clojure

Not yet available. Please contact us if you need this SDK.
  

Curl

curl --location --request GET '{{baseUrl}}/v2/invoice-pull-subscription/log' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}'
  
RESPONSE

Python

Log(
    created=2025-09-09 21:58:09.963082,
    errors=[],
    id=5631191491280896,
    subscription=InvoicePullSubscription(
            amount=1000000,
            amount_min_limit=5000,
            bacen_id=RR2001818320250909fxSoQw3VO04,
            created=2025-09-09 21:58:03.557191,
            data={'accountNumber': '9123900000', 'bankCode': '05097757', 'branchCode': '1126', 'taxId': '20.018.183/0001-80'},
            display_description=Dragon Travel Fare,
            due=2025-09-11 21:58:02.951121,
            end=2025-10-14 03:00:00,
            external_id=f4a4c70b-bf5a-400d-8eae-685128691645z,
            id=4582433332658176,
            interval=month,
            name=John Snow,
            pull_mode=manual,
            pull_retry_limit=3,
            reference_code=contract-12345,
            start=2025-09-14 03:00:00,
            status=active,
            tags=[],
            tax_id=012.345.678-90,
            type=push,
            updated=2025-09-09 21:58:11.552600
    ),
    type=confirmed
)
  

Javascript

Log {
  id: '5631191491280896',
  created: '2025-09-09T21:58:09.963082+00:00',
  type: 'confirmed',
  errors: [],
  subscription: {
    amount: 1000000,
    amountMinLimit: 5000,
    bacenId: 'RR2001818320250909fxSoQw3VO04',
    brcode: '',
    created: '2025-09-09T21:58:03.557191+00:00',
    updated: '2025-09-09T21:58:11.552600+00:00',
    displayDescription: 'Dragon Travel Fare',
    referenceCode: 'contract-12345',
    due: '2025-09-11T21:58:02.951121+00:00',
    externalId: 'f4a4c70b-bf5a-400d-8eae-685128691645z',
    id: '4582433332658176',
    start: '2025-09-14T03:00:00+00:00',
    end: '2025-10-14T03:00:00+00:00',
    interval: 'month',
    data: {
      accountNumber: '9123900000',
      bankCode: '05097757',
      branchCode: '1126',
      taxId: '20.018.183/0001-80'
    },
    pullMode: 'manual',
    pullRetryLimit: 3,
    name: 'John Snow',
    taxId: '012.345.678-90',
    status: 'active',
    tags: [],
    type: 'push'
  },
  reason: '',
  description: 'InvoicePullSubscription has been confirmed by Stark Bank'
}
  

PHP

StarkBankInvoicePullSubscriptionLog Object
(
    [id] => 6384415517179904
    [created] => DateTime Object
        (
            [date] => 2025-09-22 23:58:50.357703
            [timezone_type] => 1
            [timezone] => +00:00
        )

    [type] => created
    [errors] => Array
        (
        )

    [subscription] => StarkBankInvoicePullSubscription Object
        (
            [id] => 5871020829310976
            [start] => DateTime Object
                (
                    [date] => 2025-09-22 03:00:00.000000
                    [timezone_type] => 1
                    [timezone] => +00:00
                )

            [interval] => month
            [pullMode] => manual
            [pullRetryLimit] => 3
            [type] => paymentAndOrQrcode
            [amount] => 0
            [amountMinLimit] => 5000
            [displayDescription] => Dragon Travel Fare
            [due] => DateTime Object
                (
                    [date] => 2025-10-28 02:59:59.999999
                    [timezone_type] => 1
                    [timezone] => +00:00
                )

            [externalId] => php-1099271186
            [referenceCode] => contract-12345
            [end] => DateTime Object
                (
                    [date] => 2025-10-27 03:00:00.000000
                    [timezone_type] => 1
                    [timezone] => +00:00
                )

            [data] => Array
                (
                    [accountNumber] => 
                    [bankCode] => 
                    [branchCode] => 
                    [taxId] => 
                    [invoiceId] => 5431344117055488
                )

            [name] => John Snow
            [taxId] => 012.345.678-90
            [tags] => Array
                (
                )

            [status] => created
            [bacenId] => RR3990842720250922NsB4yILlA7C
            [installmentId] => 
            [created] => DateTime Object
                (
                    [date] => 2025-09-22 23:58:50.342539
                    [timezone_type] => 1
                    [timezone] => +00:00
                )

            [updated] => DateTime Object
                (
                    [date] => 2025-09-22 23:58:51.293971
                    [timezone_type] => 1
                    [timezone] => +00:00
                )

            [brcode] => 00020101021226940014br.gov.bcb.pix2572brcode-h.sandbox.starkinfra.com/v2/cobv/075f46d5578d4134bbe67f332fdca60b5204000053039865802BR5925Stark Sociedade de Credit6009Sao Paulo62070503***80930014br.gov.bcb.pix2571brcode-h.sandbox.starkinfra.com/v2/rec/075f46d5578d4134bbe67f332fdca60b6304743E
        )

    [reason] => 
    [description] => InvoicePullSubscription has been created
)
  

Java

Log({
  "created": "2025-09-25T19:28:17.065661+00:00",
  "type": "canceling",
  "errors": [],
  "subscription": {
    "start": "2025-09-30T03:00:00+00:00",
    "interval": "month",
    "pullMode": "manual",
    "pullRetryLimit": 3,
    "type": "qrcodeAndPayment",
    "amount": 0,
    "amountMinLimit": 5000,
    "displayDescription": "Dragon Travel Fare",
    "due": "2025-09-27T19:16:43.425562+00:00",
    "externalId": "c3c1b1cf-d7ef-4f32-88fa-caa3a7741d11",
    "referenceCode": "contract-12345",
    "end": "2025-10-30T03:00:00+00:00",
    "data": {
      "accountNumber": "9935081231275232",
      "bankCode": "01609345",
      "branchCode": "8246",
      "taxId": "830.079.880-39",
      "invoiceId": "6533210687143936"
    },
    "name": "John Snow",
    "taxId": "012.345.678-90",
    "tags": [],
    "status": "active",
    "bacenId": "RR200181832025092503I3Q63WR3y",
    "brcode": "00020101021226890014br.gov.bcb.pix2567brcode-h.sandbox.starkinfra.com/v2/48d155b0d0e54318bcb236ff8bbf4b8e5204000053039865802BR5925Stark Bank S.A. - Institu6009Sao Paulo62070503***80930014br.gov.bcb.pix2571brcode-h.sandbox.starkinfra.com/v2/rec/48d155b0d0e54318bcb236ff8bbf4b8e6304A469",
    "created": "2025-09-25T19:16:44.314460+00:00",
    "updated": "2025-09-25T19:28:22.228179+00:00",
    "id": "4891450525351936"
  },
  "id": "6428070772736000"
})
  

Ruby

Not yet available. Please contact us if you need this SDK.
  

Elixir

Not yet available. Please contact us if you need this SDK.
  

C#

Log(
  Created: 9/9/2025 6:58:09PM,
  Type: confirmed,
  Errors: {  },
  InvoicePullSubscription: InvoicePullSubscription(
    Start: 9/14/2025 12:00:00AM,
    Interval: month,
    PullMode: manual,
    PullRetryLimit: 3,
    Type: push,
    Amount: 1000000,
    AmountMinLimit: 5000,
    DisplayDescription: Dragon Travel Fare,
    Due: 9/11/2025 6:58:02PM,
    ExternalID: f4a4c70b-bf5a-400d-8eae-685128691645z,
    ReferenceCode: contract-12345,
    End: 10/14/2025 12:00:00AM,
    Data: System.Collections.Generic.Dictionary`2[System.String,System.Object],
    Name: John Snow,
    TaxID: 012.345.678-90,
    Tags: {  },
    Status: active,
    BacenID: RR2001818320250909fxSoQw3VO04,
    Brcode: ,
    Created: 9/9/2025 6:58:03PM,
    Updated: 9/9/2025 6:58:11PM,
    ID: 4582433332658176
  ),
  ID: 5631191491280896
)
    

Go

{
    Id:5719365156601856
    Subscription:
    {
        Id:5920644369743872
        Start:2025-11-03 03:00:00 +0000 +0000
        Interval:month
        PullMode:manual
        PullRetryLimit:3
        Type:push
        Amount:1000000
        AmountMinLimit:5000
        DisplayDescription:Dragon Travel Fare
        Due:2025-10-31 18:40:22.174967 +0000 +0000
        ExternalId:my_external_id22xxassdassxdd
        ReferenceCode:contract-12345
        End:2025-12-03 03:00:00 +0000 +0000
        Data:map[accountNumber:9123900000
        bankCode:05097757
        branchCode:1126
        taxId:20.018.183/0001-80]
        Name:John Snow
        TaxId:012.345.678-90
        Tags:[]
        Status:active
        BacenId:RR2001818320251029Lh5Z1T6zApm
        Brcode:
        Created:2025-10-29 18:40:22.898234 +0000 +0000
        Updated:2025-10-29 18:40:32.851443 +0000 +0000
    }
    Errors:[]
    Type:confirmed
    Created:2025-10-29 18:40:31.000994 +0000 +0000
}
  

Clojure

Not yet available. Please contact us if you need this SDK.
  

Curl

{
    "cursor": "CmAKFAoHY3JlYXRlZBIJCLLtq8z7g48DEkRqGWl-YXBpLW1zLWludm9pY2UtcHVsbC1zYnhyJwsSGkludm9pY2VQdWxsU3Vic2NyaXB0aW9uTG9nGICAgJj--OEJDBgAIAE=",
    "logs": [
        {
            "id": "5631191491280896",
            "type": "confirmed",
            "subscription": {
                "amount": 1000000,
                "amountMinLimit": 5000,
                "bacenId": "RR2001818320250909fxSoQw3VO04",
                "brcode": "",
                "created": "2025-09-09T21:58:03.557191+00:00",
                "updated": "2025-09-09T21:58:11.552600+00:00",
                "displayDescription": "Dragon Travel Fare",
                "referenceCode": "contract-12345",
                "due": "2025-09-11T21:58:02.951121+00:00",
                "externalId": "f4a4c70b-bf5a-400d-8eae-685128691645z",
                "id": "4582433332658176",
                "start": "2025-09-14T03:00:00+00:00",
                "end": "2025-10-14T03:00:00+00:00",
                "interval": "month",
                "data": {
                    "accountNumber": "9123900000",
                    "bankCode": "05097757",
                    "branchCode": "1126",
                    "taxId": "20.018.183/0001-80"
                },
                "pullMode": "manual",
                "pullRetryLimit": 3,
                "name": "John Snow",
                "taxId": "012.345.678-90",
                "status": "active",
                "tags": [],
                "type": "push"
            },
            "errors": [],
            "created": "2025-09-09T21:58:09.963082+00:00",
            "reason": "",
            "description": "InvoicePullSubscription has been confirmed by Stark Bank"
        }
    ]
}
  

Get an Invoice Pull Subscription Log

Get a single invoice pull subscription log by its id.

Parameters

id REQUIRED

String used to get the specific invoice pull subscription log by its ID.

ENDPOINT
GET /v2/invoice-pull-subscription/log/:id
REQUEST

Python

import starkbank

logs = starkbank.invoicepullsubscription.log.get("5631191491280896")

for log in logs:
    print(log)
  

Javascript

const starkbank = require('starkbank');

(async() => {
    let logs = await starkbank.invoicePullSubscription.Log.get("5631191491280896");

    for await (let log of logs){
        console.log(log);
    }
})();
  

PHP

$log = StarkBankInvoicePullSubscriptionLog::get("6384415517179904");

print_r($log);
  

Java

import com.starkbank.*;

InvoicePullSubscription.Log log = InvoicePullSubscription.Log.get("6428070772736000");

System.out.println(log);
  

Ruby

Not yet available. Please contact us if you need this SDK.
  

Elixir

Not yet available. Please contact us if you need this SDK.
  

C#

using System;

InvoicePullSubscription.Log log = InvoicePullSubscription.Log.Get("5631191491280896");

Console.WriteLine(log);
  

Go

package main

import (
    "fmt"
    "github.com/starkbank/sdk-go/starkbank/invoicepullsubscription/log"
)

func main() {

    log, err := log.Get("5719365156601856", nil)
    if err.Errors != nil {
        for _, e := range err.Errors {
            fmt.Printf("code: %s, message: %s", e.Code, e.Message)
        }
    }
    fmt.Printf("%+v", log)
}
  

Clojure

Not yet available. Please contact us if you need this SDK.
  

Curl

curl --location --request GET '{{baseUrl}}/v2/invoice-pull-subscription/log/5631191491280896' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}'
  
RESPONSE

Python

Log(
    created=2025-09-09 21:58:09.963082,
    errors=[],
    id=5631191491280896,
    subscription=InvoicePullSubscription(
            amount=1000000,
            amount_min_limit=5000,
            bacen_id=RR2001818320250909fxSoQw3VO04,
            created=2025-09-09 21:58:03.557191,
            data={'accountNumber': '9123900000', 'bankCode': '05097757', 'branchCode': '1126', 'taxId': '20.018.183/0001-80'},
            display_description=Dragon Travel Fare,
            due=2025-09-11 21:58:02.951121,
            end=2025-10-14 03:00:00,
            external_id=f4a4c70b-bf5a-400d-8eae-685128691645z,
            id=4582433332658176,
            interval=month,
            name=John Snow,
            pull_mode=manual,
            pull_retry_limit=3,
            reference_code=contract-12345,
            start=2025-09-14 03:00:00,
            status=active,
            tags=[],
            tax_id=012.345.678-90,
            type=push,
            updated=2025-09-09 21:58:11.552600
    ),
    type=confirmed
)
  

Javascript

Log {
  id: '5631191491280896',
  created: '2025-09-09T21:58:09.963082+00:00',
  type: 'confirmed',
  errors: [],
  subscription: {
    amount: 1000000,
    amountMinLimit: 5000,
    bacenId: 'RR2001818320250909fxSoQw3VO04',
    brcode: '',
    created: '2025-09-09T21:58:03.557191+00:00',
    updated: '2025-09-09T21:58:11.552600+00:00',
    displayDescription: 'Dragon Travel Fare',
    referenceCode: 'contract-12345',
    due: '2025-09-11T21:58:02.951121+00:00',
    externalId: 'f4a4c70b-bf5a-400d-8eae-685128691645z',
    id: '4582433332658176',
    start: '2025-09-14T03:00:00+00:00',
    end: '2025-10-14T03:00:00+00:00',
    interval: 'month',
    data: {
      accountNumber: '9123900000',
      bankCode: '05097757',
      branchCode: '1126',
      taxId: '20.018.183/0001-80'
    },
    pullMode: 'manual',
    pullRetryLimit: 3,
    name: 'John Snow',
    taxId: '012.345.678-90',
    status: 'active',
    tags: [],
    type: 'push'
  },
  reason: '',
  description: 'InvoicePullSubscription has been confirmed by Stark Bank'
}
  

PHP

StarkBankInvoicePullSubscriptionLog Object
(
    [id] => 6384415517179904
    [created] => DateTime Object
        (
            [date] => 2025-09-22 23:58:50.357703
            [timezone_type] => 1
            [timezone] => +00:00
        )

    [type] => created
    [errors] => Array
        (
        )

    [subscription] => StarkBankInvoicePullSubscription Object
        (
            [id] => 5871020829310976
            [start] => DateTime Object
                (
                    [date] => 2025-09-22 03:00:00.000000
                    [timezone_type] => 1
                    [timezone] => +00:00
                )

            [interval] => month
            [pullMode] => manual
            [pullRetryLimit] => 3
            [type] => paymentAndOrQrcode
            [amount] => 0
            [amountMinLimit] => 5000
            [displayDescription] => Dragon Travel Fare
            [due] => DateTime Object
                (
                    [date] => 2025-10-28 02:59:59.999999
                    [timezone_type] => 1
                    [timezone] => +00:00
                )

            [externalId] => php-1099271186
            [referenceCode] => contract-12345
            [end] => DateTime Object
                (
                    [date] => 2025-10-27 03:00:00.000000
                    [timezone_type] => 1
                    [timezone] => +00:00
                )

            [data] => Array
                (
                    [accountNumber] => 
                    [bankCode] => 
                    [branchCode] => 
                    [taxId] => 
                    [invoiceId] => 5431344117055488
                )

            [name] => John Snow
            [taxId] => 012.345.678-90
            [tags] => Array
                (
                )

            [status] => created
            [bacenId] => RR3990842720250922NsB4yILlA7C
            [installmentId] => 
            [created] => DateTime Object
                (
                    [date] => 2025-09-22 23:58:50.342539
                    [timezone_type] => 1
                    [timezone] => +00:00
                )

            [updated] => DateTime Object
                (
                    [date] => 2025-09-22 23:58:51.293971
                    [timezone_type] => 1
                    [timezone] => +00:00
                )

            [brcode] => 00020101021226940014br.gov.bcb.pix2572brcode-h.sandbox.starkinfra.com/v2/cobv/075f46d5578d4134bbe67f332fdca60b5204000053039865802BR5925Stark Sociedade de Credit6009Sao Paulo62070503***80930014br.gov.bcb.pix2571brcode-h.sandbox.starkinfra.com/v2/rec/075f46d5578d4134bbe67f332fdca60b6304743E
        )

    [reason] => 
    [description] => InvoicePullSubscription has been created
)
  

Java

Log({
  "created": "2025-09-25T19:28:17.065661+00:00",
  "type": "canceling",
  "errors": [],
  "subscription": {
    "start": "2025-09-30T03:00:00+00:00",
    "interval": "month",
    "pullMode": "manual",
    "pullRetryLimit": 3,
    "type": "qrcodeAndPayment",
    "amount": 0,
    "amountMinLimit": 5000,
    "displayDescription": "Dragon Travel Fare",
    "due": "2025-09-27T19:16:43.425562+00:00",
    "externalId": "c3c1b1cf-d7ef-4f32-88fa-caa3a7741d11",
    "referenceCode": "contract-12345",
    "end": "2025-10-30T03:00:00+00:00",
    "data": {
      "accountNumber": "9935081231275232",
      "bankCode": "01609345",
      "branchCode": "8246",
      "taxId": "830.079.880-39",
      "invoiceId": "6533210687143936"
    },
    "name": "John Snow",
    "taxId": "012.345.678-90",
    "tags": [],
    "status": "active",
    "bacenId": "RR200181832025092503I3Q63WR3y",
    "brcode": "00020101021226890014br.gov.bcb.pix2567brcode-h.sandbox.starkinfra.com/v2/48d155b0d0e54318bcb236ff8bbf4b8e5204000053039865802BR5925Stark Bank S.A. - Institu6009Sao Paulo62070503***80930014br.gov.bcb.pix2571brcode-h.sandbox.starkinfra.com/v2/rec/48d155b0d0e54318bcb236ff8bbf4b8e6304A469",
    "created": "2025-09-25T19:16:44.314460+00:00",
    "updated": "2025-09-25T19:28:22.228179+00:00",
    "id": "4891450525351936"
  },
  "id": "6428070772736000"
})
  

Ruby

Not yet available. Please contact us if you need this SDK.
  

Elixir

Not yet available. Please contact us if you need this SDK.
  

C#

Log(
  Created: 9/9/2025 6:58:09PM,
  Type: confirmed,
  Errors: {  },
  InvoicePullSubscription: InvoicePullSubscription(
    Start: 9/14/2025 12:00:00AM,
    Interval: month,
    PullMode: manual,
    PullRetryLimit: 3,
    Type: push,
    Amount: 1000000,
    AmountMinLimit: 5000,
    DisplayDescription: Dragon Travel Fare,
    Due: 9/11/2025 6:58:02PM,
    ExternalID: f4a4c70b-bf5a-400d-8eae-685128691645z,
    ReferenceCode: contract-12345,
    End: 10/14/2025 12:00:00AM,
    Data: System.Collections.Generic.Dictionary`2[System.String,System.Object],
    Name: John Snow,
    TaxID: 012.345.678-90,
    Tags: {  },
    Status: active,
    BacenID: RR2001818320250909fxSoQw3VO04,
    Brcode: ,
    Created: 9/9/2025 6:58:03PM,
    Updated: 9/9/2025 6:58:11PM,
    ID: 4582433332658176
  ),
  ID: 5631191491280896
)
    

Go

{
    Id:5719365156601856
    Subscription:
    {
        Id:5920644369743872
        Start:2025-11-03 03:00:00 +0000 +0000
        Interval:month
        PullMode:manual
        PullRetryLimit:3
        Type:push
        Amount:1000000
        AmountMinLimit:5000
        DisplayDescription:Dragon Travel Fare
        Due:2025-10-31 18:40:22.174967 +0000 +0000
        ExternalId:my_external_id
        ReferenceCode:contract-12345
        End:2025-12-03 03:00:00 +0000 +0000
        Data:map[accountNumber:9123900000 bankCode:05097757 branchCode:1126 taxId:20.018.183/0001-80]
        Name:John Snow
        TaxId:012.345.678-90
        Tags:[]
        Status:active
        BacenId:RR2001818320251029Lh5Z1T6zApm
        Brcode:
        Created:2025-10-29 18:40:22.898234 +0000 +0000
        Updated:2025-10-29 18:40:32.851443 +0000 +0000
    }
    Errors:[]
    Type:confirmed
    Created:2025-10-29 18:40:31.000994 +0000 +0000
}
  

Clojure

Not yet available. Please contact us if you need this SDK.
  

Curl

{
    "log": {
        "id": "5631191491280896",
        "type": "confirmed",
        "subscription": {
            "amount": 1000000,
            "amountMinLimit": 5000,
            "bacenId": "RR2001818320250909fxSoQw3VO04",
            "brcode": "",
            "created": "2025-09-09T21:58:03.557191+00:00",
            "updated": "2025-09-09T21:58:11.552600+00:00",
            "displayDescription": "Dragon Travel Fare",
            "referenceCode": "contract-12345",
            "due": "2025-09-11T21:58:02.951121+00:00",
            "externalId": "f4a4c70b-bf5a-400d-8eae-685128691645z",
            "id": "4582433332658176",
            "start": "2025-09-14T03:00:00+00:00",
            "end": "2025-10-14T03:00:00+00:00",
            "interval": "month",
            "data": {
                "accountNumber": "9123900000",
                "bankCode": "05097757",
                "branchCode": "1126",
                "taxId": "20.018.183/0001-80"
            },
            "pullMode": "manual",
            "pullRetryLimit": 3,
            "name": "John Snow",
            "taxId": "012.345.678-90",
            "status": "active",
            "tags": [],
            "type": "push"
        },
        "errors": [],
        "created": "2025-09-09T21:58:09.963082+00:00",
        "reason": "",
        "description": "InvoicePullSubscription has been confirmed by Stark Bank"
    }
}
  

Invoice Pull Request

An Invoice Pull Request is a command sent to the payer's bank to trigger the automatic debit of a previously issued invoice linked to an active Invoice Pull Subscription. It confirms the receiver's intent to collect the agreed amount within the current billing cycle and initiates the settlement process through the Pix infrastructure.

You can use asynchronous webhooks to monitor status changes.

Invoice Pull Request Status

Invoice Pull Requests will follow the following life cycle: invoice-pull-request-status

Invoice Pull Request Logs

Every time either you or Stark Bank makes a change to an Invoice Pull Request, we create a log. Logs are pretty useful for understanding the life cycle of each Invoice Pull Request and the changes that happened to it. Here you can see the flow of possible logs: invoice-pull-request-log

The Invoice Pull Request object

Attributes

id STRING

Unique id for the pull request.

attemptType STRING

Type of attempt. Options: "default", "retry".

created STRING

Creation datetime. Example: "2020-04-23T23:00:00.000000+00:00".

displayDescription STRING

Description presented to the payer.

due STRING

Expected date of settlement.

externalId STRING

Unique external ID for the pull request.

installmentId STRING

ID of the installment linked to the pull request.

invoiceId STRING

ID of the invoice to be pulled.

status STRING

Current pull request status.

subscriptionId STRING

ID of the invoice pull subscription.

tags LIST OF STRINGS

Tags associated with the pull request.

updated STRING

Last update datetime. Example: "2020-04-23T23:00:00.000000+00:00".

Create Invoice Pull Requests

Use this route to create new invoice pull requests.

Parameters

attemptType REQUIRED

Define the type of attempt, if it is the first one of a billing cycle or if it is a retry. Options: "default", "retry".

due REQUIRED

Expected date of settlement.

invoiceId REQUIRED

Unique ID of the invoice to be pulled.

subscriptionId REQUIRED

Unique ID of the invoice pull subscription.

tags OPTIONAL

Array of strings to tag the entity for future queries. All tags will be converted to lowercase.

ENDPOINT
POST /v2/invoice-pull-request
REQUEST

Python

import starkbank

requests = starkbank.invoicepullrequest.create([
    starkbank.InvoicePullRequest(
        attempt_type="retry",
        due="2025-09-14",
        invoice_id="6649956664344576",
        subscription_id="4776669403414528",
        tags=[]
    )
])

for request in requests:
    print(request)
  

Javascript

const starkbank = require('starkbank');

(async() => {
    let requests = await starkbank.invoicePullRequest.create([{
        attemptType: 'default',
        due: '2025-09-14',
        invoiceId: '6649956664344576',
        subscriptionId: '4776669403414528',
        tags: []
    }]);

    for (let request of requests) {
        console.log(request);
    }
})();
  

PHP

$requests = InvoicePullRequest::create([new InvoicePullRequest([
    "attemptType" => "default",
    "due" => "2025-09-24",
    "invoiceId" => "4972480749895680",
    "subscriptionId" => "4799968485310464",
    "tags" => []
])]);

foreach ($requests as $request) {
    print_r($request);
}
  

Java

import com.starkbank.*;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

List requests = new ArrayList<>();

HashMap data = new HashMap<>();
data.put("attemptType", "default");
data.put("due", "2025-09-30");
data.put("invoiceId", "6028180624244736");
data.put("subscriptionId", "6673482343514112");
data.put("tags", new String[]{});

requests.add(new InvoicePullRequest(data));

requests = InvoicePullRequest.create(requests);

for (InvoicePullRequest request : requests) {
    System.out.println(request);
}
  

Ruby

Not yet available. Please contact us if you need this SDK.
  

Elixir

Not yet available. Please contact us if you need this SDK.
  

C#

using System;
using System.Collections.Generic;

List<InvoicePullRequest> requests = InvoicePullRequest.Create(new List<InvoicePullRequest> { new InvoicePullRequest(
    attemptType: "default",
    due: new DateTime(2025, 9, 14, 0, 0, 0, DateTimeKind.Utc),
    invoiceId: "6649956664344576",
    subscriptionId: "4656724615102464",
    tags: new List<string> { }
) });

foreach (StarkBank.InvoicePullRequest request in requests)
{
    Console.WriteLine(request);
}
  

Go

package main

import (
    "fmt"
    "time"
    "github.com/starkbank/sdk-go/starkbank/invoicepullrequest"
)

func main() {

  due := time.Date(2025, 11, 8, 0, 0, 0, 0, time.UTC)

	invoicePullRequest, err := invoicepullrequest.Create(
      []invoicepullrequest.InvoicePullRequest{
      {
          AttemptType:        "default",
          DisplayDescription: "Your description",
          Due:                &due,
          InvoiceId:          "5093778276745216",
          SubscriptionId:     "6136166097092608",
          Tags:               nil,
			},
          }, nil)


	if err.Errors != nil {
      for _, e := range err.Errors {
          t.Errorf("code: %s, message: %s", e.Code, e.Message)
      }
	}
	request := invoicePullRequest[0]
	fmt.Printf("%+v
", request)
}

Clojure

Not yet available. Please contact us if you need this SDK.
  

Curl

curl --location --request POST '{{baseUrl}}/v2/invoice-pull-request' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}' 
--header 'Content-Type: application/json' 
--data-raw '{
  "requests": [
    {
      "attemptType": "retry",
      "due": "2025-09-14",
      "invoiceId": "6649956664344576",
      "subscriptionId": "4776669403414528",
      "tags": []
    }
  ]
}'
  
RESPONSE

Python

InvoicePullRequest(
    attempt_type=retry,
    created=2025-09-10 18:21:46.579211,
    display_description=,
    due=2025-09-14 03:00:00,
    external_id=c3cb7f72c8d94069adbc52a3b65515a4,
    id=5649587104645120,
    installment_id=5187902950604800,
    invoice_id=6649956664344576,
    status=created,
    subscription_id=4776669403414528,
    tags=[],
    updated=2025-09-10 18:21:46.579216
)
  

Javascript

  InvoicePullRequest {
    id: '6604482620162048',
    subscriptionId: '4776669403414528',
    invoiceId: '6649956664344576',
    due: '2025-09-14T03:00:00+00:00',
    attemptType: 'default',
    tags: [],
    externalId: '33ae4ce29d4c461db23dfad8e7aebd7a',
    displayDescription: '',
    status: 'created',
    installmentId: '5187902950604800',
    created: '2025-09-10T18:10:55.772558+00:00',
    updated: '2025-09-10T18:10:55.772579+00:00'
  }
  

PHP

StarkBankInvoicePullRequest Object
(
    [id] => 5435095766794240
    [subscriptionId] => 4799968485310464
    [invoiceId] => 4972480749895680
    [due] => DateTime Object
        (
            [date] => 2025-09-24 03:00:00.000000
            [timezone_type] => 1
            [timezone] => +00:00
        )

    [attemptType] => default
    [tags] => Array
        (
        )

    [externalId] => 3daac091504545c084570293d28b68a6
    [displayDescription] => 
    [status] => created
    [bacenId] => 
    [installmentId] => 6475364738007040
    [created] => DateTime Object
        (
            [date] => 2025-09-23 00:04:33.991778
            [timezone_type] => 1
            [timezone] => +00:00
        )

    [updated] => DateTime Object
        (
            [date] => 2025-09-23 00:04:33.991783
            [timezone_type] => 1
            [timezone] => +00:00
        )

)
  

Java

InvoicePullRequest({
  "subscriptionId": "6673482343514112",
  "invoiceId": "6028180624244736",
  "due": "2025-09-30T03:00:00+00:00",
  "attemptType": "default",
  "tags": [],
  "externalId": "b333bae493584983b50d4a80d8ca63af",
  "displayDescription": "",
  "status": "created",
  "installmentId": "4639632834691072",
  "created": "2025-09-25T19:48:53.288222+00:00",
  "updated": "2025-09-25T19:48:53.288227+00:00",
  "id": "5044069638078464"
})
  

Ruby

Not yet available. Please contact us if you need this SDK.
  

Elixir

Not yet available. Please contact us if you need this SDK.
    

C#

InvoicePullRequest(
  SubscriptionID: 4656724615102464,
  InvoiceID: 6649956664344576,
  Due: 9/14/2025 12:00:00AM,
  AttemptType: default,
  Tags: {  },
  ExternalID: 37e3b27472184110948dd9df8bdb51c0,
  DisplayDescription: ,
  Status: created,
  InstallmentID: 4910532083580928,
  Created: 9/10/2025 3:26:37PM,
  Updated: 9/10/2025 3:26:37PM,
  ID: 5783254137307136
)
  

Go

{
    Id:4816160109363200
    SubscriptionId:6136166097092608
    InvoiceId:5093778276745216
    Due:2025-11-08 03:00:00 +0000 +0000
    AttemptType:default
    Tags:[]
    ExternalId:my_external_id
    DisplayDescription:Your description
    Status:created
    InstallmentId:6132781528645632
    Created:2025-10-30 19:58:50.973653 +0000 +0000
    Updated:2025-10-30 19:58:50.973658 +0000 +0000
}
  

Clojure

Not yet available. Please contact us if you need this SDK.
  

Curl

{
    "message": "Requests successfully created",
    "requests": [
        {
            "id": "6335888560750592",
            "subscriptionId": "4776669403414528",
            "installmentId": "5187902950604800",
            "invoiceId": "6649956664344576",
            "displayDescription": "",
            "attemptType": "retry",
            "due": "2025-09-14T03:00:00+00:00",
            "status": "created",
            "externalId": "36e2956f98324f8fbe1cc9bddf76374f",
            "tags": [],
            "created": "2025-09-10T18:15:58.731439+00:00",
            "updated": "2025-09-10T18:15:58.731450+00:00"
        }
    ]
}
  

List Invoice Pull Requests

Here you can list and filter all invoice pull requests you have made. We return it paged.

Parameters

after OPTIONAL

Filter entities created after this date.

before OPTIONAL

Filter entities created before this date.

cursor OPTIONAL

String used to get the next batch of results. Our SDKs handle this for you.

externalIds OPTIONAL

List of external IDs linked to the desired pull requests.

fields OPTIONAL

List of strings to filter response JSON keys. Not available in the SDKs.

ids OPTIONAL

List of strings to get specific entities by ids.

invoiceIds OPTIONAL

List of invoice IDs linked to the desired pull requests.

limit OPTIONAL

Number of results per cursor. Max = 100.

status OPTIONAL

Filter invoice pull request by the specified status.

subscriptionIds OPTIONAL

List of subscription IDs linked to the desired pull requests.

tags OPTIONAL

Filter entities that contain the specified tags.

ENDPOINT
GET /v2/invoice-pull-request
REQUEST

Python

import starkbank

requests = starkbank.invoicepullrequest.query(
    after="2025-08-01",
    before="2025-08-30",
)

for request in requests:
    print(request)
  

Javascript

const starkbank = require('starkbank');

(async() => {
    let requests = await starkbank.invoicePullRequest.query({
        after: '2025-08-01',
        before: '2025-08-30',
    });

    for await (let request of requests){
        console.log(request);
    }
})();
  

PHP

$requests = StarkBankInvoicePullRequest::query([
    "after" => "2025-09-01",
    "before" => "2025-09-30"
]);

foreach($requests as $request){
    print_r($request);
}
  

Java

import com.starkbank.*;
import com.starkbank.utils.Generator;
import java.util.HashMap;

HashMap params = new HashMap<>();
params.put("after", "2025-09-01");
params.put("before", "2025-09-30");
Generator requests = InvoicePullRequest.query(params);

for (InvoicePullRequest request : requests) {
    System.out.println(request);
}
  

Ruby

Not yet available. Please contact us if you need this SDK.
  

Elixir

Not yet available. Please contact us if you need this SDK.
  

C#

using System;

IEnumerable<StarkBank.InvoicePullRequest> requests = StarkBank.InvoicePullRequest.Query(
    after: new DateTime(2025, 9, 1),
    before: new DateTime(2025, 9, 30)
);

foreach(StarkBank.InvoicePullRequest request in requests) {
    Console.WriteLine(request);
}
  

Go

package main

import (
    "fmt"
    "github.com/starkbank/sdk-go/starkbank/invoicepullrequest"
)

func main() {

    var params = map[string]interface{}{}
    params["limit"] = 1

    requests, errorChannel := invoicepullrequest.Query(params, nil)
    loop:
    for {
        select {
        case err := <-errorChannel:
            if err.Errors != nil {
                for _, e := range err.Errors {
                    t.Errorf("code: %s, message: %s", e.Code, e.Message)
                }
            }
        case request, ok := <-requests:
            if !ok {
                break loop
            }
            fmt.Printf("%+v
", request)
        }
    }
}
  

Clojure

Not yet available. Please contact us if you need this SDK.
  

Curl

curl --location --request GET '{{baseUrl}}/v2/invoice-pull-request' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}'
  
RESPONSE

Python

InvoicePullRequest(
        attempt_type=default,
        created=2025-08-14 18:23:40.089592,
        display_description=,
        due=2025-08-16 23:59:59,
        external_id=c0a7f183f32e42b9a4cfc5ee997a3455,
        id=4875989783937024,
        installment_id=6381497086902272,
        invoice_id=5192316503457792,
        status=failed,
        subscription_id=4871746087813120,
        tags=[],
        updated=2025-08-17 00:00:07.816140
)
  

Javascript

InvoicePullRequest {
  id: '4875989783937024',
  subscriptionId: '4871746087813120',
  invoiceId: '5192316503457792',
  due: '2025-08-16T23:59:59+00:00',
  attemptType: 'default',
  tags: [],
  externalId: 'c0a7f183f32e42b9a4cfc5ee997a3455',
  displayDescription: '',
  status: 'failed',
  installmentId: '6381497086902272',
  created: '2025-08-14T18:23:40.089592+00:00',
  updated: '2025-08-17T00:00:07.816140+00:00'
}
  

PHP

StarkBankInvoicePullRequest Object
(
    [id] => 6604482620162048
    [subscriptionId] => 4776669403414528
    [invoiceId] => 6649956664344576
    [due] => DateTime Object
        (
            [date] => 2025-09-14 03:00:00.000000
            [timezone_type] => 1
            [timezone] => +00:00
        )

    [attemptType] => default
    [tags] => Array
        (
        )

    [externalId] => 33ae4ce29d4c461db23dfad8e7aebd7a
    [displayDescription] => 
    [status] => created
    [bacenId] => 
    [installmentId] => 5187902950604800
    [created] => DateTime Object
        (
            [date] => 2025-09-10 18:10:55.772558
            [timezone_type] => 1
            [timezone] => +00:00
        )

    [updated] => DateTime Object
        (
            [date] => 2025-09-10 18:30:03.457811
            [timezone_type] => 1
            [timezone] => +00:00
        )

)
    

Java

InvoicePullRequest({
  "subscriptionId": "6673482343514112",
  "invoiceId": "6028180624244736",
  "due": "2025-09-30T03:00:00+00:00",
  "attemptType": "default",
  "tags": [],
  "externalId": "b333bae493584983b50d4a80d8ca63af",
  "displayDescription": "",
  "status": "scheduled",
  "installmentId": "4639632834691072",
  "created": "2025-09-25T19:48:53.288222+00:00",
  "updated": "2025-09-25T19:49:03.030985+00:00",
  "id": "5044069638078464"
})
  

Ruby

Not yet available. Please contact us if you need this SDK.
  

Elixir

Not yet available. Please contact us if you need this SDK.
  

C#

InvoicePullRequest(
  SubscriptionID: 4871746087813120,
  InvoiceID: 5192316503457792,
  Due: 8/16/2025 8:59:59PM,
  AttemptType: default,
  Tags: {  },
  ExternalID: c0a7f183f32e42b9a4cfc5ee997a3455,
  DisplayDescription: ,
  Status: failed,
  InstallmentID: 6381497086902272,
  Created: 8/14/2025 3:23:40PM,
  Updated: 8/16/2025 9:00:07PM,
  ID: 4875989783937024
)
  

Go

{
    Id:6307501536444416
    SubscriptionId:5661633187676160
    InvoiceId:5995635400507392
    Due:2025-10-30 03:00:00 +0000 +0000
    AttemptType:retry
    Tags:[]
    ExternalId:my_external_id
    DisplayDescription:Your description
    Status:scheduled
    InstallmentId:4586921330212864
    Created:2025-10-30 00:00:08.252214 +0000 +0000
    Updated:2025-10-30 00:00:37.409075 +0000 +0000
}
  

Clojure

Not yet available. Please contact us if you need this SDK.
  

Curl

{
    "cursor": "",
    "requests": [
        {
            "id": "4875989783937024",
            "subscriptionId": "4871746087813120",
            "installmentId": "6381497086902272",
            "invoiceId": "5192316503457792",
            "displayDescription": "",
            "attemptType": "default",
            "due": "2025-08-16T23:59:59+00:00",
            "status": "failed",
            "externalId": "c0a7f183f32e42b9a4cfc5ee997a3455",
            "tags": [],
            "created": "2025-08-14T18:23:40.089592+00:00",
            "updated": "2025-08-17T00:00:07.816140+00:00"
        }
    ]
}
  

Get an Invoice Pull Request

Get a single Invoice Pull Request by its id.

Parameters

id REQUIRED

String used to get the specific invoice pull request by its ID.

ENDPOINT
GET /v2/invoice-pull-request/:id
REQUEST

Python

import starkbank

requests = starkbank.invoicepullrequest.get("4875989783937024")

for request in requests:
    print(request)
  

Javascript

const starkbank = require('starkbank');

(async() => {
    let requests = await starkbank.invoicePullRequest.get("4875989783937024");

    for await (let request of requests){
        console.log(request);
    }
})();
  

PHP

$request = StarkBankInvoicePullRequest::get("6604482620162048");

print_r($request);
  

Java

import com.starkbank.*;

InvoicePullRequest request = InvoicePullRequest.get("5044069638078464");

System.out.println(request);
  

Ruby

Not yet available. Please contact us if you need this SDK.
  

Elixir

Not yet available. Please contact us if you need this SDK.
  

C#

using System;

InvoicePullRequest request = InvoicePullRequest.Get("4875989783937024");

Console.WriteLine(request);
  

Go

package main

import (
    "fmt"
    "github.com/starkbank/sdk-go/starkbank/invoicepullrequest"
)

func main() {

    request, err := invoicepullrequest.Get("6307501536444416", nil)
    if err.Errors != nil {
        for _, e := range err.Errors {
            t.Errorf("code: %s, message: %s", e.Code, e.Message)
        }
    }
    fmt.Printf("%+v
", request)
}
  

Clojure

Not yet available. Please contact us if you need this SDK.
  

Curl

curl --location --request GET '{{baseUrl}}/v2/invoice-pull-request/4875989783937024' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}'
  
RESPONSE

Python

InvoicePullRequest(
        attempt_type=default,
        created=2025-08-14 18:23:40.089592,
        display_description=,
        due=2025-08-16 23:59:59,
        external_id=c0a7f183f32e42b9a4cfc5ee997a3455,
        id=4875989783937024,
        installment_id=6381497086902272,
        invoice_id=5192316503457792,
        status=failed,
        subscription_id=4871746087813120,
        tags=[],
        updated=2025-08-17 00:00:07.816140
)
  

Javascript

InvoicePullRequest {
  id: '4875989783937024',
  subscriptionId: '4871746087813120',
  invoiceId: '5192316503457792',
  due: '2025-08-16T23:59:59+00:00',
  attemptType: 'default',
  tags: [],
  externalId: 'c0a7f183f32e42b9a4cfc5ee997a3455',
  displayDescription: '',
  status: 'failed',
  installmentId: '6381497086902272',
  created: '2025-08-14T18:23:40.089592+00:00',
  updated: '2025-08-17T00:00:07.816140+00:00'
}
  

PHP

StarkBankInvoicePullRequest Object
(
    [id] => 6604482620162048
    [subscriptionId] => 4776669403414528
    [invoiceId] => 6649956664344576
    [due] => DateTime Object
        (
            [date] => 2025-09-14 03:00:00.000000
            [timezone_type] => 1
            [timezone] => +00:00
        )

    [attemptType] => default
    [tags] => Array
        (
        )

    [externalId] => 33ae4ce29d4c461db23dfad8e7aebd7a
    [displayDescription] => 
    [status] => created
    [bacenId] => 
    [installmentId] => 5187902950604800
    [created] => DateTime Object
        (
            [date] => 2025-09-10 18:10:55.772558
            [timezone_type] => 1
            [timezone] => +00:00
        )

    [updated] => DateTime Object
        (
            [date] => 2025-09-10 18:30:03.457811
            [timezone_type] => 1
            [timezone] => +00:00
        )

)
  

Java

InvoicePullRequest({
  "subscriptionId": "6673482343514112",
  "invoiceId": "6028180624244736",
  "due": "2025-09-30T03:00:00+00:00",
  "attemptType": "default",
  "tags": [],
  "externalId": "b333bae493584983b50d4a80d8ca63af",
  "displayDescription": "",
  "status": "scheduled",
  "installmentId": "4639632834691072",
  "created": "2025-09-25T19:48:53.288222+00:00",
  "updated": "2025-09-25T19:49:03.030985+00:00",
  "id": "5044069638078464"
})
  

Ruby

Not yet available. Please contact us if you need this SDK.
  

Elixir

Not yet available. Please contact us if you need this SDK.
  

C#

InvoicePullRequest(
  SubscriptionID: 4871746087813120,
  InvoiceID: 5192316503457792,
  Due: 8/16/2025 8:59:59PM,
  AttemptType: default,
  Tags: {  },
  ExternalID: c0a7f183f32e42b9a4cfc5ee997a3455,
  DisplayDescription: ,
  Status: failed,
  InstallmentID: 6381497086902272,
  Created: 8/14/2025 3:23:40PM,
  Updated: 8/16/2025 9:00:07PM,
  ID: 4875989783937024
)
  

Go

{
    Id:6307501536444416
    SubscriptionId:5661633187676160
    InvoiceId:5995635400507392
    Due:2025-10-30 03:00:00 +0000 +0000
    AttemptType:retry
    Tags:[]
    ExternalId:my_external_id
    DisplayDescription:Your description
    Status:scheduled
    InstallmentId:4586921330212864
    Created:2025-10-30 00:00:08.252214 +0000 +0000
    Updated:2025-10-30 00:00:37.409075 +0000 +0000
}
  

Clojure

Not yet available. Please contact us if you need this SDK.
  

Curl

{
    "request": {
        "id": "4875989783937024",
        "subscriptionId": "4871746087813120",
        "installmentId": "6381497086902272",
        "invoiceId": "5192316503457792",
        "displayDescription": "",
        "attemptType": "default",
        "due": "2025-08-16T23:59:59+00:00",
        "status": "failed",
        "externalId": "c0a7f183f32e42b9a4cfc5ee997a3455",
        "tags": [],
        "created": "2025-08-14T18:23:40.089592+00:00",
        "updated": "2025-08-17T00:00:07.816140+00:00"
    }
}
  

Cancel an Invoice Pull Request

Cancel a single Invoice Pull Request.

Parameters

id REQUIRED

Id of the invoice pull request entity.

ENDPOINT
DELETE /v2/invoice-pull-request/:id
REQUEST

Python

import starkbank

request = starkbank.invoicepullrequest.cancel("6281065945628672")

print(request)
  

Javascript

const starkbank = require('starkbank');

(async() => {
    let request = await starkbank.invoicePullRequest.cancel("4873691062075392");

    console.log(request);
})();
  

PHP

$request = StarkBankInvoicePullRequest::cancel("6604482620162048");

print_r($request);
  

Java

import com.starkbank.*;

InvoicePullRequest request = InvoicePullRequest.cancel("5044069638078464");

System.out.println(request);
  

Ruby

Not yet available. Please contact us if you need this SDK.
  

Elixir

Not yet available. Please contact us if you need this SDK.
  

C#

using System;

InvoicePullRequest request = InvoicePullRequest.Cancel("5436641015496704");

Console.WriteLine(request);
  

Go

package main

import (
    "fmt"
    "github.com/starkbank/sdk-go/starkbank/invoicepullrequest"
)

func main() {

    request, err := invoicepullrequest.Cancel("6307501536444416", nil)
    if err.Errors != nil {
        for _, e := range err.Errors {
            t.Errorf("code: %s, message: %s", e.Code, e.Message)
        }
    }
    fmt.Printf("%+v
", request)
}
  

Clojure

Not yet available. Please contact us if you need this SDK.
  

Curl

curl --location --request DELETE '{{baseUrl}}/v2/invoice-pull-request/5999590968918016' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}' 
--header 'Content-Type: application/json'
  
RESPONSE

Python

InvoicePullRequest(
        attempt_type=default,
        created=2025-09-07 03:00:15.420295,
        display_description=Iron Bank S.A.,
        due=2025-09-09 03:00:00,
        external_id=35ce0f6775fc42f8942b6142aa9fd9b6,
        id=6281065945628672,
        installment_id=6401171258343424,
        invoice_id=4616495631958016,
        status=scheduled,
        subscription_id=5692449980678144,
        tags=[],
        updated=2025-09-07 03:00:57.777005
)
  

Javascript

InvoicePullRequest {
  id: '4873691062075392',
  subscriptionId: '4880338438324224',
  invoiceId: '5742395538800640',
  due: '2025-09-09T03:00:00+00:00',
  attemptType: 'default',
  tags: [],
  externalId: 'c538aee2ee034d6583f17e0372f4bc1a',
  displayDescription: 'Iron Bank S.A.',
  status: 'scheduled',
  installmentId: '6535889886904320',
  created: '2025-09-07T03:00:15.422343+00:00',
  updated: '2025-09-07T03:00:56.517168+00:00'
}
  

PHP

StarkBankInvoicePullRequest Object
(
    [id] => 6604482620162048
    [subscriptionId] => 4776669403414528
    [invoiceId] => 6649956664344576
    [due] => DateTime Object
        (
            [date] => 2025-09-14 03:00:00.000000
            [timezone_type] => 1
            [timezone] => +00:00
        )

    [attemptType] => default
    [tags] => Array
        (
        )

    [externalId] => 33ae4ce29d4c461db23dfad8e7aebd7a
    [displayDescription] => 
    [status] => created
    [bacenId] => 
    [installmentId] => 5187902950604800
    [created] => DateTime Object
        (
            [date] => 2025-09-10 18:10:55.772558
            [timezone_type] => 1
            [timezone] => +00:00
        )

    [updated] => DateTime Object
        (
            [date] => 2025-09-10 18:30:03.457811
            [timezone_type] => 1
            [timezone] => +00:00
        )

)
  

Java

InvoicePullRequest({
  "subscriptionId": "6673482343514112",
  "invoiceId": "6028180624244736",
  "due": "2025-09-30T03:00:00+00:00",
  "attemptType": "default",
  "tags": [],
  "externalId": "b333bae493584983b50d4a80d8ca63af",
  "displayDescription": "",
  "status": "scheduled",
  "installmentId": "4639632834691072",
  "created": "2025-09-25T19:48:53.288222+00:00",
  "updated": "2025-09-25T19:49:03.030985+00:00",
  "id": "5044069638078464"
})
  

Ruby

Not yet available. Please contact us if you need this SDK.
  

Elixir

Not yet available. Please contact us if you need this SDK.
  

C#

InvoicePullRequest(
  SubscriptionID: 4798170211024896,
  InvoiceID: 6305345492221952,
  Due: 9/9/2025 12:00:00AM,
  AttemptType: default,
  Tags: {  },
  ExternalID: 8be26ecd3ed94720bdf0a953dedfe31f,
  DisplayDescription: Iron Bank S.A.,
  Status: scheduled,
  InstallmentID: 6628395563614208,
  Created: 9/7/2025 12:00:15AM,
  Updated: 9/7/2025 12:00:58AM,
  ID: 5436641015496704
)
  

Go

{
    Id:6307501536444416
    SubscriptionId:5661633187676160
    InvoiceId:5995635400507392
    Due:2025-10-30 03:00:00 +0000 +0000
    AttemptType:retry
    Tags:[]
    ExternalId:my_external_id
    DisplayDescription:Your description
    Status:scheduled
    InstallmentId:4586921330212864
    Created:2025-10-30 00:00:08.252214 +0000 +0000
    Updated:2025-10-30 00:00:37.409075 +0000 +0000
}
  

Clojure

Not yet available. Please contact us if you need this SDK.
  

Curl

{
    "message": "Request cancellation successfully requested",
    "request": {
        "id": "5999590968918016",
        "subscriptionId": "4631044443602944",
        "installmentId": "6624169517121536",
        "invoiceId": "5179445585379328",
        "displayDescription": "Iron Bank S.A.",
        "attemptType": "default",
        "due": "2025-09-09T03:00:00+00:00",
        "status": "scheduled",
        "externalId": "a2103d1ca3d5454d926d745fac97e2d2",
        "tags": [],
        "created": "2025-09-07T03:00:15.424620+00:00",
        "updated": "2025-09-07T03:00:57.682596+00:00"
    }
}
  

List Invoice Pull Request Logs

Get a paged list of invoice pull request logs. A log tracks a change in the entity according to its life cycle.

Parameters

after OPTIONAL

Filter entities created after this date.

before OPTIONAL

Filter entities created before this date.

cursor OPTIONAL

String used to get the next batch of results. Our SDKs handle this for you.

fields OPTIONAL

List of strings to filter response JSON keys. Not available in the SDKs.

limit OPTIONAL

Number of results per cursor. Max = 100.

requestIds OPTIONAL

List of strings to get specific entities by ids.

types OPTIONAL

Filter payment requests by the specified types. Example: confirmed

ENDPOINT
GET /v2/invoice-pull-request/log
REQUEST

Python

import starkbank

logs = starkbank.invoicepullrequest.log.get(
    after="2025-08-01",
    before="2025-08-30"
)

for log in logs:
    print(log)
  

Javascript

const starkbank = require('starkbank');

(async() => {
    let logs = await starkbank.invoicePullRequest.Log.query({
        after: '2025-08-01',
        before: '2025-08-30',
    });

    for await (let log of logs){
        console.log(log);
    }
})();
  

PHP

$logs = StarkBankInvoicePullRequestLog::query([
    "after" => "2025-09-01",
    "before" => "2025-09-30"
]);

foreach($logs as $log){
    print_r($log);
}
  

Java

import com.starkbank.*;
import com.starkbank.utils.Generator;
import java.util.HashMap;

HashMap params = new HashMap<>();
params.put("after", "2025-09-01");
params.put("before", "2025-09-30");
Generator logs = InvoicePullRequest.Log.query(params);

for (InvoicePullRequest.Log log : logs) {
    System.out.println(log);
}
  

Ruby

Not yet available. Please contact us if you need this SDK.
  

Elixir

Not yet available. Please contact us if you need this SDK.
  

C#

using System;

IEnumerable<StarkBank.InvoicePullRequest.Log> logs = StarkBank.InvoicePullRequest.Log.Query(
    after: new DateTime(2025, 8, 1),
    before: new DateTime(2025, 8, 30)
);

foreach(StarkBank.InvoicePullRequest.Log log in logs) {
    Console.WriteLine(log);
}
  

Go

package main

import (
    "fmt"
    "github.com/starkbank/sdk-go/starkbank/invoicepullrequest/log"
)

func main() {

    var params = map[string]interface{}{}
    params["limit"] = 1

    logs, errorChannel := log.Query(params, nil)
    loop:
    for {
        select {
        case err := <-errorChannel:
            if err.Errors != nil {
                for _, e := range err.Errors {
                    t.Errorf("code: %s, message: %s", e.Code, e.Message)
                }
            }
        case log, ok := <-logs:
            if !ok {
                break loop
            }
            fmt.Printf("%+v
", log)
        }
    }
}
  

Clojure

Not yet available. Please contact us if you need this SDK.
  

Curl

curl --location --request GET '{{baseUrl}}/v2/invoice-pull-request/log' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}'
  
RESPONSE

Python

Log(
        created=2025-08-17 00:00:05.640702,
        errors=[],
        id=5439643239579648,
        request=InvoicePullRequest(
                attempt_type=default,
                created=2025-08-14 18:23:40.089592,
                display_description=,
                due=2025-08-16 23:59:59,
                external_id=c0a7f183f32e42b9a4cfc5ee997a3455,
                id=4875989783937024,
                installment_id=6381497086902272,
                invoice_id=5192316503457792,
                status=failed,
                subscription_id=4871746087813120,
                tags=[],
                updated=2025-08-17 00:00:07.852905
        ),
        type=failed
)
  

Javascript

Log {
  id: '5439643239579648',
  created: '2025-08-17T00:00:05.640702+00:00',
  type: 'failed',
  errors: [],
  request: {
    id: '4875989783937024',
    subscriptionId: '4871746087813120',
    installmentId: '6381497086902272',
    invoiceId: '5192316503457792',
    displayDescription: '',
    attemptType: 'default',
    due: '2025-08-16T23:59:59+00:00',
    status: 'failed',
    externalId: 'c0a7f183f32e42b9a4cfc5ee997a3455',
    tags: [],
    created: '2025-08-14T18:23:40.089592+00:00',
    updated: '2025-08-17T00:00:07.852905+00:00'
  },
  reason: 'notSettled',
  description: 'Invoice Pull Request failed'
}
  

PHP

StarkBankInvoicePullRequestLog Object
(
    [id] => 6372279684431872
    [created] => DateTime Object
        (
            [date] => 2025-09-22 03:00:06.656950
            [timezone_type] => 1
            [timezone] => +00:00
        )

    [type] => created
    [errors] => Array
        (
        )

    [request] => StarkBankInvoicePullRequest Object
        (
            [id] => 6577259548770304
            [subscriptionId] => 5481192820310016
            [invoiceId] => 5005568641073152
            [due] => DateTime Object
                (
                    [date] => 2025-09-24 03:00:00.000000
                    [timezone_type] => 1
                    [timezone] => +00:00
                )

            [attemptType] => default
            [tags] => Array
                (
                )

            [externalId] => b350602cbd8f4209aca39c5865469da3
            [displayDescription] => Iron Bank S.A.
            [status] => created
            [bacenId] => 
            [installmentId] => 5482728472444928
            [created] => DateTime Object
                (
                    [date] => 2025-09-22 03:00:06.633742
                    [timezone_type] => 1
                    [timezone] => +00:00
                )

            [updated] => DateTime Object
                (
                    [date] => 2025-09-22 03:02:19.413781
                    [timezone_type] => 1
                    [timezone] => +00:00
                )

        )

    [reason] => 
    [description] => Invoice Pull Request was created and is being sent to the sender bank
)
  

Java

Log({
  "created": "2025-09-25T19:49:01.549245+00:00",
  "type": "scheduled",
  "errors": [],
  "request": {
    "subscriptionId": "6673482343514112",
    "invoiceId": "6028180624244736",
    "due": "2025-09-30T03:00:00+00:00",
    "attemptType": "default",
    "tags": [],
    "externalId": "b333bae493584983b50d4a80d8ca63af",
    "displayDescription": "",
    "status": "scheduled",
    "installmentId": "4639632834691072",
    "created": "2025-09-25T19:48:53.288222+00:00",
    "updated": "2025-09-25T19:49:03.070982+00:00",
    "id": "5044069638078464"
  },
  "id": "5840915683868672"
})
  

Ruby

Not yet available. Please contact us if you need this SDK.
  

Elixir

Not yet available. Please contact us if you need this SDK.
  

C#

Log(
  Created: 8/16/2025 9:00:05PM,
  Type: failed,
  Errors: {  },
  InvoicePullRequest: InvoicePullRequest(
    SubscriptionID: 4871746087813120,
    InvoiceID: 5192316503457792,
    Due: 8/16/2025 8:59:59PM,
    AttemptType: default,
    Tags: {  },
    ExternalID: c0a7f183f32e42b9a4cfc5ee997a3455,
    DisplayDescription: ,
    Status: failed,
    InstallmentID: 6381497086902272,
    Created: 8/14/2025 3:23:40PM,
    Updated: 8/16/2025 9:00:07PM,
    ID: 4875989783937024
  ),
  ID: 5439643239579648
)
  

Go

{
    Id:5027702591455232
    Request:
    {
        Id:6307501536444416
        SubscriptionId:5661633187676160
        InvoiceId:5995635400507392
        Due:2025-10-30 03:00:00 +0000 +0000
        AttemptType:retry
        Tags:[]
        ExternalId:my_external_id
        DisplayDescription:Your description
        Status:scheduled
        InstallmentId:4586921330212864
        Created:2025-10-30 00:00:08.252214 +0000 +0000
        Updated:2025-10-30 00:00:37.432444 +0000 +0000
    }
    Errors:[]
    Type:scheduled
    Created:2025-10-30 00:00:32.92257 +0000 +0000
}
  

Clojure

Not yet available. Please contact us if you need this SDK.
  

Curl

{
    "cursor": "",
    "logs": [
        {
            "id": "5439643239579648",
            "type": "failed",
            "request": {
                "id": "4875989783937024",
                "subscriptionId": "4871746087813120",
                "installmentId": "6381497086902272",
                "invoiceId": "5192316503457792",
                "displayDescription": "",
                "attemptType": "default",
                "due": "2025-08-16T23:59:59+00:00",
                "status": "failed",
                "externalId": "c0a7f183f32e42b9a4cfc5ee997a3455",
                "tags": [],
                "created": "2025-08-14T18:23:40.089592+00:00",
                "updated": "2025-08-17T00:00:07.852905+00:00"
            },
            "errors": [],
            "created": "2025-08-17T00:00:05.640702+00:00",
            "reason": "notSettled",
            "description": "Invoice Pull Request failed"
        }
    ]
}
  

Get an Invoice Pull Request Log

Get a single invoice pull request log by its id.

Parameters

id REQUIRED

String used to get the specific invoice pull request log by its ID.

ENDPOINT
GET /v2/invoice-pull-request/log/:id
REQUEST

Python

import starkbank

logs = starkbank.invoicepullrequest.log.get("5439643239579648")

for log in logs:
    print(log)
  

Javascript

const starkbank = require('starkbank');

(async() => {
    let logs = await starkbank.invoicePullRequest.Log.get("5439643239579648");

    for await (let log of logs){
        console.log(log);
    }
})();
  

PHP

$log = StarkBankInvoicePullRequestLog::get("6372279684431872");

print_r($log);
  

Java

import com.starkbank.*;

InvoicePullRequest.Log log = InvoicePullRequest.Log.get("5840915683868672");

System.out.println(log);
  

Ruby

Not yet available. Please contact us if you need this SDK.
  

Elixir

Not yet available. Please contact us if you need this SDK.
  

C#

using System;

InvoicePullRequest.Log log = InvoicePullRequest.Log.Get("5439643239579648");

Console.WriteLine(log);
  

Go

package main

import (
    "fmt"
    "github.com/starkbank/sdk-go/starkbank/invoicepullrequest/log"
)

func main() {

	  log, err := log.Get("5027702591455232", nil)
    if err.Errors != nil {
        for _, e := range err.Errors {
            t.Errorf("code: %s, message: %s", e.Code, e.Message)
        }
    }
    fmt.Printf("%+v
", log)
}
  

Clojure

Not yet available. Please contact us if you need this SDK.
  

Curl

curl --location --request GET '{{baseUrl}}/v2/invoice-pull-request/log/5439643239579648' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}'
  
RESPONSE

Python

Log(
        created=2025-08-17 00:00:05.640702,
        errors=[],
        id=5439643239579648,
        request=InvoicePullRequest(
                attempt_type=default,
                created=2025-08-14 18:23:40.089592,
                display_description=,
                due=2025-08-16 23:59:59,
                external_id=c0a7f183f32e42b9a4cfc5ee997a3455,
                id=4875989783937024,
                installment_id=6381497086902272,
                invoice_id=5192316503457792,
                status=failed,
                subscription_id=4871746087813120,
                tags=[],
                updated=2025-08-17 00:00:07.852905
        ),
        type=failed
)
  

Javascript

Log {
  id: '5439643239579648',
  created: '2025-08-17T00:00:05.640702+00:00',
  type: 'failed',
  errors: [],
  request: {
    id: '4875989783937024',
    subscriptionId: '4871746087813120',
    installmentId: '6381497086902272',
    invoiceId: '5192316503457792',
    displayDescription: '',
    attemptType: 'default',
    due: '2025-08-16T23:59:59+00:00',
    status: 'failed',
    externalId: 'c0a7f183f32e42b9a4cfc5ee997a3455',
    tags: [],
    created: '2025-08-14T18:23:40.089592+00:00',
    updated: '2025-08-17T00:00:07.852905+00:00'
  },
  reason: 'notSettled',
  description: 'Invoice Pull Request failed'
}
  

PHP

StarkBankInvoicePullRequestLog Object
(
    [id] => 6372279684431872
    [created] => DateTime Object
        (
            [date] => 2025-09-22 03:00:06.656950
            [timezone_type] => 1
            [timezone] => +00:00
        )

    [type] => created
    [errors] => Array
        (
        )

    [request] => StarkBankInvoicePullRequest Object
        (
            [id] => 6577259548770304
            [subscriptionId] => 5481192820310016
            [invoiceId] => 5005568641073152
            [due] => DateTime Object
                (
                    [date] => 2025-09-24 03:00:00.000000
                    [timezone_type] => 1
                    [timezone] => +00:00
                )

            [attemptType] => default
            [tags] => Array
                (
                )

            [externalId] => b350602cbd8f4209aca39c5865469da3
            [displayDescription] => Iron Bank S.A.
            [status] => created
            [bacenId] => 
            [installmentId] => 5482728472444928
            [created] => DateTime Object
                (
                    [date] => 2025-09-22 03:00:06.633742
                    [timezone_type] => 1
                    [timezone] => +00:00
                )

            [updated] => DateTime Object
                (
                    [date] => 2025-09-22 03:02:19.413781
                    [timezone_type] => 1
                    [timezone] => +00:00
                )

        )

    [reason] => 
    [description] => Invoice Pull Request was created and is being sent to the sender bank
)
  

Java

Log({
  "created": "2025-09-25T19:49:01.549245+00:00",
  "type": "scheduled",
  "errors": [],
  "request": {
    "subscriptionId": "6673482343514112",
    "invoiceId": "6028180624244736",
    "due": "2025-09-30T03:00:00+00:00",
    "attemptType": "default",
    "tags": [],
    "externalId": "b333bae493584983b50d4a80d8ca63af",
    "displayDescription": "",
    "status": "scheduled",
    "installmentId": "4639632834691072",
    "created": "2025-09-25T19:48:53.288222+00:00",
    "updated": "2025-09-25T19:49:03.070982+00:00",
    "id": "5044069638078464"
  },
  "id": "5840915683868672"
})
  

Ruby

Not yet available. Please contact us if you need this SDK.
  

Elixir

Not yet available. Please contact us if you need this SDK.
  

C#

Log(
  Created: 8/16/2025 9:00:05PM,
  Type: failed,
  Errors: {  },
  InvoicePullRequest: InvoicePullRequest(
    SubscriptionID: 4871746087813120,
    InvoiceID: 5192316503457792,
    Due: 8/16/2025 8:59:59PM,
    AttemptType: default,
    Tags: {  },
    ExternalID: c0a7f183f32e42b9a4cfc5ee997a3455,
    DisplayDescription: ,
    Status: failed,
    InstallmentID: 6381497086902272,
    Created: 8/14/2025 3:23:40PM,
    Updated: 8/16/2025 9:00:07PM,
    ID: 4875989783937024
  ),
  ID: 5439643239579648
)
  

Go

{
    Id:5027702591455232
    Request:
    {
        Id:6307501536444416
        SubscriptionId:5661633187676160
        InvoiceId:5995635400507392
        Due:2025-10-30 03:00:00 +0000 +0000
        AttemptType:retry
        Tags:[]
        ExternalId:my_external_id
        DisplayDescription:Your description
        Status:scheduled
        InstallmentId:4586921330212864
        Created:2025-10-30 00:00:08.252214 +0000 +0000
        Updated:2025-10-30 00:00:37.432444 +0000 +0000
    }
    Errors:[]
    Type:scheduled
    Created:2025-10-30 00:00:32.92257 +0000 +0000
}
  

Clojure

Not yet available. Please contact us if you need this SDK.
  

Curl

{
    "log": {
        "id": "5439643239579648",
        "type": "failed",
        "request": {
            "id": "4875989783937024",
            "subscriptionId": "4871746087813120",
            "installmentId": "6381497086902272",
            "invoiceId": "5192316503457792",
            "displayDescription": "",
            "attemptType": "default",
            "due": "2025-08-16T23:59:59+00:00",
            "status": "failed",
            "externalId": "c0a7f183f32e42b9a4cfc5ee997a3455",
            "tags": [],
            "created": "2025-08-14T18:23:40.089592+00:00",
            "updated": "2025-08-17T00:00:07.852905+00:00"
        },
        "errors": [],
        "created": "2025-08-17T00:00:05.640702+00:00",
        "reason": "notSettled",
        "description": "Invoice Pull Request failed"
    }
}
  

Merchant Session

The Merchant Session resource can be created by a merchant and used by the card holder in order to collect their card data without having to handle it on the merchant's side.

The card data can be sent directly from a browser or app to Stark Bank's API using the Merchant Session Purchase route.

The Merchant Session object

Attributes

id STRING

Unique id for the merchant session.

allowedFundingTypes LIST OF STRINGS

Funding types allowed for the purchase. Options: "credit", "debit".

allowedInstallments LIST OF OBJECTS

Installment configurations allowed for the purchase.

allowedIps LIST OF STRINGS

IP addresses allowed to create a purchase.

challengeMode STRING

Holder verification mode. Options: "enabled", "disabled".

created STRING

Creation datetime. Example: "2020-04-23T23:00:00.000000+00:00".

expiration INTEGER

Time in seconds until the session expires.

status STRING

Current session status. Options: "active", "expired", "success".

tags LIST OF STRINGS

Tags associated with the session.

updated STRING

Last update datetime. Example: "2020-04-23T23:00:00.000000+00:00".

uuid STRING

Unique UUID for the session.

Create Merchant Sessions

This route allows the merchant to create a session that can be used by the card holder's application to create a new purchase.

The UUID parameter returned by the session should be used to create a Merchant Session Purchase.

Parameters

allowedFundingTypes REQUIRED

The types of funding that are allowed to be used for the purchase. Options are "credit" and "debit".

allowedInstallments REQUIRED

The amount and number of installments allowed for the purchase. A non-negative integer that represents the amount in cents to be received and the number of installments. E.g: 100 (R$1.00).

expiration REQUIRED

Time in seconds counted from the creation datetime until the session expires. After expiration, a purchase cannot be created using the session anymore. E.g.: 3600 (1 hour).

allowedIps OPTIONAL

The IP addresses that are allowed to create a purchase using the session.

challengeMode OPTIONAL

Defines whether or not a holder verification (3DS) will be used when authorizing the purchase. 3DS is a protocol designed to enhance security for e-commerce purchases. When enabled, the issuer provides a link for the card holder to complete a verification challenge. Options are "enabled" and "disabled". Default: "enabled"

tags OPTIONAL

Array of strings to tag the entity for future queries. All tags will be converted to lowercase.

ENDPOINT
POST /v2/merchant-session
REQUEST

Python

import starkbank
from starkbank.merchantsession import AllowedInstallment

allowed_installments = [
    AllowedInstallment(total_amount=5000, count=1),
    AllowedInstallment(total_amount=5500, count=2)
]

merchant_session = starkbank.MerchantSession(
    allowed_funding_types=["debit", "credit"],
    allowed_installments=allowed_installments,
    expiration=3600,
    challenge_mode="disabled",
    tags=["session_123"]
)

print(starkbank.merchantsession.create(merchant_session))
      

Javascript

const starkbank = require('starkbank');

(async() => {
    let merchantSession = await starkbank.merchantSession.create(
        {
            allowedFundingTypes: [
                'debit',
                'credit'
            ],
            allowedInstallments: [
                {
                    totalAmount: 5000,
                    count: 1
                },
                {
                    totalAmount: 5500,
                    count: 2
                }
            ],
            expiration: 3600,
            challengeMode: 'disabled',
            tags: ['session_123']
        }
    );

    console.log(merchantSession)
})();
    

PHP

use StarkBank\MerchantSession;

$allowedInstallments = [
    new MerchantSession\AllowedInstallment(['totalAmount' => 5000, 'count' => 1]),
    new MerchantSession\AllowedInstallment(['totalAmount' => 5500, 'count' => 2])
];

$merchantsession = MerchantSession::create(
    new MerchantSession([
        'allowedFundingTypes' => ["debit", "credit"],
        'allowedInstallments' => $allowedInstallments,
        'expiration' => 3600,
        'challengeMode' => "disabled",
        'tags' => ["session_123"]
    ]);
);

print_r($merchantsession);
    

Java

import com.starkbank.*;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;


Map<String, Object> data = new HashMap<>();
List<String> allowedFundingTypes = new ArrayList<>();
allowedFundingTypes.add("debit");
allowedFundingTypes.add("credit");
data.put("allowedFundingTypes", allowedFundingTypes);

List<MerchantSession.AllowedInstallment> allowedInstallments = new ArrayList<>();

MerchantSession.AllowedInstallment allowedInstallment1 = new MerchantSession.AllowedInstallment(5000L, 1);
MerchantSession.AllowedInstallment allowedInstallment2 = new MerchantSession.AllowedInstallment(5500L, 2);

allowedInstallments.add(allowedInstallment1);
allowedInstallments.add(allowedInstallment2);

data.put("allowedInstallments", allowedInstallments);
data.put("expiration", 3600);
data.put("challengeMode", "enabled");

data.put("tags", new String[]{"session_123"});

MerchantSession merchantSession = MerchantSession.create(new MerchantSession(data));

System.out.println(merchantSession);
          

Ruby

require 'starkbank'

allowed_installments = [
    StarkBank::AllowedInstallment.new(total_amount: 5000, count: 1),
    StarkBank::AllowedInstallment.new(total_amount: 5500, count: 2)
]

response = StarkBank::MerchantSession.create(
    StarkBank::MerchantSession.new(
        allowed_funding_types: ["debit", "credit"],
        allowed_installments: allowed_installments,
        expiration: 3600,
        challenge_mode: "disabled",
        tags: ["session_123"]
    )
)

puts response
      

Elixir


sessions = StarkBank.MerchantSession.create!([
    %StarkBank.MerchantSession{
        allowed_funding_types: ["debit", "credit"],
        allowed_installments: [
            %{
                total_amount: 5000,
                count: 1
            },
            %{
                total_amount: 5500,
                count: 2
            }
        ],
        expiration: 3600,
        challenge_mode: "disabled",
        tags: ["session_123"]
    }
])
          

C#

using StarkBank;
using StarkBank.MerchantSession;
using System;
using System.Collections.Generic;

List<AllowedInstallment> allowedInstallments = new List<AllowedInstallment>
{
    new AllowedInstallment(totalAmount: 5000, count: 1),
    new AllowedInstallment(totalAmount: 5500, count: 2)
};

MerchantSession merchantSession = new MerchantSession(
    allowedFundingTypes: new List<string> { "debit", "credit" },
    allowedInstallments: allowedInstallments,
    expiration: 3600,
    challengeMode: "disabled",
    tags: new List<string> { "session_123" }
);

MerchantSession response = MerchantSession.Create(merchantSession);

Console.WriteLine(response);
          

Go

package main

import (
    "fmt"
    "github.com/starkbank/sdk-go/starkbank"
    MerchantSession "github.com/starkbank/sdk-go/starkbank/merchantsession"
    AllowedInstallment "github.com/starkbank/sdk-go/starkbank/merchantsession/allowedinstallment"
)

func main() {
    merchantSession := MerchantSession.MerchantSession{
        AllowedFundingTypes: []string{"credit"},
        AllowedInstallments: []AllowedInstallment.AllowedInstallment{
            {Count: 1, TotalAmount: 5000},
            {Count: 2, TotalAmount: 5500},
        },
        Expiration:   		 3600,
        ChallengeMode: 		 "disabled",
        Tags:          		 []string{"session_123"},
    }

    createdSession, err := MerchantSession.Create(merchantSession, nil)

    if err.Errors != nil {
        for _, e := range err.Errors {
            fmt.Printf("code: %s, message: %s", e.Code, e.Message)
        }
    }

    fmt.Println(createdSession)
}
          

Clojure

(defn create-session []
(let [allowed-installments [(allowed-installments/create {:total-amount 5000 :count 1})
                            (allowed-installments/create {:total-amount 5500 :count 2})]
        merchant-session (merchant-session/create {:allowed-funding-types ["debit" "credit"]
                                                    :allowed-installments allowed-installments
                                                    :expiration 3600
                                                    :challenge-mode "disabled"
                                                    :tags ["session_123"]})]
    (println merchant-session)))

          

Curl

curl --location --request POST '{{baseUrl}}/v2/merchant-session' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}' 
--header 'Content-Type: application/json' 
--data-raw '{
    "allowedFundingTypes": [
        "debit",
        "credit"
    ],
    "allowedInstallments": [
        {
            "totalAmount": 5000,
            "count": 1
        },
        {
            "totalAmount": 5500,
            "count": 2
        }
    ],
    "expiration": 3600,
    "challengeMode": "disabled",
    "tags": ["session_123"]
}'
    
RESPONSE

Python

MerchantSession(
    allowed_funding_types=['debit', 'credit'],
    allowed_installments=[
        AllowedInstallment(
            count=1,
            total_amount=5000
        ),
        AllowedInstallment(
            count=2,
            total_amount=5500
        )
    ],
    allowed_ips=[],
    challenge_mode=disabled,
    created=2025-02-20 19:34:45.818681,
    expiration=3600,
    id=4932221869752320,
    status=created,
    tags=['session_123'],
    updated=2025-02-20 19:34:45.827862,
    uuid=cc80706d85c5438b9fbe02085daf5315
)
        

Javascript

MerchantSession {
    allowedFundingTypes: [
        'credit',
        'debit'
    ],
    allowedInstallments: [
        {
            count: 1,
            totalAmount: 5000
        },
        {
            count: 2,
            totalAmount: 5500
        }
    ],
    allowedIps: [],
    challengeMode: 'disabled',
    created: '2024-09-06T20:34:10.594675+00:00',
    expiration: 3600,
    id: '6548734053711872',
    status: 'created',
    tags: ['session_123'],
    updated: '2024-09-06T20:34:10.611544+00:00',
    uuid: 'b559350884674b31926abb5a8f3d5f31'
}
    

PHP

StarkBank\MerchantSession Object
(
    [id] => 5674419263373312
    [allowedFundingTypes] => Array
        (
            [0] => credit
            [1] => debit
        )
    [allowedInstallments] => Array
        (
            [0] => StarkBank\AllowedInstallment Object
                (
                    [count] => 1
                    [totalAmount] => 5000
                )
            [1] => StarkBank\AllowedInstallment Object
                (
                    [count] => 2
                    [totalAmount] => 5500
                )
        )
    [allowedIps] => Array
        (
        )
    [challengeMode] => disabled
    [created] => DateTime Object
        (
            [date] => 2025-01-30 18:37:06.385441
            [timezone_type] => 1
            [timezone] => +00:00
        )
    [expiration] => 3600
    [status] => created
    [tags] => Array
        (
            [0] => session_123
        )
    [updated] => DateTime Object
        (
            [date] => 2025-01-30 18:37:06.415248
            [timezone_type] => 1
            [timezone] => +00:00
        )
    [uuid] => 9ebe95f651054f13a98d977a89b48418
)

        

Java

MerchantSession({
    "id": "5229459015729152",
    "allowedFundingTypes": [
        "credit",
        "debit"
    ],
    "allowedInstallments": [
        {
            "count": 1,
            "totalAmount": 5000
        },
        {
            "count": 2,
            "totalAmount": 5500
        }
    ],
    "allowedIps": [],
    "challengeMode": "disabled",
    "created": "2025-02-10T17:01:27.106142+00:00",
    "expiration": 3600,
    "status": "created",
    "tags": [
        "session_123"
    ],
    "updated": "2025-02-10T17:01:27.135006+00:00",
    "uuid": "63caf64913d14465b1ebe2ec09a8b1cd"
})

Ruby

merchantsession(
    id: 5315436031770624,
    allowed_funding_types: ["debit", "credit"],
    allowed_installments: [
        allowedinstallment(
            count: 1,
            total_amount: 5000
        ),
        allowedinstallment(
            count: 2,
            total_amount: 5200
        )
    ],
    allowed_ips: [],
    challenge_mode: disabled,
    expiration: 3600,
    status: created,
    tags: ["session_123"],
    created: 2025-02-20T21:18:39+00:00,
    updated: 2025-02-20T21:18:39+00:00,
    uuid: 5697ac1bdc944619b365149e317b6dcd
)

Elixir

%StarkBank.MerchantSession{
    id: "5674419263373312",
    allowed_funding_types: ["credit", "debit"],
    allowed_installments: [
        %StarkBank.AllowedInstallment{
            count: 1,
            total_amount: 5000
        },
        %StarkBank.AllowedInstallment{
            count: 2,
            total_amount: 5500
        }
    ],
    allowed_ips: [],
    challenge_mode: "disabled",
    created: ~U[2025-01-30 18:37:06.385441Z],
    expiration: 3600,
    status: "created",
    tags: ["session_123"],
    updated: ~U[2025-01-30 18:37:06.415248Z],
    uuid: "9ebe95f651054f13a98d977a89b48418"
}
        

C#

MerchantSession(
    AllowedFundingTypes: { debit, credit },
    AllowedInstallments: {
        AllowedInstallment(totalAmount: 5000, count: 1),
        AllowedInstallment(totalAmount: 5500, count: 2)
    },
    AllowedIps: {  },
    ChallengeMode: disabled,
    Expiration: 3600,
    Status: created,
    Tags: { session_123 },
    Uuid: b147857fb7e3426dba4ec35382e3efae,
    Created: 2/20/2025 11:22:41 PM,
    Updated: 2/20/2025 11:22:41 PM,
    ID: 4941457391616000
)

Go

{
    Id: 5229459015729152,
    AllowedFundingTypes: ["credit", "debit"],
    AllowedInstallments: [
        {
            Count: 1,
            TotalAmount: 5000
        },
        {
            Count: 2,
            TotalAmount: 5500
    }
    ],
    AllowedIps: [],
    ChallengeMode: "disabled",
    Created: "2025-02-10 17:01:27.106142 +0000 +0000",
    Expiration: 3600,
    Status: "created",
    Tags: ["session_123"],
    Updated: "2025-02-10 17:01:27.135006 +0000 +0000",
    Uuid: "63caf64913d14465b1ebe2ec09a8b1cd"
}
        

Clojure

{:id "5674419263373312",
:allowed-funding-types ["credit" "debit"],
:allowed-installments [{:count 1, :total-amount 5000}
                        {:count 2, :total-amount 5500}],
:allowed-ips [],
:challenge-mode "disabled",
:created "2025-01-30T18:37:06.385441+00:00",
:expiration 3600,
:status "created",
:tags ["session_123"],
:updated "2025-01-30T18:37:06.415248+00:00",
:uuid "9ebe95f651054f13a98d977a89b48418"}

        

Curl

{
    "message": "Merchant Session successfully created",
    "session": {
        "allowedFundingTypes": [
            "credit",
            "debit"
        ],
        "allowedInstallments": [
            {
                "count": 1,
                "totalAmount": 5000
            },
            {
                "count": 2,
                "totalAmount": 5500
            }
        ],
        "allowedIps": [],
        "challengeMode": "disabled",
        "created": "2024-09-06T20:34:10.594675+00:00",
        "expiration": 3600,
        "id": "6548734053711872",
        "status": "created",
        "tags": ["session_123"],
        "updated": "2024-09-06T20:34:10.611544+00:00",
        "uuid": "b559350884674b31926abb5a8f3d5f31"
    }
}
    

Create Merchant Session Purchase

This route can be used to create a Merchant Purchase directly from the payer's client application.

The UUID of a Merchant Session that was previously created by the merchant is necessary to access this route.

Parameters

amount REQUIRED

A non-negative integer that represents the amount in cents to be received. E.g: 100 (R$1.00)

cardExpiration REQUIRED

A string in the format YYYY-MM representing the expiration of the card to be used for the purchase.

cardNumber REQUIRED

A string representing the number of the card to be used for the purchase.

cardSecurityCode REQUIRED

A string representing the security code of the card to be used for the purchase.

fundingType REQUIRED

The type of funding to be used for the purchase. Options are "credit" and "debit".

holderName REQUIRED

The name of the card holder as it appears on the card.

uuid REQUIRED

The UUID of the Merchant Session created by the merchant to process the purchase.

billingCity CONDITIONALLY REQUIRED

The billing city associated with the card used for the purchase. Required if challengeMode is "enabled" and optional otherwise.

billingCountryCode CONDITIONALLY REQUIRED

The billing country code associated with the card used for the purchase. Required if challengeMode is "enabled" and optional otherwise.

billingStateCode CONDITIONALLY REQUIRED

The billing state code associated with the card used for the purchase. Required if challengeMode is "enabled" and optional otherwise.

billingStreetLine1 CONDITIONALLY REQUIRED

The billing street address associated with the card used for the purchase. Required if challengeMode is "enabled" and optional otherwise.

billingStreetLine2 CONDITIONALLY REQUIRED

The billing street address complement associated with the card used for the purchase. Required if challengeMode is "enabled" and optional otherwise.

billingZipCode CONDITIONALLY REQUIRED

The billing zip code associated with the card used for the purchase. Required if challengeMode is "enabled" and optional otherwise.

holderEmail CONDITIONALLY REQUIRED

The email associated with the holder of the card used for the purchase. Required if challengeMode is "enabled" and optional otherwise.

holderPhone CONDITIONALLY REQUIRED

The phone number associated with the holder of the card used for the purchase. Required if challengeMode is "enabled" and optional otherwise.

installmentCount OPTIONAL

A non-negative integer that represents the number of purchase installments. Default: 1

metadata CONDITIONALLY REQUIRED

An object containing additional data related to the purchase. If 3DS is enabled, the following fields related to the payer's device are required: userAgent, timezoneOffset, userIp, language.

ENDPOINT
POST /v2/merchant-session/:uuid/purchase
REQUEST

Python

import starkbank

merchant_purchase = starkbank.merchantsession.purchase(
    uuid= "cc80706d85c5438b9fbe02085daf5315",
    purchase= starkbank.merchantsession.Purchase(
        amount=5500,
        installment_count=2,
        holder_name="Rhaenyra Targaryen",
        holder_email="rhaenyra.targaryen@gmail.com",
        holder_phone="11985923451",
        funding_type="credit",
        billing_country_code="BRA",
        billing_city="Sao Paulo",
        billing_state_code="SP",
        billing_street_line_1="Rua Casterly Rock, 2000",
        billing_street_line_2="1 andar",
        billing_zip_code="01450-000",
        metadata={
            "userAgent": "Mozilla",
            "userIp": "255.255.255.255",
            "language": "pt-BR",
            "timezoneOffset": 3,
            "extraData": "extraData"
        },
        card_expiration="2035-01",
        card_number="5277696455399733",
        card_security_code="123",

    )
)
        

Javascript

const starkbank = require('starkbank');

(async() => {
    let merchantSessionPurchase = await starkbank.merchantSession.purchase(
        '71c57d95f5134740b2194e2172a87e33',
        {
            amount: 5000,
            installmentCount: 1,
            cardExpiration: '2035-01',
            cardNumber: '5277696455399733',
            cardSecurityCode: '123',
            fundingType: 'credit',
            holderName: 'Rhaenyra Targaryen',
            billingCity: 'Sao Paulo',
            billingCountryCode: 'BRA',
            billingStateCode: 'SP',
            billingStreetLine1: 'Rua Casterly Rock, 2000',
            billingStreetLine2: '1 andar',
            billingZipCode: '01450-000',
            holderEmail: 'rhaenyra.targaryen@gmail.com',
            holderPhone: '11985923451',
            metadata: {
                userAgent: 'Mozilla',
                timezoneOffset: 3,
                userIp: '255.255.255.255',
                language: 'pt-BR',
                extraData: 'extraData'
            },
            tags: []
        }
    );
    console.log(merchantSessionPurchase);
})();
    

PHP

$purchase = new MerchantSession\Purchase([
    'amount' => 10000,
    'installmentCount' => 5,
    'holderEmail' => "rhaenyra.targaryen@gmail.com",
    'holderPhone' => "11985923451",
    'holderName' => "Rhaenyra Targaryen",
    'fundingType' => "credit",
    'billingCountryCode' => "BRA",
    'billingCity' => "Sao Paulo",
    'billingState_code' => "SP",
    'billingStreetLine1' => "Rua Casterly Rock, 2000",
    'billingStreetLine2' => "1 andar",
    'billingZipCode' => "01450-000",
    'metadata' => [
        'userAgent' => "Mozilla",
        'userIp' => "255.255.255.255",
        'language' => "pt-BR",
        'timezoneOffset' => 3,
        'extraData' => "extraData"
    ],
    'cardExpiration' => "2035-01",
    'cardNumber' => "5277696455399733",
    'cardSecurityCode' => "123"
]);

$merchantSessionPurchase = MerchantSession::purchase(
    "b6c0ff6039674b28a2cab51a355bd6a0",
    $purchase
);

print_r($merchantSessionPurchase);
        

Java

import com.starkbank.*;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

Map<String, Object> data = new HashMap<>();
data.put("amount", 10000);
data.put("installmentCount", 5);
data.put("holderEmail", "rhaenyra.targaryen@gmail.com");
data.put("holderPhone", "11985923451");
data.put("holderName", "Rhaenyra Targaryen");
data.put("fundingType", "credit");
data.put("billingCountryCode", "BRA");
data.put("billingCity", "Sao Paulo");
data.put("billingStateCode", "SP");
data.put("billingStreetLine1", "Rua Casterly Rock, 2000");
data.put("billingStreetLine2", "1 andar");
data.put("billingZipCode", "01450-000");
data.put("cardExpiration", "2035-01");
data.put("cardNumber", "5277696455399733");
data.put("cardSecurityCode", "123");

Map<String, Object> metadata = new HashMap<>();
metadata.put("userAgent", "Mozilla");
metadata.put("userIp", "255.255.255.255");
metadata.put("language", "pt-BR");
metadata.put("timezoneOffset", 3);
metadata.put("extraData", "extraData");
data.put("metadata", metadata);

MerchantSession.Purchase merchantSessionPurchase = MerchantSession.purchase("b6c0ff6039674b28a2cab51a355bd6a0", new MerchantSession.Purchase(data));

System.out.println(merchantSessionPurchase);
        

Ruby

require 'starkbank'

metadata = {
    userAgent: "Mozilla",
    userIp: "255.255.255.255",
    language: "pt-BR",
    timezoneOffset: 3,
    extraData: "extraData"
}

purchase_data = {
    amount: 5000,
    installment_count: 1,
    holder_email: "rhaenyra.targaryen@gmail.com",
    holder_phone: "11985923451",
    holder_name: "Rhaenyra Targaryen",
    funding_type: "credit",
    billing_country_code: "BRA",
    billing_city: "Sao Paulo",
    billing_state_code: "SP",
    billing_street_line_1: "Rua Casterly Rock, 2000",
    billing_street_line_2: "1 andar",
    billing_zip_code: "01450-000",
    metadata: metadata,
    card_expiration: "2035-01",
    card_number: "5277696455399733",
    card_security_code: "123"
}

response = StarkBank::MerchantSession.purchase(
    uuid: "68b14c3512b947378e033cf474abcf35",
    payload: purchase_data
)

puts response
        

Elixir


purchase = StarkBank.MerchantSession.purchase!([
    uuid: "b6c0ff6039674b28a2cab51a355bd6a0",
    %StarkBank.MerchantSession.Purchase{
        amount: 10000,
        installment_count: 5,
        holder_email: "rhaenyra.targaryen@gmail.com",
        holder_phone: "11985923451",
        holder_name: "Rhaenyra Targaryen",
        funding_type: "credit",
        billing_country_code: "BRA",
        billing_city: "Sao Paulo",
        billing_state_code: "SP",
        billing_street_line_1: "Rua Casterly Rock, 2000",
        billing_street_line_2: "1 andar",
        billing_zip_code: "01450-000",
        metadata: %{
            userAgent: "Mozilla",
            userIp: "255.255.255.255",
            language: "pt-BR",
            timezoneOffset: 3,
            extraData: "extraData"
        },
        card_expiration: "2035-01",
        card_number: "5277696455399733",
        card_security_code: "123"
    }
])
        

C#

using StarkBank;
using StarkBank.MerchantPurchase;
using System;
using System.Collections.Generic;

MerchantSession.Purchase purchaseExample = new MerchantSession.Purchase(
    amount: 5000,
    installmentCount: 1,
    cardExpiration: "2035-01",
    cardNumber: "5102589999999954",
    cardSecurityCode: "123",
    holderName: "Rhaenyra Targaryen",
    holderEmail: "rhaenyra.targaryen@gmail.com",
    holderPhone: "11111111111",
    fundingType: "credit",
    billingCountryCode: "BRA",
    billingCity: "São Paulo",
    billingStateCode: "SP",
    billingStreetLine1: "Rua Casterly Rock, 2000",
    billingStreetLine2: "",
    billingZipCode: "11111-111",
    metadata: new Dictionary<string, object>
    {
        { "userAgent", "Postman" },
        { "userIp", "255.255.255.255" },
        { "language", "pt-BR" },
        { "timezoneOffset", 3 },
        { "extraData", "extraData" }
    }
);

MerchantSession.Purchase purchase = MerchantSession.PostPurchase(id: "cbb0c5a53a31464198a29cd7427fe709", purchaseExample);

Console.WriteLine(purchase);
        

Go

package main

import (
    "fmt"
    "github.com/starkbank/sdk-go/starkbank"
    MerchantSession "github.com/starkbank/sdk-go/starkbank/merchant/session"
    Purchase "github.com/starkbank/sdk-go/starkbank/merchant/session"

)

func main() {
purchase := Purchase.Purchase{
    Amount:            10000,
    InstallmentCount:  5,
    HolderEmail:       "rhaenyra.targaryen@gmail.com",
    holderName:        "Rhaenyra Targaryen",
    HolderPhone:       "11985923451",
    FundingType:       "credit",
    BillingCountryCode: "BRA",
    BillingCity:       "Sao Paulo",
    BillingStateCode:  "SP",
    BillingStreetLine1: "Rua Casterly Rock, 2000",
    BillingStreetLine2: "1 andar",
    BillingZipCode:    "01450-000",
    Metadata: map[string]interface{}{
        "userAgent":      "Mozilla",
        "userIp":         "255.255.255.255",
        "language":       "pt-BR",
        "timezoneOffset": 3,
        "extraData":      "extraData",
    },
    CardExpiration: "2035-01",
    CardNumber: "5277696455399733",
    CardSecurityCode: "123",
}

createdPurchase, err := MerchantSession.PostPurchase("b6c0ff6039674b28a2cab51a355bd6a0", purchase, nil)

if err.Errors != nil {
    for _, e := range err.Errors {
        fmt.Printf("code: %s, message: %s", e.Code, e.Message)
    }
}

fmt.Println(createdPurchase)
}
        

Clojure


(defn create-purchase []
  (let [merchant-purchase (merchant-session/purchase {
    :uuid  "b6c0ff6039674b28a2cab51a355bd6a0"
    (:amount 10000
    :installment_count 5
    :holder_email "rhaenyra.targaryen@gmail.com"
    :holder_phone "11985923451"
    :holder_phone "Rhaenyra Targaryen"
    :funding_type "credit"
    :billing_country_code "BRA"
    :billing_city "Sao Paulo"
    :billing_state_code "SP"
    :billing_street_line1 "Rua Casterly Rock, 2000"
    :billing_street_line2 "1 andar"
    :billing_zip_code "01450-000"
    :metadata metadata
    :card_expiration "2035-01",
    :card_number "5277696455399733",
    :card_security_code "123")})]
    (println merchant-purchase)))

(create-purchase)
        

Curl

curl --location --request POST '{{baseUrl}}/v2/merchant-session/b6c0ff6039674b28a2cab51a355bd6a0/purchase' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}' 
--header 'Content-Type: application/json' 
--data-raw '
{
    "amount": 10000,
    "installmentCount": 5,
    "cardExpiration": "2035-01",
    "cardNumber": "5277696455399733",
    "cardSecurityCode": "123",
    "holderName": "Rhaenyra Targaryen",
    "holderEmail": "rhaenyra.targaryen@gmail.com",
    "holderPhone": "11985923451",
    "fundingType": "credit",
    "billingCountryCode": "BRA",
    "billingCity": "São Paulo",
    "billingStateCode": "SP",
    "billingStreetLine1": "Rua Casterly Rock, 2000",
    "billingStreetLine2": "1 andar",
    "billingZipCode": "01450-000",
    "metadata": {
        "extraData": "extraData",
        "language": "pt-BR",
        "timezoneOffset": 3,
        "userAgent": "Mozilla",
        "userIp": "255.255.255.25"
    },
    "tags": []
}
    
RESPONSE

Python

Purchase(
    amount=5500,
    billing_city=Sao Paulo,
    billing_country_code=BRA,
    billing_state_code=SP,
    billing_street_line_1=Rua Casterly Rock, 2000,
    billing_street_line_2=1 andar,
    billing_zip_code=01450-000,
    card_ending=9733,
    card_id=,
    challenge_mode=disabled,
    challenge_url=,
    created=2025-02-20 20:17:48.562909,
    currency_code=BRL,
    end_to_end_id=6a361ae0-f977-43b7-9970-4f59d58cd126,
    fee=0,
    funding_type=credit,
    holder_email=rhaenyra.targaryen@gmail.com,
    holder_name=Rhaenyra Targaryen,
    holder_phone=11985923451,
    id=5167847869251584,
    installment_count=2,
    metadata={
        'extraData': 'extraData',
        'language': 'pt-BR',
        'timezoneOffset': 3,
        'userAgent': 'Mozilla',
        'userIp': '255.255.255.255'},
    network=mastercard,
    source=merchant-session/4913745390206976,
    status=denied,
    tags=['session_123'],
    updated=2025-02-20 20:17:49.620024
)
        

Javascript

Purchase {
    id: '6254646393831424',
    amount: 5000,
    installmentCount: 1,
    holderName: 'Rhaenyra Targaryen',
    holderEmail: 'rhaenyra.targaryen@gmail.com',
    holderPhone: '11985923451',
    fundingType: 'credit',
    billingCountryCode: 'BRA',
    billingCity: 'Sao Paulo',
    billingStateCode: 'SP',
    billingStreetLine1: 'Rua Casterly Rock, 2000',
    billingStreetLine2: '1 andar',
    billingZipCode: '01450-000',
    metadata: {
        extraData: 'extraData',
        language: 'pt-BR',
        timezoneOffset: 3,
        userAgent: 'Mozilla',
        userIp: '255.255.255.255'
    },
    cardId: '',
    cardEnding: '9733',
    challengeMode: 'disabled',
    challengeUrl: '',
    created: '2025-02-20T20:28:39.835147+00:00',
    currencyCode: 'BRL',
    endToEndId: 'b8933d90-811d-4010-819d-86d87867059b',
    fee: 0,
    network: 'mastercard',
    source: 'merchant-session/6052679516160000',
    status: 'denied',
    tags: [ 'purchase_1234' ],
    updated: '2025-02-20T20:28:40.902236+00:00'
}
    

PHP

StarkBank\MerchantSession\Purchase Object
(
    [id] => 5693253768708096
    [amount] => 10000
    [billingCity] => Sao Paulo
    [billingCountryCode] => BRA
    [billingStateCode] => SP
    [billingStreetLine1] => Rua Casterly Rock, 2000
    [billingStreetLine2] =>
    [billingZipCode] => 01450-000
    [cardEnding] => 9733
    [cardId] => 5647443689472000
    [challengeMode] => enabled
    [challengeUrl] => https://development.api.starkinfra.com/v2/acquiring-purchase/5752622027898880/challenge
    [created] => DateTime Object
        (
            [date] => 2025-01-30 18:39:52.136626
            [timezone_type] => 1
            [timezone] => +00:00
        )
    [currencyCode] => BRL
    [endToEndId] => 00372f52-52c8-4907-b03b-3946cacae4e3
    [fee] => 0
    [fundingType] => debit
    [holderEmail] => tywin.lannister@gmail.com
    [holderName] => Tywin Lannister
    [holderPhone] => 11985923451
    [installmentCount] => 5
    [metadata] => Array
        (
            [language] => pt-BR
            [timezoneOffset] => 3
            [userAgent] => Mozilla
            [userIp] => 255.255.255.255
            [extraData] => extraData
        )
    [network] => mastercard
    [source] => merchant-session/5674419263373312
    [status] => pending
    [tags] => Array
        (
        )
    [updated] => DateTime Object
        (
            [date] => 2025-01-30 18:39:54.029416
            [timezone_type] => 1
            [timezone] => +00:00
        )
)

        

Java

Purchase({
    "amount": 10000,
    "billingCity": "Sao Paulo",
    "billingCountryCode": "BRA",
    "billingStateCode": "SP",
    "billingStreetLine1": "Rua Casterly Rock, 2000",
    "billingStreetLine2": "1 andar",
    "billingZipCode": "01450-000",
    "cardEnding": "9733",
    "cardId": "5647443689472000",
    "challengeMode": "enabled",
    "challengeUrl": "https://development.api.starkinfra.com/v2/acquiring-purchase/5752622027898880/challenge",
    "created": "2025-01-30T18:39:52.136626+00:00",
    "currencyCode": "BRL",
    "endToEndId": "00372f52-52c8-4907-b03b-3946cacae4e3",
    "fee": 0,
    "fundingType": "debit",
    "holderEmail": "tywin.lannister@gmail.com",
    "holderName": "Tywin Lannister",
    "holderPhone": "11985923451",
    "id": "5693253768708096",
    "installmentCount": 5,
    "metadata": {
        "language": "pt-BR",
        "timezoneOffset": 3,
        "userAgent": "Mozilla",
        "userIp": "255.255.255.255",
        "extraData": "extraData"
    },
    "network": "mastercard",
    "source": "merchant-session/5674419263373312",
    "status": "pending",
    "tags": [],
    "updated": "2025-01-30T18:39:54.029416+00:00"
})
  

Ruby

purchase(
    id: 5099195274887168,
    amount: 5000,
    holder_name: Rhaenyra Targaryen,
    funding_type: credit,
    holder_email: rhaenyra.targaryen@gmail.com,
    holder_phone: 11985923451,
    installment_count: 1,
    billing_country_code: BRA,
    billing_city: Sao Paulo,
    billing_state_code: SP,
    billing_street_line_1: Rua Casterly Rock, 2000,
    billing_street_line_2: 1 andar,
    billing_zip_code: 01450-000,
    metadata: {
        "extradata"=>"extraData",
        "language"=>"pt-BR",
        "timezoneoffset"=>3,
        "useragent"=>"Mozilla",
        "userip"=>"255.255.255.255"
    },
    card_ending: 9733,
    card_id: ,
    challenge_mode: disabled,
    challenge_url: ,
    created: 2025-02-20T22:31:13+00:00,
    currency_code: BRL,
    end_to_end_id: 6ba82bc4-8ca3-4613-a38e-575a25984e26,
    fee: 0,
    network: mastercard,
    source: merchant-session/4992147199623168,
    status: denied,
    tags: ["session_123"],
    updated: 2025-02-20T22:31:14+00:00
)
        

Elixir

%StarkBank.MerchantSession.Purchase{
    amount: 10000,
    billing_city: "Sao Paulo",
    billing_country_code: "BRA",
    billing_state_code: "SP",
    billing_street_line_1: "Rua Casterly Rock, 2000",
    billing_street_line_2: "",
    billing_zip_code: "01450-000",
    card_ending: "9733",
    card_id: "5647443689472000",
    challenge_mode: "enabled",
    challenge_url: "https://development.api.starkinfra.com/v2/acquiring-purchase/5752622027898880/challenge",
    created: ~U[2025-01-30 18:39:52.136626Z],
    currency_code: "BRL",
    end_to_end_id: "00372f52-52c8-4907-b03b-3946cacae4e3",
    fee: 0,
    funding_type: "debit",
    holder_email: "tywin.lannister@gmail.com",
    holder_name: "Tywin Lannister",
    holder_phone: "11985923451",
    id: "5693253768708096",
    installment_count: 5,
    metadata: %{
        language: "pt-BR",
        timezoneOffset: 3,
        userAgent: "Mozilla",
        userIp: "255.255.255.255"
        extraData: "extraData"
    },
    network: "mastercard",
    source: "merchant-session/5674419263373312",
    status: "pending",
    tags: [],
    updated: ~U[2025-01-30 18:39:54.029416Z]
}
        

C#

MerchantSession.Purchase(
    Amount: 5000,
    BillingCity: "Sao Paulo",
    BillingCountryCode: "BRA",
    BillingStateCode: "SP",
    BillingStreetLine1: "Rua Casterly Rock, 2000",
    BillingStreetLine2: "",
    BillingZipCode: "01450-000",
    CardEnding: "9733",
    CardId: "5647443689472000",
    ChallengeMode: "enabled",
    ChallengeUrl: "https://development.api.starkinfra.com/v2/acquiring-purchase/5752622027898880/challenge",
    Created: "01/30/2025 18:39:52",
    CurrencyCode: "BRL",
    EndToEndId: "00372f52-52c8-4907-b03b-3946cacae4e3",
    Fee: 0,
    FundingType: "debit",
    HolderEmail: "tywin.lannister@gmail.com",
    HolderName: "Tywin Lannister",
    HolderPhone: "11985923451",
    ID: "5693253768708096",
    InstallmentCount: 1,
    Metadata: {
        Language: "pt-BR",
        TimezoneOffset: 3,
        UserAgent: "Mozilla",
        UserIp: "255.255.255.255"
        extraData: "extraData"
    },
    Network: "mastercard",
    Source: "merchant-session/5674419263373312",
    Status: "pending",
    Tags: [],
    Updated: "01/30/2025 18:39:54",
)
        

Go

{
    Id: "5693253768708096",
    Amount: 5000,
    BillingCity: "Sao Paulo",
    BillingCountryCode: "BRA",
    BillingStateCode: "SP",
    BillingStreetLine1: "Rua Casterly Rock, 2000",
    BillingStreetLine2: "",
    BillingZipCode: "01450-000",
    CardEnding: "9733",
    CardId: "5647443689472000",
    ChallengeMode: "enabled",
    ChallengeUrl: "https://development.api.starkinfra.com/v2/acquiring-purchase/5752622027898880/challenge",
    Created: "2025-01-30 18:39:52.136626 +0000 +0000",
    CurrencyCode: "BRL",
    EndToEndId: "00372f52-52c8-4907-b03b-3946cacae4e3",
    Fee: 0,
    FundingType: "debit",
    HolderEmail: "tywin.lannister@gmail.com",
    HolderName: "Tywin Lannister",
    HolderPhone: "11985923451",
    InstallmentCount: 1,
    Metadata: {
        Language: "pt-BR",
        TimezoneOffset: 3,
        UserAgent: "Mozilla",
        UserIp: "255.255.255.255"
        ExtraData: "extraData"
    },
    Network: "mastercard",
    Source: "merchant-session/5674419263373312",
    Status: "pending",
    Tags: [],
    Updated: "2025-01-30 18:39:54.029416 +0000 +0000",
}
        

Clojure

{:id "5693253768708096",
:amount 5000,
:billing-city "Sao Paulo",
:billing-country-code "BRA",
:billing-state-code "SP",
:billing-street-line1 "Rua Casterly Rock, 2000",
:billing-street-line2 "1 andar",
:billing-zip-code "01450-000",
:card-ending "9733",
:card-id "5647443689472000",
:challenge-mode "enabled",
:challenge-url "https://development.api.starkinfra.com/v2/acquiring-purchase/5752622027898880/challenge",
:created "2025-01-30T18:39:52.136626+00:00",
:currency-code "BRL",
:end-to-end-id "00372f52-52c8-4907-b03b-3946cacae4e3",
:fee 0,
:funding-type "debit",
:holder-email "tywin.lannister@gmail.com",
:holder-name "Tywin Lannister",
:holder-phone "11985923451",
:installment-count 1,
:metadata {:language "pt-BR",
            :timezone-offset 3,
            :user-agent "Mozilla",
            :user-ip "255.255.255.255"
            :extraData "extraData"},
:network "mastercard",
:source "merchant-session/5674419263373312",
:status "pending",
:tags [],
:updated "2025-01-30T18:39:54.029416+00:00"}
        

Curl

{
    "message": "Merchant Purchase successfully created",
    "purchase": {
        "amount": 5000,
        "billingCity": "Sao Paulo",
        "billingCountryCode": "BRA",
        "billingStateCode": "SP",
        "billingStreetLine1": "Rua Casterly Rock, 2000",
        "billingStreetLine2": "1 andar",
        "billingZipCode": "01450-000",
        "cardEnding": "5682",
        "cardId": "5647443689472000",
        "challengeMode": "disabled",
        "challengeUrl": "",
        "created": "2024-09-06T21:36:15.255100+00:00",
        "currencyCode": "BRL",
        "endToEndId": "8bd3bf6c-04dd-4878-9c09-f933a9234519",
        "fee": 0,
        "fundingType": "credit",
        "holderEmail": "tywin.lannister@gmail.com",
        "holderName": "Tywin Lannister",
        "holderPhone": "11985923451",
        "id": "6237525488173056",
        "installmentCount": 1,
        "metadata": {
            "language": "pt-BR",
            "timezoneOffset": 3,
            "userAgent": "Mozilla",
            "userIp": "255.255.255.255
            "extraData": "extraData"
        },
        "network": "mastercard",
        "source": "merchant-session/6012328071921664",
        "status": "approved",
        "tags": [],
        "updated": "2024-09-06T21:36:17.785121+00:00"
    }
}
    

List Merchant Sessions

Get a list of merchant sessions in chunks of at most 100. If you need smaller chunks, use the limit parameter.

Parameters

after OPTIONAL

Filter entities created after this date.

before OPTIONAL

Filter entities created before this date.

cursor OPTIONAL

String used to get the next batch of results. Our SDKs handle this for you.

fields OPTIONAL

List of strings to filter response JSON keys. Not available in the SDKs.

ids OPTIONAL

List of strings to get specific entities by ids.

limit OPTIONAL

Number of results per cursor. Max = 100.

status OPTIONAL

Filter sessions by the specified status, such as: active, expired, success.

tags OPTIONAL

Filter entities that contain the specified tags.

ENDPOINT
GET /v2/merchant-session
REQUEST

Python

import starkbank

merchant_sessions = starkbank.merchantsession.query(after= "2025-01-01", before= "2025-03-01")

for merchant_session in merchant_sessions:
    print(merchant_session)
        

Javascript

const starkbank = require('starkbank');

(async() => {
    let merchantSessions = await starkbank.merchantSession.query({
        after: '2025-01-01',
        before: '2025-03-01',
    });

    for await (let merchantSession of merchantSessions) {
        console.log(merchantSession);
    }
})();
    

PHP

use StarkBank\MerchantSession;

$merchantSessions = MerchantSession::query([
    "after" => "2025-01-01",
    "before" => "2025-03-01"
]);

foreach($merchantSessions as $merchantSession){
    print_r($merchantSession);
}
        

Java

import com.starkbank.*;
import com.starkbank.utils.Generator;
import java.util.HashMap;


HashMap<String, Object> params = new HashMap<>();
params.put("after", "2025-01-01");
params.put("before", "2025-03-01");
Generator<MerchantSession> merchantSessions = MerchantSession.query(params);

for (MerchantSession merchantSession : merchantSessions) {
    System.out.println(merchantSession);
}
        

Ruby

require 'starkbank'

merchantSessions = StarkBank::MerchantSession.query(after: '2025-01-01', before: '2025-03-01')

merchantSessions.each do |merchantSession|
    puts merchantSession
end
        

Elixir

merchantSessions = StarkBank.MerchantSession.query!(after: "2025-01-01", before: "2025-03-01")

for merchantSession <- merchantSessions do
    merchantSession |> IO.inspect
end
        

C#

using System;
using StarkBank;

List<MerchantSession> merchantSessions = MerchantSession.Query(after: new DateTime(2025, 1, 1), before: new DateTime(2025, 3, 1)).ToList();

foreach (MerchantSession merchantSession in merchantSessions)
{
    Console.WriteLine(merchantSession);
}
        

Go

package main

import (
    "fmt"
    "time"
    MerchantSession "github.com/starkbank/sdk-go/starkbank/merchantsession"
)

func main() {

    var params = map[string]interface{}{}
    params["after"] = time.Date(2025, 1, 1, 0, 0, 0, 0, time.UTC)
    params["before"] = time.Date(2025, 3, 1, 0, 0, 0, 0, time.UTC)

    merchantsessions, errorChannel := MerchantSession.Query(params, nil)

    loop:
    for {
        select {
        case err := <-errorChannel:
            if err.Errors != nil {
                for _, e := range err.Errors {
                    fmt.Printf("code: %s, message: %s", e.Code, e.Message)
                }
            }
        case merchantsession, ok := <-merchantsessions:
            if !ok {
                break loop
            }
            fmt.Printf("%+v", merchantsession)
        }
    }
}
        

Clojure

(def merchant-sessions
  (starkbank.merchant-session/query
    {
      :after "2025-01-01",
      :before "2025-03-01"
    }))
(dorun (map println merchant-sessions))
        

Curl

curl --location --request GET '{{baseUrl}}/v2/merchant-session' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}' 
--header 'Content-Type: application/json' 
    
RESPONSE

Python

MerchantSession(
    allowed_funding_types=['credit', 'debit'],
    allowed_installments=[
        AllowedInstallment(
            count=1,
            total_amount=5000
        ),
        AllowedInstallment(
            count=2,
            total_amount=5500
        )
    ],
    allowed_ips=[],
    challenge_mode=enabled,
    created=2025-01-03 15:47:08.879093,
    expiration=3600,
    id=5739291523153920,
    status=success,
    tags=[],
    updated=2025-01-03 15:47:41.826546,
    uuid=281319fce4f149acb71044e2f305953d
)
        

Javascript

MerchantSession {
    allowedFundingTypes: [
        'credit',
        'debit'
    ],
    allowedInstallments: [
        {
            count: 1,
            totalAmount: 5000
        },
        {
            count: 2,
            totalAmount: 5500
        }
    ],
    allowedIps: [],
    challengeMode: 'disabled',
    created: '2024-09-06T20:34:10.594675+00:00',
    expiration: 3600,
    id: '5950134772826112',
    status: 'created',
    tags: [],
    updated: '2024-09-06T20:34:10.611544+00:00',
    uuid: 'b559350884674b31926abb5a8f3d5f31'
}
    

PHP

StarkBank\MerchantSession Object
(
    [id] => 5674419263373312
    [allowedFundingTypes] => Array
        (
            [0] => credit
            [1] => debit
        )
    [allowedInstallments] => Array
        (
            [0] => StarkBank\AllowedInstallment Object
                (
                    [count] => 1
                    [totalAmount] => 5000
                )
            [1] => StarkBank\AllowedInstallment Object
                (
                    [count] => 2
                    [totalAmount] => 5500
                )
        )
    [allowedIps] => Array
        (
        )
    [challengeMode] => disabled
    [created] => DateTime Object
        (
            [date] => 2025-01-30 18:37:06.385441
            [timezone_type] => 1
            [timezone] => +00:00
        )
    [expiration] => 3600
    [status] => created
    [tags] => Array
        (
        )
    [updated] => DateTime Object
        (
            [date] => 2025-01-30 18:37:06.415248
            [timezone_type] => 1
            [timezone] => +00:00
        )
    [uuid] => 9ebe95f651054f13a98d977a89b48418
)
        

Java

MerchantSession({
    "id": "5229459015729152",
    "allowedFundingTypes": [
        "credit",
        "debit"
    ],
    "allowedInstallments": [
        {
            "count": 1,
            "totalAmount": 5000
        },
        {
            "count": 2,
            "totalAmount": 5500
        }
    ],
    "allowedIps": [],
    "challengeMode": "disabled",
    "created": "2025-02-10T17:01:27.106142+00:00",
    "expiration": 3600,
    "status": "created",
    "tags": [
        "session_123"
    ],
    "updated": "2025-02-10T17:01:27.135006+00:00",
    "uuid": "63caf64913d14465b1ebe2ec09a8b1cd"
})

Ruby

merchantsession(
    id: 5315436031770624,
    allowed_funding_types: ["debit", "credit"],
    allowed_installments: [
        allowedinstallment(
            count: 1,
            total_amount: 5000
        ),
        allowedinstallment(
            count: 2,
            total_amount: 5200
        )
    ],
    allowed_ips: [],
    challenge_mode: disabled,
    expiration: 3600,
    status: created,
    tags: ["session_123"],
    created: 2025-02-20T21:18:39+00:00,
    updated: 2025-02-20T21:18:39+00:00,
    uuid: 5697ac1bdc944619b365149e317b6dcd
)
        

Elixir

%StarkBank.MerchantSession{
    id: "5674419263373312",
    allowed_funding_types: ["credit", "debit"],
    allowed_installments: [
        %StarkBank.AllowedInstallment{
            count: 1,
            total_amount: 5000
        },
        %StarkBank.AllowedInstallment{
            count: 2,
            total_amount: 5500
        }
    ],
    allowed_ips: [],
    challenge_mode: "disabled",
    created: ~U[2025-01-30 18:37:06.385441Z],
    expiration: 3600,
    status: "created",
    tags: [],
    updated: ~U[2025-01-30 18:37:06.415248Z],
    uuid: "9ebe95f651054f13a98d977a89b48418"
}
        

C#

MerchantSession(
    AllowedFundingTypes: { credit, debit },
    AllowedInstallments: {
        AllowedInstallment(
            Count: 1,
            TotalAmount: 5000
        )
    },
    AllowedIps: {  },
    ChallengeMode: disabled,
    Expiration: 3600,
    Status: success,
    Tags: {  },
    Uuid: a775cc537642469ca4aac12b2ac49c65,
    Created: 1/3/2025 12:49:12 PM,
    Updated: 1/3/2025 12:49:19 PM,
    ID: 5721406113316864
)
        

Go

{
    Id: 5229459015729152,
    AllowedFundingTypes: ["credit", "debit"],
    AllowedInstallments: [
        {
            Count: 1,
            TotalAmount: 5000
        },
        {
            Count: 2,
            TotalAmount: 5500
    }
    ],
    AllowedIps: [],
    ChallengeMode: "disabled",
    Created: "2024-09-06T20:34:10.804971+00:00",
    Expiration: 3600,
    Status: "created",
    Tags: ["session_123"],
    Updated: "2024-09-06T20:34:10.804971+00:00",
    Uuid: "63caf64913d14465b1ebe2ec09a8b1cd"
}
        

Clojure

{:id "5674419263373312",
:allowed-funding-types ["credit" "debit"],
:allowed-installments [{:count 1, :total-amount 5000}
                        {:count 2, :total-amount 5500}],
:allowed-ips [],
:challenge-mode "disabled",
:created "2025-01-30T18:37:06.385441+00:00",
:expiration 3600,
:status "created",
:tags [],
:updated "2025-01-30T18:37:06.415248+00:00",
:uuid "9ebe95f651054f13a98d977a89b48418"}
        

Curl

{
    "cursor": "ClcKFAoHY3JlYXRlZBIJCKDD2tebqYcDEjtqGml-YXBpLW1zLWNhcmQtbWVyY2hhbnQtc2J4ch0LEhBNZXJjaGFudFB1cmNoYXNlGICAgNil4boIDBgAIAE=",
    "sessions": [
        {
            "allowedFundingTypes": [
                "credit",
                "debit"
            ],
            "allowedInstallments": [
                {
                    "count": 1,
                    "totalAmount": 5000
                },
                {
                    "count": 2,
                    "totalAmount": 5500
                }
            ],
            "allowedIps": [],
            "challengeMode": "disabled",
            "created": "2024-09-06T20:34:10.594675+00:00",
            "expiration": 3600,
            "id": "5950134772826112",
            "status": "created",
            "tags": [],
            "updated": "2024-09-06T20:34:10.611544+00:00",
            "uuid": "b559350884674b31926abb5a8f3d5f31"
        }
    ]
}
    

Get a Merchant Session

Retrieve detailed information about a specific session by its id.

Parameters

id REQUIRED

The unique identifier for the merchant session that needs to be retrieved.

fields OPTIONAL

List of strings to filter response JSON keys. Not available in the SDKs.

ENDPOINT
GET /v2/merchant-session/:id
REQUEST

Python

import starkbank

merchant_session = starkbank.merchantsession.get('5739291523153920')
print(merchant_session)
        

Javascript

const starkbank = require('starkbank');

(async() => {
    let merchantSession = await starkbank.merchantSession.get('5950134772826112');
    console.log(merchantSession);
})();
    

PHP

use StarkBank\MerchantSession;

$merchantSession = MerchantSession::get("5950134772826112");

print_r($merchantSession);
        

Java

import com.starkbank.*;

MerchantSession merchantSession = MerchantSession.get("5950134772826112");

System.out.println(merchantSession);
        

Ruby

require 'starkbank'

merchant_session = StarkBank::MerchantSession.get('5950134772826112')

puts merchant_session
        

Elixir

{:ok, merchant_session} = StarkBank.MerchantSession.get("5950134772826112")
IO.inspect(merchant_session)
        

C#

using System;

MerchantSession merchantSession = MerchantSession.Get("5721406113316864");

Console.WriteLine(merchantSession);
        

Go

package main

import (
    "fmt"
    "github.com/starkbank/sdk-go/starkbank"
    MerchantSession "github.com/starkbank/sdk-go/starkbank/merchantsession"
)

func main() {

    merchantSession, err := MerchantSession.Get("5950134772826112", nil)
    if err.Errors != nil {
        for _, e := range err.Errors {
            fmt.Printf("code: %s, message: %s", e.Code, e.Message)
        }
    }

    fmt.Printf("%+v", merchantSession)
}
        

Clojure

(require '[starkbank.merchant-session :as merchant-session]')

(let [merchant-session (merchant-session/get "5950134772826112")]
  (println merchant-session))
        

Curl

curl --location --request GET '{{baseUrl}}/v2/merchant-session/5950134772826112' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}' 
--header 'Content-Type: application/json' 
    
RESPONSE

Python

MerchantSession(
    allowed_funding_types=['credit', 'debit'],
    allowedInstallments=[
        AllowedInstallment(
            count=1,
            total_amount=5000
        ),
        AllowedInstallment(
            count=2,
            total_amount=5500
        )
    ],
    allowed_ips=[],
    challenge_mode=enabled,
    created=2025-01-03 15:47:08.879093,
    expiration=3600,
    id=5739291523153920,
    status=success,
    tags=[],
    updated=2025-01-03 15:47:41.826546,
    uuid=281319fce4f149acb71044e2f305953d
)
        

Javascript

MerchantSession {
    allowedFundingTypes: [
        'credit',
        'debit'
    ],
    allowedInstallments: [
        {
            count: 1,
            totalAmount: 5000
        },
        {
            count: 2,
            totalAmount: 5500
        }
    ],
    allowedIps: [],
    challengeMode: 'disabled',
    created: '2024-09-06T20:34:10.594675+00:00',
    expiration: 3600,
    id: '5950134772826112',
    status: 'created',
    tags: [],
    updated: '2024-09-06T20:34:10.611544+00:00',
    uuid: 'b559350884674b31926abb5a8f3d5f31'
}
    

PHP

StarkBank\MerchantSession Object
(
    [id] => 5950134772826112
    [allowedFundingTypes] => Array
        (
            [0] => credit
            [1] => debit
        )
    [allowedInstallments] => Array
        (
            [0] => StarkBank\AllowedInstallment Object
                (
                    [count] => 1
                    [totalAmount] => 5000
                )
            [1] => StarkBank\AllowedInstallment Object
                (
                    [count] => 2
                    [totalAmount] => 5500
                )
        )
    [allowedIps] => Array
        (
        )
    [challengeMode] => disabled
    [created] => DateTime Object
        (
            [date] => 2025-01-30 18:37:06.385441
            [timezone_type] => 1
            [timezone] => +00:00
        )
    [expiration] => 3600
    [status] => created
    [tags] => Array
        (
        )
    [updated] => DateTime Object
        (
            [date] => 2025-01-30 18:37:06.415248
            [timezone_type] => 1
            [timezone] => +00:00
        )
    [uuid] => 9ebe95f651054f13a98d977a89b48418
)
        

Java

MerchantSession({
    "id": "5950134772826112",
    "allowedFundingTypes": [
        "credit",
        "debit"
    ],
    "allowedInstallments": [
        {
            "count": 1,
            "totalAmount": 5000
        },
        {
            "count": 2,
            "totalAmount": 5500
        }
    ],
    "allowedIps": [],
    "challengeMode": "disabled",
    "created": "2025-02-10T17:01:27.106142+00:00",
    "expiration": 3600,
    "status": "created",
    "tags": [
        "session_123"
    ],
    "updated": "2025-02-10T17:01:27.135006+00:00",
    "uuid": "63caf64913d14465b1ebe2ec09a8b1cd"
})
    

Ruby

merchantsession(
    id: 5950134772826112,
    allowed_funding_types: ["debit", "credit"],
    allowed_installments: [
        allowedinstallment(
            count: 1,
            total_amount: 5000
        ),
        allowedinstallment(
            count: 2,
            total_amount: 5200
        )
    ],
    allowed_ips: [],
    challenge_mode: disabled,
    expiration: 3600,
    status: created,
    tags: ["session_123"],
    created: 2025-02-20T21:18:39+00:00,
    updated: 2025-02-20T21:18:39+00:00,
    uuid: 5697ac1bdc944619b365149e317b6dcd
)

Elixir

%StarkBank.MerchantSession{
    id: "5950134772826112",
    allowed_funding_types: ["credit", "debit"],
    allowed_installments: [
        %StarkBank.AllowedInstallment{
            count: 1,
            total_amount: 5000
        },
        %StarkBank.AllowedInstallment{
            count: 2,
            total_amount: 5500
        }
    ],
    allowed_ips: [],
    challenge_mode: "disabled",
    created: ~U[2025-01-30 18:37:06.385441Z],
    expiration: 3600,
    status: "created",
    tags: [],
    updated: ~U[2025-01-30 18:37:06.415248Z],
    uuid: "9ebe95f651054f13a98d977a89b48418"
}
        

C#

MerchantSession(
    AllowedFundingTypes: { credit, debit },
    AllowedInstallments: {
        AllowedInstallment(
            Count: 1,
            TotalAmount: 5000
        )
    },
    AllowedIps: {  },
    ChallengeMode: disabled,
    Expiration: 3600,
    Status: success,
    Tags: {  },
    Uuid: a775cc537642469ca4aac12b2ac49c65,
    Created: 1/3/2025 12:49:12 PM,
    Updated: 1/3/2025 12:49:19 PM,
    ID: 5721406113316864
)
        

Go

{
    Id: 5950134772826112,
    AllowedFundingTypes: ["credit", "debit"],
    AllowedInstallments: [
        {
            Count: 1,
            TotalAmount: 5000
        },
        {
            Count: 2,
            TotalAmount: 5500
        }
    ],
    AllowedIps: [],
    ChallengeMode: "disabled",
    Created: "2025-02-10 17:01:27.106142 +0000 +0000",
    Expiration: 3600,
    Status: "created",
    Tags: ["session_123"],
    Updated: "2025-02-10 17:01:27.135006 +0000 +0000",
    Uuid: "63caf64913d14465b1ebe2ec09a8b1cd"
}
        

Clojure

{:id "5950134772826112",
:allowed-funding-types ["credit" "debit"],
:allowed-installments [{:count 1, :total-amount 5000}
                        {:count 2, :total-amount 5500}],
:allowed-ips [],
:challenge-mode "disabled",
:created "2025-01-30T18:37:06.385441+00:00",
:expiration 3600,
:status "created",
:tags [],
:updated "2025-01-30T18:37:06.415248+00:00",
:uuid "9ebe95f651054f13a98d977a89b48418"}
        

Curl

{
    "session": {
        "allowedFundingTypes": [
            "credit",
            "debit"
        ],
        "allowedInstallments": [
            {
                "count": 1,
                "totalAmount": 5000
            },
            {
                "count": 2,
                "totalAmount": 5500
            }
        ],
        "allowedIps": [],
        "challengeMode": "disabled",
        "created": "2024-09-06T20:34:10.594675+00:00",
        "expiration": 3600,
        "id": "5950134772826112",
        "status": "created",
        "tags": [],
        "updated": "2024-09-06T20:34:10.611544+00:00",
        "uuid": "b559350884674b31926abb5a8f3d5f31"
    }
}
    

List Merchant Session Logs

Get a paged list of merchant session logs.

A log tracks a change in the session entity according to its life cycle.

Parameters

after OPTIONAL

Filter entities created after this date.

before OPTIONAL

Filter entities created before this date.

cursor OPTIONAL

String used to get the next batch of results. Our SDKs handle this for you.

fields OPTIONAL

List of strings to filter response JSON keys. Not available in the SDKs.

limit OPTIONAL

Number of results per cursor. Max = 100.

sessionIds OPTIONAL

Filter the merchant session ids to only include its corresponding logs

types OPTIONAL

Filters logs by log types.

ENDPOINT
GET /v2/merchant-session/log
REQUEST

Python

import starkbank

merchant_session_logs = starkbank.merchantsession.log.query(limit=1)
for log in merchant_session_logs:
    print(log)
        

Javascript

const starkbank = require('starkbank');

(async() => {
    let logs = await starkbank.merchantSession.log.query({
        limit: 1
    });

    for await (let log of logs) {
        console.log(log);
    }
})();
    

PHP

use StarkBank\MerchantSession\Log;

$logs = Log::query(["limit" => 1]);

foreach($logs as $log){
    print_r($log);
}
        

Java

import com.starkbank.*;
import com.starkbank.utils.Generator;
import java.util.HashMap;


HashMap<String, Object> params = new HashMap<>();
params.put("limit", 1);
Generator<MerchantSession.Log> logs = MerchantSession.Log.query(params);

for (MerchantSession.Log log : logs) {
    System.out.println(log);
}
        

Ruby

require 'starkbank'

logs = StarkBank::MerchantSession::Log.query(limit: 1)

logs.each do |log|
    puts log
end
        

Elixir

logs = StarkBank.MerchantSession.Log.query!(limit: 1)

for log <- logs do
    log |> IO.inspect
end
        

C#

using System;
using StarkBank;

List<MerchantSession.Log> logs = MerchantSession.Log.Query(limit: 1).ToList();

foreach (MerchantSession.Log log in logs)
{
    Console.WriteLine(log);
}
        

Go

package main

import (
    "fmt"
    "github.com/starkbank/sdk-go/starkbank/merchantsession/log"
)

func main() {

    var params = map[string]interface{}{}
    params["limit"] = 1

    logs, errorChannel := log.Query(params, nil)

    loop:
    for {
        select {
        case err := <-errorChannel:
            if err.Errors != nil {
                for _, e := range err.Errors {
                    fmt.Printf("code: %s, message: %s", e.Code, e.Message)
                }
            }
        case log, ok := <-logs:
            if !ok {
                break loop
            }
            fmt.Printf("%+v", log)
        }
    }
}
        

Clojure

(def logs
  (starkbank.merchant-session.log/query
    {
      :limit 1
    }))
(dorun (map println logs))
        

Curl

curl --location --request GET '{{baseUrl}}/v2/merchant-session/log' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}' 
--header 'Content-Type: application/json' 
    
RESPONSE

Python

Log(
	created=2025-02-21 22:30:11.107220,
	errors=[],
	id=6206771064471552,
	session=MerchantSession(
        allowed_funding_types=['debit', 'credit'],
        allowed_installments=[
            AllowedInstallment(
                count=1,
                total_amount=5000
            ),
            AllowedInstallment(
                count=2,
                total_amount=5500
            )
        ],
		allowed_ips=[],
		challenge_mode=enabled,
		created=2025-02-21 22:30:11.080441,
		expiration=3600,
		id=5080871157628928,
		status=created,
		tags=['stark', 'suit'],
		updated=2025-02-21 22:30:11.233107,
		uuid=ffc2e83962f14424833b96776dcaed83
	),
	type=created
)
           

Javascript

MerchantSession.Log {
    created: '2024-09-06T20:34:10.638530+00:00',
    id: '4719146705092608',
    session: {
        allowedFundingTypes: [
            'credit',
            'debit'
        ],
        allowedInstallments: [
            {
                count: 1,
                totalAmount: 5000
            },
            {
                count: 2,
                totalAmount: 5500
            }
        ],
        allowedIps: [],
        challengeMode: 'disabled',
        created: '2024-09-06T20:34:10.594675+00:00',
        expiration: 3600,
        id: '6548734053711872',
        status: 'created',
        tags: [],
        updated: '2024-09-06T20:34:10.804971+00:00',
        uuid: 'b559350884674b31926abb5a8f3d5f31'
    },
    type: 'created',
    updated: '2024-09-06T20:34:10.804979+00:00'
}
    

PHP

StarkBank\MerchantSession\Log Object
(
    [created] => DateTime Object
        (
            [date] => 2024-09-06T20:34:10.638530
            [timezone_type] => 1
            [timezone] => +00:00
        )
    [id] => 4719146705092608
    [session] => StarkBank\MerchantSession Object
        (
            [allowedFundingTypes] => Array
                (
                    [0] => credit
                    [1] => debit
                )
            [allowedInstallments] => Array
                (
                    [0] => Array
                        (
                            [count] => 1
                            [totalAmount] => 5000
                        )
                    [1] => Array
                        (
                            [count] => 2
                            [totalAmount] => 5500
                        )
                )
            [allowedIps] => Array
                (
                )
            [challengeMode] => disabled
            [created] => DateTime Object
                (
                    [date] => 2024-09-06T20:34:10.594675
                    [timezone_type] => 1
                    [timezone] => +00:00
                )
            [expiration] => 3600
            [id] => 6548734053711872
            [status] => created
            [tags] => Array
                (
                )
            [updated] => DateTime Object
                (
                    [date] => 2024-09-06T20:34:10.804971
                    [timezone_type] => 1
                    [timezone] => +00:00
                )
            [uuid] => b559350884674b31926abb5a8f3d5f31
        )
    [type] => created
    [updated] => DateTime Object
        (
            [date] => 2024-09-06T20:34:10.804979
            [timezone_type] => 1
            [timezone] => +00:00
        )
)
        

Java

MerchantSession.Log({
    "created": "2024-09-06T20:34:10.638530+00:00",
    "type": "created",
    "errors": [],
    "session": {
        "allowedFundingTypes": [
            "credit",
            "debit"
        ],
        "allowedInstallments": [
            {
                "count": 1,
                "totalAmount": 5000
            },
            {
                "count": 2,
                "totalAmount": 5500
            }
        ],
        "allowedIps": [],
        "challengeMode": "disabled",
        "created": "2024-09-06T20:34:10.594675+00:00",
        "expiration": 3600,
        "id": "6548734053711872",
        "status": "created",
        "tags": [],
        "updated": "2024-09-06T20:34:10.804971+00:00",
        "uuid": "b559350884674b31926abb5a8f3d5f31"
    },
    "id": "4719146705092608",
    "updated": "2024-09-06T20:34:10.804979+00:00"
})
        

Ruby

log(
    id: 6118047106465792,
    created: 2025-02-20T22:26:43+00:00,
    type: created,
    errors: [],
    session: merchantsession(
        id: 4992147199623168,
        allowed_funding_types: ["debit", "credit"],
        allowed_installments: [
            allowedinstallment(
                count: 1,
                total_amount: 5000
            ),
            allowedinstallment(
                count: 2,
                total_amount: 5200
            )
        ],
        allowed_ips: [],
        challenge_mode: disabled,
        expiration: 3600,
        status: created,
        tags: ["session_123"],
        created: 2025-02-20T22:26:43+00:00,
        updated: 2025-02-20T22:26:43+00:00,
        uuid: 68b14c3512b947378e033cf474abcf35
    )
)
        

Elixir

%StarkBank.MerchantSession.Log{
    created: ~U[2024-09-06T20:34:10.638530Z],
    session: %StarkBank.MerchantSession{
        allowed_funding_types: ["credit", "debit"],
        allowed_installments: [
            %{count: 1, total_amount: 5000},
            %{count: 2, total_amount: 5500}
        ],
        allowed_ips: [],
        challenge_mode: "disabled",
        created: ~U[2024-09-06T20:34:10.594675Z],
        expiration: 3600,
        id: "6548734053711872",
        status: "created",
        tags: [],
        updated: ~U[2024-09-06T20:34:10.804971Z],
        uuid: "b559350884674b31926abb5a8f3d5f31"
    },
    errors: [],
    id: "4719146705092608",
    type: "created",
    updated: ~U[2024-09-06T20:34:10.804979Z]
}
        

C#

Log(
    Created: 2/20/2025 11:36:53 PM,
    Type: created,
    Errors: {  },
    Session: MerchantSession(
        AllowedFundingTypes: { credit },
        AllowedInstallments: {
            AllowedInstallment(1, 5000),
        },
        AllowedIps: {  },
        ChallengeMode: enabled,
        Expiration: 60,
        Status: created,
        Tags: { test },
        Uuid: 4933debca6094ed4ba3dfbec8ec7c12c,
        Created: 2/20/2025 11:36:53 PM,
        Updated: 2/20/2025 11:37:52 PM,
        ID: 5946646907060224
    ),
    ID: 5383696953638912
)

Go

{
    Id: 4719146705092608,
    Session:{
        AllowedFundingTypes: ["credit", "debit"],
        AllowedInstallments:[
            {Count: 1, TotalAmount: 5000},
            {Count: 2, TotalAmount: 5500}
        ],
        AllowedIps: [],
        ChallengeMode: "disabled",
        Created: "2024-09-06T20:34:10.594675+00:00",
        Expiration: 3600,
        Id: "6548734053711872",
        Status: "created",
        Tags: [],
        Updated: "2024-09-06T20:34:10.804971+00:00",
        Uuid: "b559350884674b31926abb5a8f3d5f31"
    },
    Errors: [],
    Type: "created",
    Updated: "2024-09-06T20:34:10.804979+00:00",
    Created: "2024-09-06T20:34:10.638530+00:00"
}
        

Clojure

{
    :id 4719146705092608,
    :created 2024-09-06T20:34:10.638530+00:00,
    :errors [],
    :type created,
    :session {
        :allowed-funding-types ["credit" "debit"],
        :allowed-installments [{:count 1, :total-amount 5000}
                               {:count 2, :total-amount 5500}],
        :allowed-ips [],
        :challenge-mode "disabled",
        :created 2024-09-06T20:34:10.594675+00:00,
        :expiration 3600,
        :id "6548734053711872",
        :status "created",
        :tags [],
        :updated 2024-09-06T20:34:10.804971+00:00,
        :uuid "b559350884674b31926abb5a8f3d5f31"
    },
    :updated 2024-09-06T20:34:10.804979+00:00
}
        

Curl

{
    "cursor": "CloKFAoHY3JlYXRlZBIJCKOlqIO5rIgDEj5qGmR-YXBpLW1zLWNhcmQtYWNxdWlyZXItZGV2ciALEhNBY3F1aXJpbmdTZXNzaW9uTG9nGICAgIS_9eYIDBgAIAE=",
    "logs": [
        {
            "created": "2024-09-06T20:34:10.638530+00:00",
            "id": "4719146705092608",
            "session": {
                "allowedFundingTypes": [
                    "credit",
                    "debit"
                ],
                "allowedInstallments": [
                    {
                        "count": 1,
                        "totalAmount": 5000
                    },
                    {
                        "count": 2,
                        "totalAmount": 5500
                    }
                ],
                "allowedIps": [],
                "challengeMode": "disabled",
                "created": "2024-09-06T20:34:10.594675+00:00",
                "expiration": 3600,
                "id": "6548734053711872",
                "status": "created",
                "tags": [],
                "updated": "2024-09-06T20:34:10.804971+00:00",
                "uuid": "b559350884674b31926abb5a8f3d5f31"
            },
            "type": "created",
            "updated": "2024-09-06T20:34:10.804979+00:00"
        },
    ]
}

Get a Merchant Session Log

Get a single merchant session log by its id.

Parameters

id REQUIRED

The unique identifier for the merchant session that needs to be retrieved.

fields OPTIONAL

List of strings to filter response JSON keys. Not available in the SDKs.

ENDPOINT
GET /v2/merchant-session/log/:id
REQUEST

Python

import starkbank

log = starkbank.merchantsession.log.get('5950134772826112')
print(log)
        

Javascript

const starkbank = require('starkbank');

(async() => {
    let merchantSessionLog = await starkbank.merchantSession.log.get('5950134772826112');
    console.log(merchantSessionLog);
})();
    

PHP

use StarkBank\MerchantSession\Log;

$log = Log::get("5950134772826112");

print_r($log);
        

Java

import com.starkbank.*;

MerchantSession.Log log = MerchantSession.Log.get("5950134772826112");

System.out.println(log);
        

Ruby

require 'starkbank'

log = StarkBank::MerchantSession::Log.get('5950134772826112')

puts log
        

Elixir

{:ok, log} = StarkBank.MerchantSession.Log.get("5950134772826112")
IO.inspect(log)
        

C#

using System;

MerchantSession.Log log = MerchantSession.Log.Get("5383696953638912");

Console.WriteLine(log);
        

Go

package main

import (
    "fmt"
    "github.com/starkbank/sdk-go/starkbank"
    "github.com/starkbank/sdk-go/starkbank/merchantsession/log"
)

func main() {

    log, err := log.Get("5950134772826112", nil)
    if err.Errors != nil {
        for _, e := range err.Errors {
            fmt.Printf("code: %s, message: %s", e.Code, e.Message)
        }
    }

    fmt.Printf("%+v", log)
}
        

Clojure

(let [log (merchant-session.log/get "5950134772826112")]

(println log))
        

Curl

curl --location --request GET '{{baseUrl}}/v2/merchant-session/log/5950134772826112' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}' 
--header 'Content-Type: application/json' 
    
RESPONSE

Python

Log(
	created=2025-02-21 22:30:11.107220,
	errors=[],
	id=6206771064471552,
	session=MerchantSession(
        allowed_funding_types=['debit', 'credit'],
        allowed_installments=[
            AllowedInstallment(
                count=1,
                total_amount=5000
            ),
            AllowedInstallment(
                count=2,
                total_amount=5500
            )
        ],
        allowed_ips=[],
        challenge_mode=disabled,
        created=2025-02-21 22:30:11.080441,
        expiration=3600,
        id=5080871157628928,
        status=created,
        tags=['stark', 'suit'],
        updated=2025-02-21 22:30:11.233107,
        uuid=ffc2e83962f14424833b96776dcaed83
	),
	type=created
)
        

Javascript

MerchantSession.Log {
    created: '2024-09-06T20:34:10.638530+00:00',
    id: '5950134772826112',
    session: {
        allowedFundingTypes: [
            'credit',
            'debit'
        ],
        allowedInstallments: [
            {
                count: 1,
                totalAmount: 5000
            },
            {
                count: 2,
                totalAmount: 5500
            }
        ],
        allowedIps: [],
        challengeMode: 'disabled',
        created: '2024-09-06T20:34:10.594675+00:00',
        expiration: 3600,
        id: '6548734053711872',
        status: 'created',
        tags: [],
        updated: '2024-09-06T20:34:10.804971+00:00',
        uuid: 'b559350884674b31926abb5a8f3d5f31'
    },
    type: 'created',
    updated: '2024-09-06T20:34:10.804979+00:00'
}
    

PHP

StarkBank\MerchantSession\Log Object
(
    [created] => DateTime Object
        (
            [date] => 2024-09-06T20:34:10.638530
            [timezone_type] => 1
            [timezone] => +00:00
        )
    [id] => 5950134772826112
    [session] => StarkBank\Session Object
        (
            [allowedFundingTypes] => Array
                (
                    [0] => credit
                    [1] => debit
                )
            [allowedInstallments] => Array
                (
                    [0] => Array
                        (
                            [count] => 1
                            [totalAmount] => 5000
                        )
                    [1] => Array
                        (
                            [count] => 2
                            [totalAmount] => 5500
                        )
                )
            [allowedIps] => Array
                (
                )
            [challengeMode] => disabled
            [created] => DateTime Object
                (
                    [date] => 2024-09-06T20:34:10.594675
                    [timezone_type] => 1
                    [timezone] => +00:00
                )
            [expiration] => 3600
            [id] => 6548734053711872
            [status] => created
            [tags] => Array
                (
                )
            [updated] => DateTime Object
                (
                    [date] => 2024-09-06T20:34:10.804971
                    [timezone_type] => 1
                    [timezone] => +00:00
                )
            [uuid] => b559350884674b31926abb5a8f3d5f31
        )
    [type] => created
    [updated] => DateTime Object
        (
            [date] => 2024-09-06T20:34:10.804979
            [timezone_type] => 1
            [timezone] => +00:00
        )
)

        

Java

MerchantSession.Log({
    "created": "2024-09-06T20:34:10.638530+00:00",
    "type": "created",
    "errors": [],
    "session": {
        "allowedFundingTypes": [
            "credit",
            "debit"
        ],
        "allowedInstallments": [
            {
                "count": 1,
                "totalAmount": 5000
            },
            {
                "count": 2,
                "totalAmount": 5500
            }
        ],
        "allowedIps": [],
        "challengeMode": "disabled",
        "created": "2024-09-06T20:34:10.594675+00:00",
        "expiration": 3600,
        "id": "6548734053711872",
        "status": "created",
        "tags": [],
        "updated": "2024-09-06T20:34:10.804971+00:00",
        "uuid": "b559350884674b31926abb5a8f3d5f31"
    },
    "id": "5950134772826112",
    "updated": "2024-09-06T20:34:10.804979+00:00"
})
        

Ruby

log(
    id: 5950134772826112,
    created: 2025-02-20T22:26:43+00:00,
    type: created,
    errors: [],
    session: merchantsession(
        id: 4992147199623168,
        allowed_funding_types: ["debit", "credit"],
        allowed_installments: [
            allowedinstallment(
                count: 1,
                total_amount: 5000
            ),
            allowedinstallment(
                count: 2,
                total_amount: 5200
            )
        ],
        allowed_ips: [],
        challenge_mode: disabled,
        expiration: 3600,
        status: created,
        tags: ["session_123"],
        created: 2025-02-20T22:26:43+00:00,
        updated: 2025-02-20T22:26:43+00:00,
        uuid: 68b14c3512b947378e033cf474abcf35
    )
)
        

Elixir

%StarkBank.MerchantSession.Log{
    created: ~U[2024-09-06T20:34:10.638530Z],
    session: %StarkBank.MerchantSession{
        allowed_funding_types: ["credit", "debit"],
        allowed_installments: [
            %{count: 1, total_amount: 5000},
            %{count: 2, total_amount: 5500}
        ],
        allowed_ips: [],
        challenge_mode: "disabled",
        created: ~U[2024-09-06T20:34:10.594675Z],
        expiration: 3600,
        id: "6548734053711872",
        status: "created",
        tags: [],
        updated: ~U[2024-09-06T20:34:10.804971Z],
        uuid: "b559350884674b31926abb5a8f3d5f31"
    },
    errors: [],
    id: "5950134772826112",
    type: "created",
    updated: ~U[2024-09-06T20:34:10.804979Z]
}
        

C#

Log(
    Created: 2/20/2025 11:36:53 PM,
    Type: created,
    Errors: {  },
    Session: MerchantSession(
        AllowedFundingTypes: { credit },
        AllowedInstallments: {
            AllowedInstallment(
                Count: 1,
                TotalAmount: 5000
            )
        },
        AllowedIps: {  },
        ChallengeMode: enabled,
        Expiration: 60,
        Status: created,
        Tags: { test },
        Uuid: 4933debca6094ed4ba3dfbec8ec7c12c,
        Created: 2/20/2025 11:36:53 PM,
        Updated: 2/20/2025 11:37:52 PM,
        ID: 5946646907060224
    ),
    ID: 5383696953638912
)
        

Go

{
    Id: 5950134772826112,
    Session:{
        AllowedFundingTypes: ["credit", "debit"],
        AllowedInstallments: [
            {Count: 1, TotalAmount: 5000},
            {Count: 2, TotalAmount: 5500}
        ],
        AllowedIps: [],
        ChallengeMode: "disabled",
        Created: "2024-09-06T20:34:10.594675+00:00",
        Expiration: 3600,
        Id: "6548734053711872",
        Status: "created",
        Tags: [],
        Updated: "2024-09-06T20:34:10.804971+00:00",
        Uuid: "b559350884674b31926abb5a8f3d5f31"
    },
    Errors: [],
    Type: "created",
    Updated: "2024-09-06T20:34:10.804979+00:00",
    Created: "2024-09-06T20:34:10.638530+00:00"
}
        

Clojure

{
    :id 5950134772826112,
    :created 2024-09-06T20:34:10.638530+00:00,
    :errors [],
    :type created,
    :session {
        :allowed-funding-types ["credit" "debit"],
        :allowed-installments [{:count 1, :total-amount 5000}
                               {:count 2, :total-amount 5500}],
        :allowed-ips [],
        :challenge-mode "disabled",
        :created 2024-09-06T20:34:10.594675+00:00,
        :expiration 3600,
        :id "6548734053711872",
        :status "created",
        :tags [],
        :updated 2024-09-06T20:34:10.804971+00:00,
        :uuid "b559350884674b31926abb5a8f3d5f31"
    },
    :updated 2024-09-06T20:34:10.804979+00:00
}
        

Curl

{
    "log": {
        "created": "2024-09-06T20:34:10.638530+00:00",
        "id": "5950134772826112",
        "session": {
            "allowedFundingTypes": [
                "credit",
                "debit"
            ],
            "allowedInstallments": [
                {
                    "count": 1,
                    "totalAmount": 5000
                },
                {
                    "count": 2,
                    "totalAmount": 5500
                }
            ],
            "allowedIps": [],
            "challengeMode": "disabled",
            "created": "2024-09-06T20:34:10.594675+00:00",
            "expiration": 3600,
            "id": "6548734053711872",
            "status": "created",
            "tags": [],
            "updated": "2024-09-06T20:34:10.804971+00:00",
            "uuid": "b559350884674b31926abb5a8f3d5f31"
        },
        "type": "created",
        "updated": "2024-09-06T20:34:10.804979+00:00"
    }
}
    

Merchant Purchase

The Merchant Purchase resource can be used to charge customers with credit or debit cards.

If a card hasn't been used before, a Merchant Session Purchase must be created and approved with that specific card before it can be used directly in a Merchant Purchase.

Merchant Purchase Status

Each merchant purchase has a status that can change over time according to its life cycle: merchant-purchase-status

Merchant Purchase Logs

Every time either you or Stark Bank makes a change to a Merchant Purchase, we create a log. Logs are pretty useful for understanding the life cycle of each Merchant Purchase and the changes that happened to it. Here you can see the flow of possible logs: merchant-purchase-log

A confirmed or paid Merchant Purchase can be either partially or fully reversed back to its payer (the card holder in this case). Multiple reversals can be made for the same Merchant Purchase and each time, the following flow of logs will occur: merchant-purchase-log-reversal

The Merchant Purchase object

Attributes

id STRING

Unique id for the merchant purchase.

amount INTEGER

Amount in cents to be received. Example: 100 (R$1.00).

cardEnding STRING

Last 4 digits of the card.

cardId STRING

ID of the Merchant Card used for the purchase.

challengeMode STRING

Holder verification mode. Options: "enabled", "disabled".

challengeUrl STRING

URL for holder verification challenge.

created STRING

Creation datetime. Example: "2020-04-23T23:00:00.000000+00:00".

currencyCode STRING

Currency code of the purchase.

endToEndId STRING

End-to-end ID of the purchase.

fee INTEGER

Fee charged in cents.

fundingType STRING

Funding type. Options: "credit", "debit".

installmentCount INTEGER

Number of purchase installments.

network STRING

Card network.

source STRING

Source of the purchase.

status STRING

Current purchase status. Options: "created", "approved", "denied", "confirmed", "paid", "pending", "canceled", "voided", "failed".

tags LIST OF STRINGS

Tags associated with the purchase.

updated STRING

Last update datetime. Example: "2020-04-23T23:00:00.000000+00:00".

Create Merchant Purchase

This route is used to charge a card that has been previously saved.

Cards can only be used in this route once a previous purchase was approved through a Merchant Session Purchase.

Parameters

amount REQUIRED

A non-negative integer that represents the amount in cents to be received. E.g: 100 (R$1.00)

cardId REQUIRED

The ID of the Merchant Card to be used for the purchase.

fundingType REQUIRED

The type of funding to be used for the purchase. Options are "credit" and "debit".

billingCity CONDITIONALLY REQUIRED

The billing city associated with the card used for the purchase. Required if challengeMode is "enabled" and optional otherwise.

billingCountryCode CONDITIONALLY REQUIRED

The billing country code associated with the card used for the purchase. Required if challengeMode is "enabled" and optional otherwise.

billingStateCode CONDITIONALLY REQUIRED

The billing state code associated with the card used for the purchase. Required if challengeMode is "enabled" and optional otherwise.

billingStreetLine1 CONDITIONALLY REQUIRED

The billing street address associated with the card used for the purchase. Required if challengeMode is "enabled" and optional otherwise.

billingStreetLine2 CONDITIONALLY REQUIRED

The billing street address complement associated with the card used for the purchase. Required if challengeMode is "enabled" and optional otherwise.

billingZipCode CONDITIONALLY REQUIRED

The billing zip code associated with the card used for the purchase. Required if challengeMode is "enabled" and optional otherwise.

challengeMode OPTIONAL

Defines whether or not a holder verification (3DS) will be used when authorizing the purchase. Options are "enabled" and "disabled". Default: "enabled"

holderEmail CONDITIONALLY REQUIRED

The email associated with the holder of the card used for the purchase. Required if challengeMode is "enabled" and optional otherwise.

holderPhone CONDITIONALLY REQUIRED

The phone number associated with the holder of the card used for the purchase. Required if challengeMode is "enabled" and optional otherwise.

installmentCount OPTIONAL

A non-negative integer that represents the number of purchase installments. Default: 1

metadata CONDITIONALLY REQUIRED

An object containing additional data related to the purchase. If 3DS is enabled, the following fields related to the buyer's device are required: userAgent, timezoneOffset, userIp, language.

ENDPOINT
POST /v2/merchant-purchase
REQUEST

Python

import starkbank

merchant_purchase = starkbank.merchantpurchase.create(
    starkbank.MerchantPurchase(
        amount=10000,
        installment_count=5,
        holder_email="tywin.lannister@gmail.com",
        holder_phone="11985923451",
        funding_type="credit",
        billing_country_code="BRA",
        billing_city="Sao Paulo",
        billing_state_code="SP",
        billing_street_line_1="Rua Casterly Rock, 2000",
        billing_street_line_2="1 andar",
        billing_zip_code="01450-000",
        metadata={
            "userAgent": "userAgent",
            "userIp": "184.82.170.183",
            "language": "pt-BR",
            "timezoneOffset": 3,
            "extraData": "extraData"
        },
        card_id="6295415968235520"
    )
)

print(merchant_purchase)

    

Javascript

const starkbank = require('starkbank');

(async() => {
    let merchantPurchase = await starkbank.merchantPurchase.create(
    {
        amount: 10000,
        installmentCount: 5,
        holderEmail: "tywin.lannister@gmail.com",
        holderPhone: "11985923451",
        fundingType: "credit",
        billingCountryCode: "BRA",
        billingCity: "Sao Paulo",
        billingStateCode: "SP",
        billingStreetLine1: "Rua Casterly Rock, 2000",
        billingStreetLine2: "1 andar",
        billingZipCode: "01450-000",
        metadata: {
            userAgent: "userAgent",
            userIp: "184.82.170.183",
            language: "pt-BR",
            timezoneOffset: 3,
            extraData: "extraData"
        },
        cardId: "5920400605184000"
    }
    );

    console.log(merchantPurchase)
})();
        

PHP

$merchantPurchase = MerchantPurchase::create(
    new MerchantPurchase([
        'amount' => 10000,
        'installmentCount' => 5,
        'holderEmail' => "tywin.lannister@gmail.com",
        'holderPhone' => "11985923451",
        'fundingType' => "credit",
        'billingCountryCode' => "BRA",
        'billingCity' => "Sao Paulo",
        'billingState_code' => "SP",
        'billingStreetLine1' => "Rua Casterly Rock, 2000",
        'billingStreetLine2' => "1 andar",
        'billingZipCode' => "01450-000",
        'metadata' => [
            'userAgent' => "userAgent",
            'userIp' => "184.82.170.183",
            'language' => "pt-BR",
            'timezoneOffset' => 3,
            'extraData' => "extraData"
        ],
        'cardId' => "5920400605184000"
    ])
);

print_r($merchantPurchase);
        

Java

import com.starkbank.*;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

Map<String, Object> data = new HashMap<>();
data.put("amount", 10000L);
data.put("installmentCount", 5);
data.put("holderEmail", "tywin.lannister@gmail.com");
data.put("holderPhone", "11985923451");
data.put("fundingType", "credit");
data.put("billingCountryCode", "BRA");
data.put("billingCity", "Sao Paulo");
data.put("billingStateCode", "SP");
data.put("billingStreetLine1", "Rua Casterly Rock, 2000");
data.put("billingStreetLine2", "1 andar");
data.put("billingZipCode", "01450-000");
data.put("cardId", "5920400605184000");


Map<String, Object> metadata = new HashMap<>();
metadata.put("userAgent", "userAgent");
metadata.put("userIp", "184.82.170.183");
metadata.put("language", "pt-BR");
metadata.put("timezoneOffset", 3);
metadata.put("extraData", "extraData");
data.put("metadata", metadata);

MerchantPurchase merchantPurchase = MerchantPurchase.create(new MerchantPurchase(data));

System.out.println(merchantPurchase);
        

Ruby

require 'starkbank'

metadata = {
    "extra_data": "extraData",
    "language": "pt-BR",
    "timezone_off_set": 3,
    "user_agent": "userAgent",
    "user_ip": "255.255.255.255"
}

response = StarkBank::MerchantPurchase.create(
    StarkBank::MerchantPurchase.new(
        amount: 10000,
        installment_count: 5,
        holder_email: "tywin.lannister@gmail.com",
        holder_phone: "11985923451",
        funding_type: "credit",
        billing_country_code: "BRA",
        billing_city: "Sao Paulo",
        billing_state_code: "SP",
        billing_street_line1: "Rua Casterly Rock, 2000",
        billing_street_line2: "1 andar",
        billing_zip_code: "01450-000",
        metadata: metadata,
        card_id: "6227768756928512"
    )
)

puts response
        

Elixir

purchase = StarkBank.MerchantPurchase.create!([
    %StarkBank.MerchantPurchase{
        amount: 10000,
        installment_count: 5,
        holder_email: "tywin.lannister@gmail.com",
        holder_phone: "11985923451",
        funding_type: "credit",
        billing_country_code: "BRA",
        billing_city: "Sao Paulo",
        billing_state_code: "SP",
        billing_street_line_1: "Rua Casterly Rock, 2000",
        billing_street_line_2: "1 andar",
        billing_zip_code: "01450-000",
        metadata: %{
            userAgent: "userAgent",
            userIp: "184.82.170.183",
            language: "pt-BR",
            timezoneOffset: 3,
            extraData: "extraData"
        },
        card_id: "5920400605184000"
    }
]) |> IO.inspect()

        

C#

using StarkBank;
using StarkBank.MerchantPurchase;
using System;
using System.Collections.Generic;

Dictionary<string, object> metadata = new Dictionary<string, object>
{
    { "userAgent", "userAgent" },
    { "userIp", "184.82.170.183" },
    { "language", "pt-BR" },
    { "timezoneOffset", 3 },
    { "extraData", "extraData" }
};

MerchantPurchase merchantPurchase = MerchantPurchase.Create(
    new MerchantPurchase(
        amount: 10000,
        installmentCount: 5,
        holderEmail: "tywin.lannister@gmail.com",
        holderPhone: "11985923451",
        fundingType: "credit",
        billingCountryCode: "BRA",
        billingCity: "Sao Paulo",
        billingStateCode: "SP",
        billingStreetLine1: "Rua Casterly Rock, 2000",
        billingStreetLine2: "1 andar",
        billingZipCode: "01450-000",
        metadata: metadata,
        cardId: "6549906873384960"
    )
);

Console.WriteLine(merchantPurchase);

        

Go

package main

import (
    "fmt"
    "github.com/starkbank/sdk-go/starkbank"
    MerchantPurchase "github.com/starkbank/sdk-go/starkbank/merchantpurchase"
)

func main() {
    merchantPurchase := MerchantPurchase.MerchantPurchase{
        Amount:            10000,
        InstallmentCount:  5,
        HolderEmail:       "tywin.lannister@gmail.com",
        HolderPhone:       "11985923451",
        FundingType:       "credit",
        BillingCountryCode: "BRA",
        BillingCity:       "Sao Paulo",
        BillingStateCode:  "SP",
        BillingStreetLine1: "Rua Casterly Rock, 2000",
        BillingStreetLine2: "1 andar",
        BillingZipCode:    "01450-000",
        Metadata: map[string]interface{}{
            "userAgent":      "userAgent",
            "userIp":         "184.82.170.183",
            "language":       "pt-BR",
            "timezoneOffset": 3,
            "extraData":      "extraData",
        },
        CardId: "5920400605184000"
    }

    createdPurchase, err := MerchantPurchase.Create(merchantPurchase, nil)

    if err.Errors != nil {
        for _, e := range err.Errors {
            fmt.Printf("code: %s, message: %s", e.Code, e.Message)
        }
    }

    fmt.Println(createdPurchase)
}
        

Clojure

(defn create-purchase []
(let [metadata {:userAgent "userAgent"
                :userIp "184.82.170.183"
                :language "pt-BR"
                :timezoneOffset 3
                :extraData "extraData"}
        merchant-purchase (merchant-purchase/create {:amount 10000
                                                    :installment_count 5
                                                    :holder-email "tywin.lannister@gmail.com"
                                                    :holder-phone "11985923451"
                                                    :funding-type "credit"
                                                    :billing-country-code "BRA"
                                                    :billing-city "Sao Paulo"
                                                    :billing-state-code "SP"
                                                    :billing-street-line-1 "Rua Casterly Rock, 2000"
                                                    :billing-street-line-2 "1 andar"
                                                    :billing-zip-code "01450-000"
                                                    :metadata metadata
                                                    :card-id "5920400605184000"})]
    (println merchant-purchase)))

(create-purchase)
        

Curl

curl --location --request POST '{{baseUrl}}/v2/merchant-purchase' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}' 
--header 'Content-Type: application/json' 
--data-raw '{
    "amount": 10000,
    "installmentCount": 5,
    "cardId": "5920400605184000",
    "fundingType": "credit",
    "challengeMode": "disabled",
    "billingCity": "Sao Paulo",
    "billingCountryCode": "BRA",
    "billingStateCode": "SP",
    "billingStreetLine1": "Rua Casterly Rock, 2000",
    "billingStreetLine2": "1 andar",
    "billingZipCode": "01450-000",
    "holderEmail": "tywin.lannister@gmail.com",
    "holderPhone": "11985923451",
    "metadata": {
        "userAgent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36",
        "userIp": "184.82.170.183",
        "language": "pt-BR"
    }
}'
    
RESPONSE

Python

MerchantPurchase(
    amount=10000,
    billing_city=Sao Paulo,
    billing_country_code=BRA,
    billing_state_code=SP,
    billing_street_line_1=Rua Casterly Rock, 2000,
    billing_street_line_2=1 andar,
    billing_zip_code=01450-000,
    card_ending=0007,
    card_id=6295415968235520,
    challenge_mode=enabled,
    challenge_url=https://sandbox.api.starkinfra.com/v2/acquiring-purchase/5700835795271680/challenge,
    created=2025-02-20 20:47:43.237974,
    currency_code=BRL,
    end_to_end_id=1087c2ba-6a07-4108-82f7-14156032af48,
    fee=0,
    funding_type=credit,
    holder_email=tywin.lannister@gmail.com,
    holder_name=Tywin Lannister,
    holder_phone=11985923451,
    id=5136275203948544,
    installment_count=5,
    metadata={
        'extraData': 'extraData',
        'language': 'pt-BR',
        'screenHeight': 500
        'screenWidth': 500,
        'timezoneOffset': 3,
        'userAgent': 'userAgent',
        'userIp': '184.82.170.183'
    },
    network=mastercard,
    source=merchant-card/6295415968235520,
    status=pending,
    tags=[],
    updated=2025-02-20 20:47:45.176881
)
      

Javascript

MerchantPurchase {
    amount: 10000,
    billingCity: "Sao Paulo",
    billingCountryCode: "BRA",
    billingStateCode: "SP",
    billingStreetLine1: "Rua Casterly Rock, 2000",
    billingStreetLine2: "1 andar",
    billingZipCode: "01450-000",
    cardEnding: "9733",
    cardId: "5920400605184000",
    challengeMode: "disabled",
    challengeUrl: "https://development.api.starkinfra.com/v2/acquiring-purchase/5752622027898880/challenge",
    created: "2025-01-30T18:39:52.136626+00:00",
    currencyCode: "BRL",
    endToEndId: "00372f52-52c8-4907-b03b-3946cacae4e3",
    fee: 0,
    fundingType: "credit",
    holderEmail: "tywin.lannister@gmail.com",
    holderName: "Tywin Lannister",
    holderPhone: "11985923451",
    id: "5693253768708096",
    installmentCount: 5,
    metadata: {
        "userAgent": "userAgent",
        "userIp": "184.82.170.183",
        "language": "pt-BR",
        "timezoneOffset": 3,
        "extraData": "extraData"
    },
    network: "mastercard",
    source: "merchant-card/5674419263373312",
    status: "pending",
    tags: ["purchase_1234"],
    updated: "2025-01-30T18:39:54.029416+00:00"
}
        

PHP

StarkBank\MerchantPurchase Object
(
    [id] => 5693253768708096
    [amount] => 10000
    [billingCity] => Sao Paulo
    [billingCountryCode] => BRA
    [billingStateCode] => SP
    [billingStreetLine1] => Rua Casterly Rock, 2000
    [billingStreetLine2] => 1 andar
    [billingZipCode] => 01450-000
    [cardEnding] => 9733
    [cardId] => 5920400605184000
    [challengeMode] => disabled
    [challengeUrl] => https://development.api.starkinfra.com/v2/acquiring-purchase/5752622027898880/challenge
    [created] => DateTime Object
        (
            [date] => 2025-01-30 18:39:52.136626
            [timezone_type] => 1
            [timezone] => +00:00
        )
    [currencyCode] => BRL
    [endToEndId] => 00372f52-52c8-4907-b03b-3946cacae4e3
    [fee] => 0
    [fundingType] => credit
    [holderEmail] => tywin.lannister@gmail.com
    [holderName] => Tywin Lannister
    [holderPhone] => 11985923451
    [installmentCount] => 5
    [metadata] => Array
        (
            [language] => pt-BR
            [userAgent] => userAgent
            [timezoneOffset] => 3
            [extraData] => extraData
            [userIp] => 184.82.170.183
        )
    [network] => mastercard
    [source] => merchant-purchase/5674419263373312
    [status] => pending
    [tags] => Array
        (
            [0] => purchase_1234
        )
    [updated] => DateTime Object
        (
            [date] => 2025-01-30 18:39:54.029416
            [timezone_type] => 1
            [timezone] => +00:00
        )
)

        

Java

MerchantPurchase({
    "amount": 10000,
    "billingCity": "Sao Paulo",
    "billingCountryCode": "BRA",
    "billingStateCode": "SP",
    "billingStreetLine1": "Rua Casterly Rock, 2000",
    "billingStreetLine2": "1 andar",
    "billingZipCode": "01450-000",
    "cardEnding": "9733",
    "cardId": "5920400605184000",
    "challengeMode": "disabled",
    "challengeUrl": "https://development.api.starkinfra.com/v2/acquiring-purchase/5752622027898880/challenge",
    "created": "2025-01-30T18:39:52.136626+00:00",
    "currencyCode": "BRL",
    "endToEndId": "00372f52-52c8-4907-b03b-3946cacae4e3",
    "fee": 0,
    "fundingType": "credit",
    "holderEmail": "tywin.lannister@gmail.com",
    "holderName": "Tywin Lannister",
    "holderPhone": "11985923451",
    "id": "5693253768708096",
    "installmentCount": 5,
    "metadata": {
        "language": "pt-BR",
        "timezoneOffset": 3,
        "userAgent": "userAgent",
        "userIp": "184.82.170.183",
        "screenHeight": 500,
        "screenWidth": 500.0,
        "extraData": "extraData"
    },
    "network": "mastercard",
    "source": "merchant-card/5674419263373312",
    "status": "pending",
    "tags": [
    ],
    "updated": "2025-01-30T18:39:54.029416+00:00"
})
  

Ruby

merchantpurchase(
    id: 5099195274887168,
    amount: 5000,
    holder_name: Rhaenyra Targaryen,
    funding_type: credit,
    holder_email: rhaenyra.targaryen@gmail.com,
    holder_phone: 11985923451,
    installment_count: 1,
    billing_country_code: BRA,
    billing_city: Sao Paulo,
    billing_state_code: SP,
    billing_street_line_1: Rua Casterly Rock, 2000,
    billing_street_line_2: 1 andar,
    billing_zip_code: 01450-000,
    metadata: {
        "extradata"=>"extraData",
        "language"=>"pt-BR",
        "timezoneoffset"=>3,
        "useragent"=>"Mozilla",
        "userip"=>"255.255.255.255"
    },
    card_ending: 9733,
    card_id: ,
    challenge_mode: disabled,
    challenge_url: ,
    created: 2025-02-20T22:31:13+00:00,
    currency_code: BRL,
    end_to_end_id: 6ba82bc4-8ca3-4613-a38e-575a25984e26,
    fee: 0,
    network: mastercard,
    source: merchant-card/4992147199623168,
    status: denied,
    tags: ["session_123"],
    updated: 2025-02-20T22:31:14+00:00
)
        

Elixir

%StarkBank.MerchantPurchase{
    amount: 10000,
    billing_city: "Sao Paulo",
    billing_country_code: "BRA",
    billing_state_code: "SP",
    billing_street_line_1: "Rua Casterly Rock, 2000",
    billing_street_line_2: "1 andar",
    billing_zip_code: "01450-000",
    card_ending: "9733",
    card_id: "5920400605184000",
    challenge_mode: "disabled",
    challenge_url: "https://development.api.starkinfra.com/v2/acquiring-purchase/5752622027898880/challenge",
    created: ~U[2025-01-30 18:39:52.136626Z],
    currency_code: "BRL",
    end_to_end_id: "00372f52-52c8-4907-b03b-3946cacae4e3",
    fee: 0,
    funding_type: "credit",
    holder_email: "tywin.lannister@gmail.com",
    holder_name: "Tywin Lannister",
    holder_phone: "11985923451",
    id: "5693253768708096",
    installment_count: 1,
    metadata: %{
        language: "pt-BR",
        timezoneOffset: 3,
        userAgent: "userAgent",
        userIp: "184.82.170.183",
        extraData: 'extraData'
    },
    network: "mastercard",
    source: "merchant-card/5674419263373312",
    status: "pending",
    tags: ["purchase_1234"],
    updated: ~U[2025-01-30 18:39:54.029416Z]
}
        

C#

MerchantPurchase(
    Amount: 10000,
    FundingType: credit,
    CardId: 6549906873384960,
    InstallmentCount: 5,
    HolderEmail: tywin.lannister@gmail.com,
    HolderPhone: 11985923451,
    BillingCountryCode: BRA,
    BillingCity: Sao Paulo,
    BillingStateCode: SP,
    BillingStreetLine1: Rua Casterly Rock, 2000,
    BillingStreetLine2: 1 andar,
    BillingZipCode: 01450-000,
    ChallengeMode: enabled,
    Metadata: {
        { "userAgent", "userAgent" },
        { "userIp", "184.82.170.183" },
        { "language", "pt-BR" },
        { "timezoneOffset", 3 },
        { "extraData", "extraData" }
    },
    ID: "4544609996767232",
    BillingStreetLine2: "",
    ChallengeUrl: "",
    Created: "2025-02-21T02:54:37.177501+00:00",
    CurrencyCode: "BRL",
    EndToEndId: "e35d6174-af66-47fa-9606-44977065e4e7",
    Fee: 0,
    HolderName: "Marasi Colms",
    Network: "hipercard",
    Source: "merchant-card/6549906873384960",
    Status: "paid",
    Tags: [],
    Updated: "01/30/2025 18:39:54",
)
        

Go

{
    Id: "5693253768708096",
    Amount: 10000,
    BillingCity: "Sao Paulo",
    BillingCountryCode: "BRA",
    BillingStateCode: "SP",
    BillingStreetLine1: "Rua Casterly Rock, 2000",
    BillingStreetLine2: "1 andar",
    BillingZipCode: "01450-000",
    CardEnding: "9733",
    CardId: "5920400605184000",
    ChallengeMode: "disabled",
    ChallengeUrl: "https://development.api.starkinfra.com/v2/acquiring-purchase/5752622027898880/challenge",
    Created: "2025-01-30 18:39:52.136626 +0000 +0000",
    CurrencyCode: "BRL",
    EndToEndId: "00372f52-52c8-4907-b03b-3946cacae4e3",
    Fee: 0,
    FundingType: "credit",
    HolderEmail: "tywin.lannister@gmail.com",
    HolderName: "Tywin Lannister",
    HolderPhone: "11985923451",
    InstallmentCount: 5,
    Metadata: {
        Language: "pt-BR",
        TimezoneOffset: 3,
        UserAgent: "userAgent",
        UserIp: "184.82.170.183",
        ExtraData: "extraData"
    },
    Network: "mastercard",
    Source: "merchant-card/5674419263373312",
    Status: "pending",
    Tags: ["purchase_1234"],
    Updated: "2025-01-30 18:39:54.029416 +0000 +0000",
    Uuid: "63caf64913d14465b1ebe2ec09a8b1cd"
}
        

Clojure

{:id "5693253768708096",
:amount 10000,
:billing-city "Sao Paulo",
:billing-country-code "BRA",
:billing-state-code "SP",
:billing-street-line1 "Rua Casterly Rock, 2000",
:billing-street-line2 "1 andar",
:billing-zip-code "01450-000",
:card-ending "9733",
:card-id "5920400605184000",
:challenge-mode "disabled",
:challenge-url "https://development.api.starkinfra.com/v2/acquiring-purchase/5752622027898880/challenge",
:created "2025-01-30T18:39:52.136626+00:00",
:currency-code "BRL",
:end-to-end-id "00372f52-52c8-4907-b03b-3946cacae4e3",
:fee 0,
:funding-type "credit",
:holder-email "tywin.lannister@gmail.com",
:holder-name "Tywin Lannister",
:holder-phone "11985923451",
:installment-count 5,
:metadata {:language "pt-BR",
            :extra-data "extraData",
            :timezone-offset 3,
            :user-agent "userAgent",
            :user-ip "184.82.170.183"},
:network "mastercard",
:source "merchant-card/5674419263373312",
:status "pending",
:tags ["purchase_1234"],
:updated "2025-01-30T18:39:54.029416+00:00"}
        

Curl

{
    "message": "Merchant Purchase successfully created",
    "purchase": {
        "amount": 10000,
        "billingCity": "Sao Paulo",
        "billingCountryCode": "BRA",
        "billingStateCode": "SP",
        "billingStreetLine1": "Rua Casterly Rock, 2000",
        "billingStreetLine2": "1 andar",
        "billingZipCode": "01450-000",
        "cardEnding": "0005",
        "cardId": "5920400605184000",
        "challengeMode": "disabled",
        "challengeUrl": "",
        "created": "2024-09-06T16:58:26.270136+00:00",
        "currencyCode": "BRL",
        "endToEndId": "87ecab02-9b84-4c59-a923-df1dcf2cb01f",
        "fee": 0,
        "fundingType": "credit",
        "holderEmail": "tywin.lannister@gmail.com",
        "holderName": "Tywin Lannister",
        "holderPhone": "11985923451",
        "id": "5898767995764736",
        "installmentCount": 5,
        "metadata": {
            "language": "pt-BR",
            "userAgent": "userAgent",
            "userIp": "184.82.170.183"
            "timezoneOffset": 3,
            "extraData": "extraData"
        },
        "network": "mastercard",
        "source": "merchant-card/5920400605184000",
        "status": "approved",
        "tags": ["purchase_1234"],
        "updated": "2024-09-06T16:58:27.743409+00:00"
    }
}
    

Update a Merchant Purchase

Update a single purchase. If the purchase is currently approved, you can only update the status to canceled and set the amount to 0. This action cancels the authorization. If the purchase is currently confirmed, you can update the status to reversed and adjust the amount to a lower value. This action debits the difference and reverses the purchase, partially or totally. If the purchase is partially reversed, its status will remain confirmed. However, if the purchase is fully reversed, its status will be updated to voided.

Parameters

id REQUIRED

Id of the purchase entity.

amount OPTIONAL

New amount of the purchase. If the purchase is confirmed, this will debit and reverse the difference. If the purchase is authorized, only 0 is allowed and this will cancel the authorization. Example: 200 (R$2.00).

status OPTIONAL

This can be used to cancel or reverse the purchase by passing 'canceled' or 'reversed' as the status patch.

ENDPOINT
PATCH /v2/merchant-purchase/:id
REQUEST

Python

import starkbank

merchant_purchase = starkbank.merchantpurchase.update(id="5752391039188992", status="canceled", amount=0)

print(merchant_purchase)
        

Javascript

const starkbank = require('starkbank');

(async() => {
    let merchantPurchase = await starkbank.merchantPurchase.update(id: "5752391039188992", status: 'canceled', amount: 0);
    console.log(merchantPurchase);
})();      
        

PHP

use StarkBank\MerchantSession;

$merchantPurchase = MerchantPurchase::update("4600131349381120", "canceled", 0);

print_r($merchantPurchase);      
        

Java

import com.starkbank.*;

HashMap<String, Object> patchData = new HashMap<>();
patchData.put("amount", 0);
patchData.put("status", "canceled");

MerchantPurchase merchantPurchase = MerchantPurchase.update("5752391039188992", patchData);

System.out.println(merchantPurchase)
        

Ruby

require('starkbank')

merchant_purchase = StarkBank::MerchantPurchase.update(
    "5777750581313536",
    {
        "status": 'canceled',
        "amount": 0
    }
)

puts merchant_purchase 
        

Elixir

merchant_purchase = StarkBank.MerchantPurchase.update!(
    id: "5752391039188992",
    status: "canceled",
    amount: 0
)

merchant_purchase |> IO.inspect   
        

C#

using StarkBank;
using StarkBank.MerchantPurchase;
using System;

var merchantPurchase = MerchantPurchase.Update(
    id: "4655475626868736",
    status: "canceled",
    amount: 0
);

Console.WriteLine(merchantPurchase);    
        

Go

package main

import (
    "fmt"
    "github.com/starkbank/sdk-go/starkbank"
    MerchantPurchase "github.com/starkbank/sdk-go/starkbank/merchantpurchase"
)

func main() {

    var patchData = map[string]interface{}{}
    patchData["amount"] = 0    
    patchData["status"] = "canceled"

    merchantPurchase, err := MerchantPurchase.Update("5752391039188992", patchData, nil)

    if err.Errors != nil {
        for _, e := range err.Errors {
            fmt.Printf("code: %s, message: %s", e.Code, e.Message)
        }
    }

    fmt.Println(merchantPurchase)
}    
        

Clojure

(defn update-merchant-purchase []
(let [merchant-purchase (merchant-purchase/update {:id "5752391039188992"
                                                    :status "canceled"
                                                    :amount 0})]
    (println merchant-purchase)))      
        

Curl

curl --location --request PATCH '{{baseUrl}}/v2/merchant-purchase/4600131349381120' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}' 
--header 'Content-Type: application/json' 
--data-raw '{
    "status": "canceled",
    "amount": 0
}'
    
RESPONSE

Python

MerchantPurchase(
    amount=0,
    billing_city=,
    billing_country_code=,
    billing_state_code=,
    billing_street_line_1=,
    billing_street_line_2=,
    billing_zip_code=,
    cardId="6675871284854784",
    card_ending="0005",
    challenge_mode="disabled",
    challenge_url="",
    created="2025-01-30T18:52:55.315590+00:00",
    currency_code="BRL",
    end_to_end_id="33c022ec-2c54-46e5-b20b-eb10edfaf021",
    fee=160,
    funding_type="credit",
    holder_email=,
    holder_name=Margaery Tyrell,
    holder_phone=,
    id="5752391039188992",
    installment_count=3,
    metadata={},
    network="visa",
    source="merchant-card/6675871284854784",
    status="confirmed",
    tags=["purchase_1234"],
    updated="2025-01-30T20:44:06.470183+00:00"
)      
        

Javascript

MerchantPurchase {
    amount: 0,
    billingCountryCode: "",
    billingCity: "",
    billingStateCode: "",
    billingStreetLine1: "",
    billingStreetLine2: "",
    billingZipCode: "",
    cardEnding: "0005",
    cardId: "6675871284854784",
    challengeMode: "disabled",
    challengeUrl: "",
    created: "2025-01-30T18:52:55.315590+00:00",
    currencyCode: "BRL",
    endToEndId: "33c022ec-2c54-46e5-b20b-eb10edfaf021",
    fee: 160,
    fundingType: "credit",
    holderName: "",
    holderEmail: "",
    holderPhone: "",
    id: "5752391039188992",
    installmentCount: 3,
    metadata: {},
    network: "visa",
    source: "merchant-card/6675871284854784",
    status: "confirmed",
    tags: ["purchase_1234"],
    updated: "2025-01-30T20:44:06.470183+00:00"
}      
        

PHP

StarkBank\MerchantPurchase Object
(
    [id] => 5752391039188992
    [amount] => 0
    [billingCity] => 
    [billingCountryCode] => 
    [billingStateCode] => 
    [billingStreetLine1] => 
    [billingStreetLine2] =>
    [billingZipCode] => 
    [cardEnding] => 0005
    [cardId] => 6675871284854784
    [challengeMode] => disabled
    [challengeUrl] => 
    [created] => DateTime Object
        (
            [date] => 2025-01-30 18:52:55.315590
            [timezone_type] => 1
            [timezone] => +00:00
        )
    [currencyCode] => BRL
    [endToEndId] => 33c022ec-2c54-46e5-b20b-eb10edfaf021
    [fee] => 160
    [fundingType] => credit
    [holderEmail] =>
    [holderName] => Tywin Lannister
    [holderPhone] =>
    [installmentCount] => 3
    [metadata] => Array
        (
        )
    [network] => visa
    [source] => merchant-card/6675871284854784
    [status] => confirmed
    [tags] => Array
        (
            [0] => purchase_1234
        )
    [updated] => DateTime Object
        (
            [date] => 2025-01-30 20:44:06.470183
            [timezone_type] => 1
            [timezone] => +00:00
        )
)      
        

Java

MerchantPurchase({
    "id": "5752391039188992",
    "amount": 0,
    "billingCity": "",
    "billingCountryCode": "",
    "billingStateCode": "",
    "billingStreetLine1": "",
    "billingStreetLine2": "",
    "billingZipCode": "",
    "cardId": "6675871284854784",
    "cardEnding": "0005",
    "challengeMode": "disabled",
    "challengeUrl": "",
    "created": "2025-01-30T18:52:55.315590+00:00",
    "currencyCode": "BRL",
    "endToEndId": "33c022ec-2c54-46e5-b20b-eb10edfaf021",
    "fee": 160,
    "fundingType": "credit",
    "holderEmail": "",
    "holderName": "Tywin Lannister",
    "holderPhone": "",
    "installmentCount": 3,
    "metadata": {},
    "network": "visa",
    "source": "merchant-card/6675871284854784",
    "status": "confirmed",
    "tags": ["purchase_1234"],
    "updated": "2025-01-30T20:44:06.470183+00:00"
})      
        

Ruby

merchantpurchase(
    id: 5099195274887168,
    amount: 5000,
    holder_name: Rhaenyra Targaryen,
    funding_type: credit,
    holder_email: ,
    holder_phone: ,
    installment_count: 1,
    billing_country_code: ,
    billing_city: ,
    billing_state_code: ,
    billing_street_line_1: ,
    billing_street_line_2: ,
    billing_zip_code: ,
    metadata: {
        "extradata"=>"extraData",
        "language"=>"pt-BR",
        "timezoneoffset"=>3,
        "useragent"=>"Mozilla",
        "userip"=>"255.255.255.255"
    },
    card_ending: 9733,
    card_id: ,
    challenge_mode: disabled,
    challenge_url: ,
    created: 2025-02-20T22:31:13+00:00,
    currency_code: BRL,
    end_to_end_id: 6ba82bc4-8ca3-4613-a38e-575a25984e26,
    fee: 0,
    network: mastercard,
    source: merchant-session/4992147199623168,
    status: denied,
    tags: ["session_123"],
    updated: 2025-02-20T22:31:14+00:00
)
        

Elixir

%StarkBank.MerchantPurchase{
    id: "5752391039188992",
    amount: 0,
    billing_city: "",
    billing_country_code: "",
    billing_state_code: "",
    billing_street_line_1: "",
    billing_street_line_2: "",
    billing_zip_code: "",
    card_id: "6675871284854784",
    card_ending: "0005",
    challenge_mode: "disabled",
    challenge_url: "",
    created: ~U[2025-01-30 18:52:55.315590Z],
    currency_code: "BRL",
    end_to_end_id: "33c022ec-2c54-46e5-b20b-eb10edfaf021",
    fee: 160,
    funding_type: "credit",
    holder_email: "",
    holder_name: "Tywin Lannister",
    holder_phone: "",
    installment_count: 3,
    metadata: %{},
    network: "visa",
    source: "merchant-card/6675871284854784",
    status: "confirmed",
    tags: ["purchase_1234"],
    updated: ~U[2025-01-30 20:44:06.470183Z]
}      
        

C#


MerchantPurchase(
    Amount: 0,
    FundingType: credit,
    CardId: 6199595021369344,
    InstallmentCount: 12,
    HolderEmail:,
    HolderPhone:,
    BillingCountryCode:,
    BillingCity:,
    BillingStateCode:,
    BillingStreetLine1:,
    BillingStreetLine2:,
    BillingZipCode:,
    ChallengeMode: disabled,
    Metadata: {},
    ID: "4655475626868736",
    BillingStreetLine2: "",
    ChallengeUrl: "",
    Created: "2025-02-21T02:54:37.177501+00:00",
    CurrencyCode: "BRL",
    EndToEndId: "e35d6174-af66-47fa-9606-44977065e4e7",
    Fee: 0,
    HolderName: "Marasi Colms",
    Network: "hipercard",
    Source: "merchant-card/6549906873384960",
    Status: "approved",
    Tags: [],
    Updated: "01/30/2025 18:39:54",
)     
        

Go

{
    Id: "5752391039188992",
    Amount: 0,
    BillingCity: "",
    BillingCountryCode: "",
    BillingStateCode: "",
    BillingStreetLine1: "",
    BillingStreetLine2: "",
    BillingZipCode: "",
    CardEnding: "0005",
    CardId: "6675871284854784",
    ChallengeMode: "disabled",
    ChallengeUrl: "",
    Created: "2025-01-30 18:52:55.315590 +0000 +0000",
    CurrencyCode: "BRL",
    EndToEndId: "33c022ec-2c54-46e5-b20b-eb10edfaf021",
    Fee: 160,
    FundingType: "credit",
    HolderEmail: "",
    HolderName: "Rlain Listener",
    HolderPhone: "",
    InstallmentCount: 3,
    Metadata: {},
    Network: "visa",
    Source: "merchant-card/6675871284854784",
    Status: "confirmed",
    Tags: ["purchase_1234"],
    Updated: "2025-01-30 20:44:06.470183 +0000 +0000"
}      
        

Clojure

{
    :id "5752391039188992",
    :amount 0,
    :billing-city "",
    :billing-country-code "",
    :billing-state-code "",
    :billing-street-line-1 "",
    :billing-street-line-2 "",
    :billing-zip-code "",
    :card-ending "0005",
    :card-id "6675871284854784",
    :challenge-mode "disabled",
    :challenge-url "",
    :created "2025-01-30T18:52:55.315590+00:00",
    :currency-code "BRL",
    :end-to-end-id "33c022ec-2c54-46e5-b20b-eb10edfaf021",
    :fee 160,
    :funding-type "credit",
    :holder-email "",
    :holder-name "Rlain Listener",
    :holder-phone "",
    :installment-count 3,
    :metadata {},
    :network "visa",
    :source "merchant-card/6675871284854784",
    :status "confirmed",
    :tags ["purchase_1234"],
    :updated "2025-01-30T20:44:06.470183+00:00"
}
        

Curl

{
    "message": "Merchant Purchase successfully patched",
    "purchase": {
        "amount": 5000,
        "billingCity": "",
        "billingCountryCode": "",
        "billingStateCode": "",
        "billingStreetLine1": "",
        "billingStreetLine2": "",
        "billingZipCode": "",
        "cardEnding": "0005",
        "cardId": "6675871284854784",
        "challengeMode": "disabled",
        "challengeUrl": "",
        "created": "2024-09-06T16:58:26.270136+00:00",
        "currencyCode": "BRL",
        "endToEndId": "87ecab02-9b84-4c59-a923-df1dcf2cb01f",
        "fee": 0,
        "fundingType": "credit",
        "holderEmail": "",
        "holderName": "Rlain Listener",
        "holderPhone": "",
        "id": "5898767995764736",
        "installmentCount": 3,
        "metadata": {},
        "network": "mastercard",
        "source": "merchant-card/6675871284854784",
        "status": "confirmed",
        "tags": ["purchase_1234"],
        "updated": "2024-09-06T16:58:27.743409+00:00"
    }
}
    

List Merchant Purchases

Get a list of merchant purchases in chunks of at most 100. If you need smaller chunks, use the limit parameter.

Parameters

after OPTIONAL

Filter entities created after this date.

before OPTIONAL

Filter entities created before this date.

cursor OPTIONAL

String used to get the next batch of results. Our SDKs handle this for you.

fields OPTIONAL

List of strings to filter response JSON keys. Not available in the SDKs.

ids OPTIONAL

List of strings to get specific entities by ids.

limit OPTIONAL

Number of results per cursor. Max = 100.

status OPTIONAL

Filter purchases by the specified status, such as: created, approved, denied, confirmed, paid, pending, canceled, voided, failed.

tags OPTIONAL

Filter entities that contain the specified tags.

ENDPOINT
GET /v2/merchant-purchase
REQUEST

Python

import starkbank

merchantpurchases = starkbank.merchantpurchase.query(limit=1, tags=["order/123"], status="approved")

for merchantpurchase in merchantpurchases:
    print(merchantpurchase)
        

Javascript

const starkbank = require('starkbank');

(async() => {
    let merchantPurchases = await starkbank.merchantPurchase.query({limit: 3, tags: ["order/123"], status: "approved"});

    for await (let merchantPurchase of merchantPurchases){
        console.log(merchantPurchase);
    }
})();
    

PHP

use StarkBank\MerchantPurchase;

$merchantPurchases = MerchantPurchase::query(["limit" => 1, "tags" => ["order/123"], "status" => "approved"]);

foreach($merchantPurchases as $merchantPurchase){
    print_r($merchantPurchase);
}           
        

Java

import com.starkbank.*;
import com.starkbank.utils.Generator;
import java.util.HashMap;


HashMap<String, Object> params = new HashMap<>();
params.put("limit", 1);
params.put("tags", new String[]{"order/123"});
params.put("status", "approved");
Generator<MerchantPurchase> merchantPurchases = MerchantPurchase.query(params);

for (MerchantPurchase merchantPurchase : merchantPurchases) {
    System.out.println(merchantPurchase);
}        
        

Ruby

require 'starkbank'

merchantPurchases = StarkBank::MerchantPurchase.query(limit: 1, tags: ["order/123"], status: "approved")

merchantPurchases.each do |merchantPurchase|
    puts merchantPurchase
end           
        

Elixir

merchantPurchases = StarkBank.MerchantPurchase.query!(limit: 1, tags: ["order/123"], status: "approved")

for merchantPurchase <- merchantPurchases do
    merchantPurchase |> IO.inspect
end         
        

C#

using System;
using StarkBank;

List<MerchantPurchase> merchantPurchases = MerchantPurchase.Query(limit: 1, tags: new List<string> {"order/123"}, status: "approved").ToList();

foreach (MerchantPurchase merchantPurchase in merchantPurchases)
{
    Console.WriteLine(merchantPurchase);
}        
        

Go

package main

import (
    "fmt"
    MerchantPurchase "github.com/starkbank/sdk-go/starkbank/merchantpurchase"
)

func main() {

    var params = map[string]interface{}{}
    params["limit"] = 1
    params["tags"] = []string{"order/123"}
    params["status"] = "approved"

    merchantpurchases, errorChannel := MerchantPurchase.Query(params, nil)

    loop:
    for {
        select {
        case err := <-errorChannel:
            if err.Errors != nil {
                for _, e := range err.Errors {
                    fmt.Printf("code: %s, message: %s", e.Code, e.Message)
                }
            }
        case merchantpurchase, ok := <-merchantpurchases:
            if !ok {
                break loop
            }
            fmt.Printf("%+v", merchantpurchase)
        }
    }
}            
        

Clojure

(def merchant-purchases
  (starkbank.merchant-purchase/query
    {
      :limit 1
      :tags ["order/123"]
      :status "approved"
    }))
(dorun (map println merchant-purchases))         
        

Curl

curl --location --request GET '{{baseUrl}}/v2/merchant-purchase?limit=1&tags=order%2F123&status=approved' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}' 
--header 'Content-Type: application/json' 
    
RESPONSE

Python

MerchantPurchase(
    amount=10000,
    billing_city=Sao Paulo,
    billing_country_code=BRA,
    billing_state_code=SP,
    billing_street_line_1=Rua Casterly Rock, 2000,
    billing_street_line_2=1 andar,
    billing_zip_code=01450-000,
    card_ending=0007,
    id=6295415968235520,
    challenge_mode=enabled,
    challenge_url=,
    created=2025-02-20 20:47:43.237974,
    currency_code=BRL,
    end_to_end_id=1087c2ba-6a07-4108-82f7-14156032af48,
    fee=0,
    funding_type=credit,
    holder_email=tywin.lannister@gmail.com,
    holder_name=Margaery Tyrell,
    holder_phone=11985923451,
    id=5136275203948544,
    installment_count=5,
    metadata={
        'extraData': 'extraData',
        'language': 'pt-BR',
        'screenHeight': 500,
        'screenWidth': 500,
        'timezoneOffset': 3,
        'userAgent': 'userAgent',
        'userIp': '184.82.170.183'
    },
    network=mastercard,
    source=merchant-card/6295415968235520,
    status=pending,
    tags=[],
    updated=2025-02-20 20:47:46.491252
)
    

Javascript

MerchantPurchase {
    id: '5476090868924416',
    amount: 180,
    installmentCount: 12,
    holderName: 'Holder Name',
    holderEmail: 'holdeName@email.com',
    holderPhone: '11111111111',
    fundingType: 'credit',
    billingCountryCode: 'BRA',
    billingCity: 'São Paulo',
    billingStateCode: 'SP',
    billingStreetLine1: 'Rua do Holder Name, 123',
    billingStreetLine2: '',
    billingZipCode: '01450-000',
    cardEnding: '9733',
    cardId: '',
    challengeMode: 'disabled',
    challengeUrl: '',
    created: '2024-07-15T23:10:03.306115+00:00',
    currencyCode: 'BRL',
    endToEndId: '1af93a6e-3376-4555-a5b4-b3b81fb42474',
    fee: 0,
    network: 'mastercard',
    source: 'merchant-session/6238344014987264',
    status: 'denied',
    tags: ['yourtags'],
    updated: '2024-07-15T23:10:05.635255+00:00'
}
    

PHP

StarkBank\MerchantPurchase Object
(
    [id] => 5693253768708096
    [amount] => 5000
    [billingCity] => Sao Paulo
    [billingCountryCode] => BRA
    [billingStateCode] => SP
    [billingStreetLine1] => Rua Casterly Rock, 2000
    [billingStreetLine2] => 
    [billingZipCode] => 01450-000
    [cardEnding] => 9733
    [cardId] => 5920400605184000
    [challengeMode] => enabled
    [challengeUrl] => https://development.api.starkinfra.com/v2/acquiring-purchase/5752622027898880/challenge
    [created] => DateTime Object
        (
            [date] => 2025-01-30 18:39:52.136626
            [timezone_type] => 1
            [timezone] => +00:00
        )
    [currencyCode] => BRL
    [endToEndId] => 00372f52-52c8-4907-b03b-3946cacae4e3
    [fee] => 0
    [fundingType] => debit
    [holderEmail] => tywin.lannister@gmail.com
    [holderName] => Tywin Lannister
    [holderPhone] => 11999999999
    [installmentCount] => 1
    [metadata] => Array
        (
            [language] => pt-BR
            [screenHeight] => 500
            [screenWidth] => 500
            [timezoneOffset] => 3
            [userAgent] => Mozilla
            [userIp] => 111.111.111.111
        )
    [network] => mastercard
    [source] => merchant-session/5674419263373312
    [status] => pending
    [tags] => Array
        (
            [0] => purchase_1234
        )
    [updated] => DateTime Object
        (
            [date] => 2025-01-30 18:39:54.029416
            [timezone_type] => 1
            [timezone] => +00:00
        )
)      
        

Java

MerchantPurchase({
    "amount": 5000,
    "billingCity": "Sao Paulo",
    "billingCountryCode": "BRA",
    "billingStateCode": "SP",
    "billingStreetLine1": "Rua Casterly Rock, 2000",
    "billingStreetLine2": "",
    "billingZipCode": "01450-000",
    "cardEnding": "9733",
    "cardId": "5920400605184000",
    "challengeMode": "enabled",
    "challengeUrl": "https://development.api.starkinfra.com/v2/acquiring-purchase/5752622027898880/challenge",
    "created": "2025-01-30T18:39:52.136626+00:00",
    "currencyCode": "BRL",
    "endToEndId": "00372f52-52c8-4907-b03b-3946cacae4e3",
    "fee": 0,
    "fundingType": "debit",
    "holderEmail": "tywin.lannister@gmail.com",
    "holderName": "Tywin Lannister",
    "holderPhone": "11999999999",
    "id": "5693253768708096",
    "installmentCount": 1,
    "metadata": {
        "language": "pt-BR",
        "screenHeight": 500,
        "screenWidth": 500,
        "timezoneOffset": 3,
        "userAgent": "Mozilla",
        "userIp": "111.111.111.111"
    },
    "network": "mastercard",
    "source": "merchant-session/5674419263373312",
    "status": "pending",
    "tags": [
        "purchase_1234"
    ],
    "updated": "2025-01-30T18:39:54.029416+00:00"
})      
  

Ruby

merchantpurchase(
    id: 5099195274887168,
    amount: 5000,
    holder_name: Rhaenyra Targaryen,
    funding_type: credit,
    holder_email: rhaenyra.targaryen@gmail.com,
    holder_phone: 11985923451,
    installment_count: 1,
    billing_country_code: BRA,
    billing_city: Sao Paulo,
    billing_state_code: SP,
    billing_street_line_1: Rua Casterly Rock, 2000,
    billing_street_line_2: 1 andar,
    billing_zip_code: 01450-000,
    metadata: {
        "extradata"=>"extraData",
        "language"=>"pt-BR",
        "timezoneoffset"=>3,
        "useragent"=>"Mozilla",
        "userip"=>"255.255.255.255"
    },
    card_ending: 9733,
    card_id: ,
    challenge_mode: disabled,
    challenge_url: ,
    created: 2025-02-20T22:31:13+00:00,
    currency_code: BRL,
    end_to_end_id: 6ba82bc4-8ca3-4613-a38e-575a25984e26,
    fee: 0,
    network: mastercard,
    source: merchant-session/4992147199623168,
    status: denied,
    tags: ["session_123"],
    updated: 2025-02-20T22:31:14+00:00
)
        

Elixir

%StarkBank.MerchantPurchase{
    amount: 5000,
    billing_city: "Sao Paulo",
    billing_country_code: "BRA",
    billing_state_code: "SP",
    billing_street_line_1: "Rua Casterly Rock, 2000",
    billing_street_line_2: "",
    billing_zip_code: "01450-000",
    card_ending: "9733",
    card_id: "5920400605184000",
    challenge_mode: "enabled",
    challenge_url: "https://development.api.starkinfra.com/v2/acquiring-purchase/5752622027898880/challenge",
    created: ~U[2025-01-30 18:39:52.136626Z],
    currency_code: "BRL",
    end_to_end_id: "00372f52-52c8-4907-b03b-3946cacae4e3",
    fee: 0,
    funding_type: "debit",
    holder_email: "tywin.lannister@gmail.com",
    holder_name: "Tywin Lannister",
    holder_phone: "11999999999",
    id: "5693253768708096",
    installment_count: 1,
    metadata: %{
        language: "pt-BR",
        screenHeight: 500,
        screenWidth: 500,
        timezoneOffset: 3,
        userAgent: "Mozilla",
        userIp: "111.111.111.111"
    },
    network: "mastercard",
    source: "merchant-session/5674419263373312",
    status: "pending",
    tags: ["purchase_1234"],
    updated: ~U[2025-01-30 18:39:54.029416Z]
}
        

C#

MerchantPurchase(
    Amount: 180,
    FundingType: credit,
    CardId: ,
    InstallmentCount: 12,
    HolderEmail: holdeName@email.com,
    HolderPhone: 11111111111,
    BillingCountryCode: BRA,
    BillingCity: São Paulo,
    BillingStateCode: SP,
    BillingStreetLine1: Rua do Holder Name, 123,
    BillingStreetLine2: casa,
    BillingZipCode: 11111-111,
    ChallengeMode: enabled,
    Metadata: {},
    ID: "6351618970746880",
    BillingStreetLine2: "",
    ChallengeUrl: "",
    Created: "2025-02-21T02:54:37.177501+00:00",
    CurrencyCode: "BRL",
    EndToEndId: "e35d6174-af66-47fa-9606-44977065e4e7",
    Fee: 0,
    HolderName: "Marasi Colms",
    Network: "hipercard",
    Source: "merchant-card/6549906873384960",
    Status: "paid",
    Tags: [],
    Updated: "01/30/2025 18:39:54",
)
        

Go

{
    Id: "5693253768708096",
    Amount: 5000,
    BillingCity: "Sao Paulo",
    BillingCountryCode: "BRA",
    BillingStateCode: "SP",
    BillingStreetLine1: "Rua Casterly Rock, 2000",
    BillingStreetLine2: "",
    BillingZipCode: "01450-000",
    CardEnding: "9733",
    CardId: "5920400605184000",
    ChallengeMode: "enabled",
    ChallengeUrl: "https://development.api.starkinfra.com/v2/acquiring-purchase/5752622027898880/challenge",
    Created: "2025-01-30 18:39:52.136626 +0000 +0000",
    CurrencyCode: "BRL",
    EndToEndId: "00372f52-52c8-4907-b03b-3946cacae4e3",
    Fee: 0,
    FundingType: "debit",
    HolderEmail: "tywin.lannister@gmail.com",
    HolderName: "Tywin Lannister",
    HolderPhone: "11999999999",
    InstallmentCount: 1,
    Metadata: {
        Language: "pt-BR",
        ScreenHeight: 500,
        ScreenWidth: 500,
        TimezoneOffset: 3,
        UserAgent: "Mozilla",
        UserIp: "111.111.111.111"
    },
    Network: "mastercard",
    Source: "merchant-session/5674419263373312",
    Status: "pending",
    Tags: ["purchase_1234"],
    Updated: "2025-01-30 18:39:54.029416 +0000 +0000",
    Uuid: "63caf64913d14465b1ebe2ec09a8b1cd"
}      
        

Clojure

{:id "5693253768708096",
:amount 5000,
:billing-city "Sao Paulo",
:billing-country-code "BRA",
:billing-state-code "SP",
:billing-street-line-1 "Rua Casterly Rock, 2000",
:billing-street-line-2 "",
:billing-zip-code "01450-000",
:card-ending "9733",
:card-id "5920400605184000",
:challenge-mode "enabled",
:challenge-url "https://development.api.starkinfra.com/v2/acquiring-purchase/5752622027898880/challenge",
:created "2025-01-30T18:39:52.136626+00:00",
:currency-code "BRL",
:end-to-end-id "00372f52-52c8-4907-b03b-3946cacae4e3",
:fee 0,
:funding-type "debit",
:holder-email "tywin.lannister@gmail.com",
:holder-name "Tywin Lannister",
:holder-phone "11999999999",
:installment-count 1,
:metadata {:language "pt-BR",
            :screen-height 500,
            :screen-width 500,
            :timezone-offset 3,
            :user-agent "Mozilla",
            :user-ip "111.111.111.111"},
:network "mastercard",
:source "merchant-session/5674419263373312",
:status "pending",
:tags ["purchase_1234"],
:updated "2025-01-30T18:39:54.029416+00:00"}      
        

Curl

{
    "cursor": "ClcKFAoHY3JlYXRlZBIJCKDD2tebqYcDEjtqGml-YXBpLW1zLWNhcmQtbWVyY2hhbnQtc2J4ch0LEhBNZXJjaGFudFB1cmNoYXNlGICAgNil4boIDBgAIAE=",
    "purchases": [
        {
            "amount": 180,
            "billingCity": "São Paulo",
            "billingCountryCode": "BRA",
            "billingStateCode": "SP",
            "billingStreetLine1": "Rua do Holder Name, 123",
            "billingStreetLine2": "",
            "billingZipCode": "01450-000",
            "cardEnding": "9733",
            "cardId": "",
            "challengeMode": "disabled",
            "challengeUrl": "",
            "created": "2024-07-16T15:26:41.391876+00:00",
            "currencyCode": "BRL",
            "endToEndId": "53e0246b-be7a-4de3-9e99-793f80b8cb89",
            "fee": 0,
            "fundingType": "credit",
            "holderEmail": "holdeName@email.com",
            "holderName": "Holder Name",
            "holderPhone": "11111111111",
            "id": "6066273465139200",
            "installmentCount": 12,
            "metadata": {},
            "network": "mastercard",
            "source": "merchant-session/6097606526631936",
            "status": "denied",
            "tags": [
                "yourtags"
            ],
            "updated": "2024-07-16T15:26:44.679776+00:00"
        }
    ]
}
    

Get a Merchant Purchase

Retrieve detailed information about a specific purchase by its id.

Parameters

id REQUIRED

The unique identifier for the merchant purchase that needs to be retrieved.

fields OPTIONAL

List of strings to filter response JSON keys. Not available in the SDKs.

ENDPOINT
GET /v2/merchant-purchase/:id
REQUEST

Python

import starkbank

merchant_purchase = starkbank.merchantpurchase.get('5136275203948544')

print(merchant_purchase)        
        

Javascript

const starkbank = require('starkbank');

(async() => {
    let merchantPurchase = await starkbank.merchantPurchase.get('5950134772826112');
    console.log(merchantPurchase);
})();
    

PHP

use StarkBank\MerchantPurchase;

$merchantPurchase = MerchantPurchase::get("5950134772826112");

print_r($merchantPurchase);        
        

Java

import com.starkbank.*;

MerchantPurchase merchantPurchase = MerchantPurchase.get("5950134772826112");

System.out.println(merchantPurchase);        
        

Ruby

require 'starkbank'

merchant_purchase = StarkBank::MerchantPurchase.get('6354299030339584')

puts merchant_purchase        
        

Elixir

{:ok, merchant_purchase} = StarkBank.MerchantPurchase.get("5950134772826112")
IO.inspect(merchant_purchase)        
        

C#

using System;

MerchantPurchase merchantPurchase = MerchantPurchase.Get("5630505680633856");

Console.WriteLine(merchantPurchase);        
        

Go

package main

import (
    "fmt"
    "github.com/starkbank/sdk-go/starkbank"
    MerchantPurchase "github.com/starkbank/sdk-go/starkbank/merchantpurchase"
)

func main() {

    merchantPurchase, err := MerchantPurchase.Get("5950134772826112", nil)
    if err.Errors != nil {
        for _, e := range err.Errors {
            fmt.Printf("code: %s, message: %s", e.Code, e.Message)
        }
    }

    fmt.Printf("%+v", merchantPurchase)
}        
        

Clojure

       
(def merchant-purchase (merchant-purchase/get "5950134772826112"))
(println merchant-purchase)  
        

Curl

curl --location --request GET '{{baseUrl}}/v2/merchant-purchase/5950134772826112' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}' 
--header 'Content-Type: application/json' 
    
RESPONSE

Python

MerchantPurchase(
    amount=10000,
    billing_city=Sao Paulo,
    billing_country_code=BRA,
    billing_state_code=SP,
    billing_street_line_1=Rua Casterly Rock, 2000,
    billing_street_line_2=1 andar,
    billing_zip_code=01450-000,
    card_ending=0007,
    card_id=6295415968235520,
    challenge_mode=enabled,
    challenge_url=,
    created=2025-02-20 20:47:43.237974,
    currency_code=BRL,
    end_to_end_id=1087c2ba-6a07-4108-82f7-14156032af48,
    fee=0,
    funding_type=credit,
    holder_email=tywin.lannister@gmail.com,
    holder_name=Margaery Tyrell,
    holder_phone=11985923451,
    id=5136275203948544,
    installment_count=5,
    metadata={
        'extraData': 'extraData',
        'language': 'pt-BR',
        'screenHeight': 500,
        'screenWidth': 500,
        'timezoneOffset': 3,
        'userAgent': 'userAgent',
        'userIp': '184.82.170.183'
    },
    network=mastercard,
    source=merchant-card/6295415968235520,
    status=pending,
    tags=[],
    updated=2025-02-20 20:47:46.491252
)
        

Javascript

MerchantPurchase {
    amount: 5000,
    billingCity: 'Sao Paulo',
    billingCountryCode: 'BRA',
    billingStateCode: 'SP',
    billingStreetLine1: 'Rua Casterly Rock, 2000',
    billingStreetLine2: '1 andar',
    billingZipCode: '01450-000',
    cardEnding: '0007',
    cardId: '6325137586520064',
    challengeMode: 'disabled',
    challengeUrl: '',
    created: '2024-09-04T20:22:55.917826+00:00',
    currencyCode: 'BRL',
    endToEndId: '1caa7c6d-a3b8-48ce-8989-a94ee287a79a',
    fee: 0,
    fundingType: 'credit',
    holderEmail: 'rhaenyra.targaryen@starkbank.com',
    holderName: 'Rhaenyra Targaryen',
    holderPhone: '11985923451',
    id: '5950134772826112',
    installmentCount: 1,
    metadata: {},
    network: 'mastercard',
    source: 'merchant-session/5748908131090432',
    status: 'confirmed',
    tags: [],
    updated: '2024-09-04T20:23:03.226050+00:00'
}
    

PHP

StarkBank\MerchantPurchase Object
(
    [id] => 5950134772826112
    [amount] => 5000
    [billingCity] => Sao Paulo
    [billingCountryCode] => BRA
    [billingStateCode] => SP
    [billingStreetLine1] => Rua Casterly Rock, 2000
    [billingStreetLine2] => 
    [billingZipCode] => 01450-000
    [cardEnding] => 9733
    [cardId] => 5920400605184000
    [challengeMode] => enabled
    [challengeUrl] => https://development.api.starkinfra.com/v2/acquiring-purchase/5752622027898880/challenge
    [created] => DateTime Object
        (
            [date] => 2025-01-30 18:39:52.136626
            [timezone_type] => 1
            [timezone] => +00:00
        )
    [currencyCode] => BRL
    [endToEndId] => 00372f52-52c8-4907-b03b-3946cacae4e3
    [fee] => 0
    [fundingType] => credit
    [holderEmail] => tywin.lannister@gmail.com
    [holderName] => Tywin Lannister
    [holderPhone] => 11985923451
    [installmentCount] => 1
    [metadata] => Array
        (
            [language] => pt-BR
            [screenHeight] => 500
            [screenWidth] => 500
            [timezoneOffset] => 3
            [userAgent] => Mozilla
            [userIp] => 111.111.111.111
        )
    [network] => mastercard
    [source] => merchant-session/5674419263373312
    [status] => pending
    [tags] => Array
        (
            [0] => purchase_1234
        )
    [updated] => DateTime Object
        (
            [date] => 2025-01-30 18:39:54.029416
            [timezone_type] => 1
            [timezone] => +00:00
        )
)      
        

Java

MerchantPurchase({
    "amount": 5000,
    "billingCity": "Sao Paulo",
    "billingCountryCode": "BRA",
    "billingStateCode": "SP",
    "billingStreetLine1": "Rua Casterly Rock, 2000",
    "billingStreetLine2": "",
    "billingZipCode": "01450-000",
    "cardEnding": "9733",
    "cardId": "5920400605184000",
    "challengeMode": "enabled",
    "challengeUrl": "https://development.api.starkinfra.com/v2/acquiring-purchase/5752622027898880/challenge",
    "created": "2025-01-30T18:39:52.136626+00:00",
    "currencyCode": "BRL",
    "endToEndId": "00372f52-52c8-4907-b03b-3946cacae4e3",
    "fee": 0,
    "fundingType": "credit",
    "holderEmail": "tywin.lannister@gmail.com",
    "holderName": "Tywin Lannister",
    "holderPhone": "11985923451",
    "id": "5950134772826112",
    "installmentCount": 1,
    "metadata": {
        "language": "pt-BR",
        "screenHeight": 500,
        "screenWidth": 500,
        "timezoneOffset": 3,
        "userAgent": "Mozilla",
        "userIp": "111.111.111.111"
    },
    "network": "mastercard",
    "source": "merchant-session/5674419263373312",
    "status": "pending",
    "tags": [
        "purchase_1234"
    ],
    "updated": "2025-01-30T18:39:54.029416+00:00"
})      
  

Ruby

merchantpurchase(
    id: 6354299030339584,
    amount: 10000,
    billing_city: ,
    billing_country_code: ,
    billing_state_code: ,
    billing_street_line1: ,
    billing_street_line2: ,
    billing_zip_code: ,
    card_ending: ,
    card_id: ,
    challenge_mode: ,
    challenge_url: ,
    created: 2025-02-20T23:20:35+00:00,
    currency_code: ,
    end_to_end_id: ,
    fee: 0,
    funding_type: ,
    holder_email: ,
    holder_name: ,
    holder_phone: ,
    installment_count: ,
    metadata: {
        "extraData"=>"extraData",
        "language"=>"pt-BR", "screenHeight"=>500, 
        "screenWidth"=>500, "timezoneOffSet"=>3, 
        "timezoneOffset"=>3, 
        "userAgent"=>"userAgent", 
        "userIp"=>"255.255.255.255"
    },
    network: hipercard,
    source: merchant-card/6227768756928512,
    status: pending,
    tags: [],
    updated: 2025-02-20T23:20:38+00:00
)
        

Elixir

%StarkBank.MerchantPurchase{
    amount: 5000,
    billing_city: "Sao Paulo",
    billing_country_code: "BRA",
    billing_state_code: "SP",
    billing_street_line_1: "Rua Casterly Rock, 2000",
    billing_street_line_2: "",
    billing_zip_code: "01450-000",
    card_ending: "9733",
    card_id: "5920400605184000",
    challenge_mode: "enabled",
    challenge_url: "https://development.api.starkinfra.com/v2/acquiring-purchase/5752622027898880/challenge",
    created: ~U[2025-01-30 18:39:52.136626Z],
    currency_code: "BRL",
    end_to_end_id: "00372f52-52c8-4907-b03b-3946cacae4e3",
    fee: 0,
    funding_type: "debit",
    holder_email: "tywin.lannister@gmail.com",
    holder_name: "Tywin Lannister",
    holder_phone: "11999999999",
    id: "5693253768708096",
    installment_count: 1,
    metadata: %{
        language: "pt-BR",
        screenHeight: 500,
        screenWidth: 500,
        timezoneOffset: 3,
        userAgent: "Mozilla",
        userIp: "111.111.111.111"
    },
    network: "mastercard",
    source: "merchant-session/5674419263373312",
    status: "pending",
    tags: ["purchase_1234"],
    updated: ~U[2025-01-30 18:39:54.029416Z]
}
        

C#

MerchantPurchase(
    Amount: 180,
    FundingType: credit,
    CardId: ,
    InstallmentCount: 12,
    HolderEmail: holdeName@email.com,
    HolderPhone: 11111111111,
    BillingCountryCode: BRA,
    BillingCity: São Paulo,
    BillingStateCode: SP,
    BillingStreetLine1: Rua do Holder Name, 123,
    BillingStreetLine2: casa,
    BillingZipCode: 11111-111,
    ChallengeMode: enabled,
    Metadata: {},
    ID: "6351618970746880",
    BillingStreetLine2: "",
    ChallengeUrl: "",
    Created: "2025-02-21T02:54:37.177501+00:00",
    CurrencyCode: "BRL",
    EndToEndId: "e35d6174-af66-47fa-9606-44977065e4e7",
    Fee: 0,
    HolderName: "Marasi Colms",
    Network: "hipercard",
    Source: "merchant-card/6549906873384960",
    Status: "paid",
    Tags: [],
    Updated: "01/30/2025 18:39:54",
)
        

Go

{
    Id: "5950134772826112",
    Amount: 5000,
    BillingCity: "Sao Paulo",
    BillingCountryCode: "BRA",
    BillingStateCode: "SP",
    BillingStreetLine1: "Rua Casterly Rock, 2000",
    BillingStreetLine2: "",
    BillingZipCode: "01450-000",
    CardEnding: "9733",
    CardId: "5920400605184000",
    ChallengeMode: "enabled",
    ChallengeUrl: "https://development.api.starkinfra.com/v2/acquiring-purchase/5752622027898880/challenge",
    Created: "2025-01-30 18:39:52.136626 +0000 +0000",
    CurrencyCode: "BRL",
    EndToEndId: "00372f52-52c8-4907-b03b-3946cacae4e3",
    Fee: 0,
    FundingType: "credit",
    HolderEmail: "tywin.lannister@gmail.com",
    HolderName: "Tywin Lannister",
    HolderPhone: "11985923451",
    InstallmentCount: 1,
    Metadata: {
        Language: "pt-BR",
        ScreenHeight: 500,
        ScreenWidth: 500,
        TimezoneOffset: 3,
        UserAgent: "Mozilla",
        UserIp: "111.111.111.111"
    },
    Network: "mastercard",
    Source: "merchant-session/5674419263373312",
    Status: "pending",
    Tags: ["purchase_1234"],
    Updated: "2025-01-30 18:39:54.029416 +0000 +0000",
}      
        

Clojure

{:id "5950134772826112",
:amount 5000,
:billing-city "Sao Paulo",
:billing-country-code "BRA",
:billing-state-code "SP",
:billing-street-line-1 "Rua Casterly Rock, 2000",
:billing-street-line-2 "",
:billing-zip-code "01450-000",
:card-ending "9733",
:card-id "5920400605184000",
:challenge-mode "enabled",
:challenge-url "https://development.api.starkinfra.com/v2/acquiring-purchase/5752622027898880/challenge",
:created "2025-01-30T18:39:52.136626+00:00",
:currency-code "BRL",
:end-to-end-id "00372f52-52c8-4907-b03b-3946cacae4e3",
:fee 0,
:funding-type "credit",
:holder-email "tywin.lannister@gmail.com",
:holder-name "Tywin Lannister",
:holder-phone "11985923451",
:installment-count 1,
:metadata {:language "pt-BR",
            :screen-height 500,
            :screen-width 500,
            :timezone-offset 3,
            :user-agent "Mozilla",
            :user-ip "111.111.111.111"},
:network "mastercard",
:source "merchant-session/5674419263373312",
:status "pending",
:tags ["purchase_1234"],
:updated "2025-01-30T18:39:54.029416+00:00"}      
        

Curl

{
    "purchase": {
        "amount": 5000,
        "billingCity": "Sao Paulo",
        "billingCountryCode": "BRA",
        "billingStateCode": "SP",
        "billingStreetLine1": "Rua Casterly Rock, 2000",
        "billingStreetLine2": "1 andar",
        "billingZipCode": "01450-000",
        "cardEnding": "0007",
        "cardId": "5920400605184000",
        "challengeMode": "disabled",
        "challengeUrl": "",
        "created": "2024-09-04T20:22:55.917826+00:00",
        "currencyCode": "BRL",
        "endToEndId": "1caa7c6d-a3b8-48ce-8989-a94ee287a79a",
        "fee": 0,
        "fundingType": "credit",
        "holderEmail": "tywin.lannister@gmail.com",
        "holderName": "Tywin Lannister",
        "holderPhone": "11985923451",
        "id": "5704487431831552",
        "installmentCount": 1,
        "metadata": {},
        "network": "mastercard",
        "source": "merchant-session/5748908131090432",
        "status": "confirmed",
        "tags": ["purchase_1234],
        "updated": "2024-09-04T20:23:03.226050+00:00"
    }
}
    

List Merchant Purchase Logs

Get a paged list of merchant purchase logs.

A log tracks a change in the purchase entity according to its life cycle.

Parameters

after OPTIONAL

Filter entities created after this date.

before OPTIONAL

Filter entities created before this date.

cursor OPTIONAL

String used to get the next batch of results. Our SDKs handle this for you.

fields OPTIONAL

List of strings to filter response JSON keys. Not available in the SDKs.

limit OPTIONAL

Number of results per cursor. Max = 100.

purchaseIds OPTIONAL

Filter the merchant purchase ids to only include its corresponding logs

types OPTIONAL

Filters logs by log types.

ENDPOINT
GET /v2/merchant-purchase/log
REQUEST

Python

import starkbank

merchant_purchase_logs = starkbank.merchantpurchase.log.query(limit=1)

for log in merchant_purchase_logs:
    print(log)
        

Javascript

const starkbank = require('starkbank');

(async() => {
    let merchantPurchaseLogs= await starkbank.merchantPurchase.log.query({limit: 3});

    for await (let log of merchantPurchaseLogs){
        console.log(log);
    }
})();
    

PHP

use StarkBank\MerchantPurchase\Log;

$logs = Log::query(["limit" => 3]);

foreach($logs as $log){
    print_r($log);
}           
        

Java

import com.starkbank.*;
import com.starkbank.utils.Generator;
import java.util.HashMap;


HashMap<String, Object> params = new HashMap<>();
params.put("limit", 3);
Generator<MerchantPurchase.Log> logs = MerchantPurchase.Log.query(params);

for (MerchantPurchase.Log log : logs) {
    System.out.println(log);
}        
        

Ruby

require 'starkbank'

logs = StarkBank::MerchantPurchase::Log.query(limit: 3)

logs.each do |log|
    puts log
end           
        

Elixir

logs = StarkBank.MerchantPurchase.Log.query!(limit: 3)

for log <- logs do
    log |> IO.inspect
end         
        

C#

using System;
using StarkBank;

List<MerchantPurchase.Log> logs = MerchantPurchase.Log.Query(limit: 3).ToList();

foreach (MerchantPurchase.Log log in logs)
{
    Console.WriteLine(log);
}   
        

Go

package main

import (
    "fmt"
    "github.com/starkbank/sdk-go/starkbank/merchantpurchase/log"
)

func main() {

    var params = map[string]interface{}{}
    params["limit"] = 3
    
    logs, errorChannel := log.Query(params, nil)

    loop:
    for {
        select {
        case err := <-errorChannel:
            if err.Errors != nil {
                for _, e := range err.Errors {
                    fmt.Printf("code: %s, message: %s", e.Code, e.Message)
                }
            }
        case log, ok := <-logs:
            if !ok {
                break loop
            }
            fmt.Printf("%+v", log)
        }
    }
}            
        

Clojure

(def logs
  (starkbank.merchant-purchase.log/query
    {
      :limit 3
    }))
(dorun (map println logs))         
        

Curl

curl --location --request GET '{{baseUrl}}/v2/merchant-purchase/log' 
    --header 'Access-Id: {{accessId}}' 
    --header 'Access-Time: {{accessTime}}' 
    --header 'Access-Signature: {{accessSignature}}' 
    --header 'Content-Type: application/json' 
RESPONSE

Python

Log(    
    created=2025-02-20 20:51:47.554421,
    errors=[],
    id=4529865642475520,
    purchase=MerchantPurchase(
        amount=180,
        billing_city=São Paulo,
        billing_country_code=BRA,
        billing_state_code=SP,
        billing_street_line_1=Rua do Holder Name, 123,
        billing_street_line_2=,
        billing_zip_code=11111-111,
        card_ending=9733,
        card_expiration=None,
        card_id=,
        card_number=None,
        card_security_code=None,
        challenge_mode=disabled,
        challenge_url=,
        created=2024-07-16 19:42:25.059361,
        currency_code=BRL,
        end_to_end_id=ee77111c-644c-4a67-a4cf-6cbc9da15ceb,
        fee=0,
        funding_type=credit,
        holder_email=holdeName@email.com,
        holder_name=Holder Name,
        holder_phone=11111111111,
        id=4512566093021184,
        installment_count=12,
        metadata={},
        network=mastercard,
        source=merchant-session/5375106121465856,
        status=created,
        tags=['yourtags'],
        updated=2024-07-16 19:42:26.878894
    ),
    type=canceling
)
        
    

Javascript

MerchantPurchase.Log {
    id: '5638465999863808',
    created: '2024-07-16T19:42:25.078227+00:00',
    type: 'created',
    errors: [],
    purchase: {
        amount: 180,
        billingCity: 'São Paulo',
        billingCountryCode: 'BRA',
        billingStateCode: 'SP',
        billingStreetLine1: 'Rua do Holder Name, 123',
        billingStreetLine2: '',
        billingZipCode: '01450-000',
        cardEnding: '',
        cardId: '',
        challengeMode: 'disabled',
        challengeUrl: '',
        created: '2024-07-16T19:42:25.059361+00:00',
        currencyCode: 'BRL',
        endToEndId: 'ee77111c-644c-4a67-a4cf-6cbc9da15ceb',
        fee: 0,
        fundingType: 'credit',
        holderEmail: 'holdeName@email.com',
        holderName: 'Holder Name',
        holderPhone: '11111111111',
        id: '4512566093021184',
        installmentCount: 12,
        metadata: {},
        network: null,
        source: 'merchant-session/5375106121465856',
        status: 'created',
        tags: ['yourtags'],
        updated: '2024-07-16T19:42:26.902423+00:00'
    },
    transactionId: '',
    updated: '2024-07-16T19:42:26.902432+00:00'
}
    

PHP

StarkBank\MerchantPurchase\Log Object
(
    [id] => 5638465999863808
    [created] => DateTime Object
        (
            [date] => 2024-07-16T19:42:25.078227
            [timezone_type] => 1
            [timezone] => +00:00
        )

    [type] => created
    [errors] => Array
        (
        )

    [purchase] => StarkBank\Purchase Object
        (
            [amount] => 180
            [billingCity] => São Paulo
            [billingCountryCode] => BRA
            [billingStateCode] => SP
            [billingStreetLine1] => Rua do Holder Name, 123
            [billingStreetLine2] => 
            [billingZipCode] => 01450-000
            [cardEnding] => 
            [cardId] => 
            [challengeMode] => disabled
            [challengeUrl] => 
            [created] => DateTime Object
                (
                    [date] => 2024-07-16T19:42:25.059361
                    [timezone_type] => 1
                    [timezone] => +00:00
                )
            [currencyCode] => BRL
            [endToEndId] => ee77111c-644c-4a67-a4cf-6cbc9da15ceb
            [fee] => 0
            [fundingType] => credit
            [holderEmail] => holdeName@email.com
            [holderName] => Holder Name
            [holderPhone] => 11111111111
            [id] => 4512566093021184
            [installmentCount] => 12
            [metadata] => Array
                (
                )
            [network] => 
            [source] => merchant-session/5375106121465856
            [status] => created
            [tags] => Array
                (
                    [0] => yourtags
                )
            [updated] => DateTime Object
                (
                    [date] => 2024-07-16T19:42:26.902423
                    [timezone_type] => 1
                    [timezone] => +00:00
                )
        )

    [transactionId] => 
    [updated] => DateTime Object
        (
            [date] => 2024-07-16T19:42:26.902432
            [timezone_type] => 1
            [timezone] => +00:00
        )
)        
        

Java

Log({
    "created": "2024-07-16T19:42:25.078227+00:00",
    "type": "created",
    "errors": [],
    "purchase": {
        "amount": 180,
        "billingCity": "São Paulo",
        "billingCountryCode": "BRA",
        "billingStateCode": "SP",
        "billingStreetLine1": "Rua do Holder Name, 123",
        "billingStreetLine2": "",
        "billingZipCode": "01450-000",
        "cardEnding": "",
        "cardId": "",
        "challengeMode": "disabled",
        "challengeUrl": "",
        "created": "2024-07-16T19:42:25.059361+00:00",
        "currencyCode": "BRL",
        "endToEndId": "ee77111c-644c-4a67-a4cf-6cbc9da15ceb",
        "fee": 0,
        "fundingType": "credit",
        "holderEmail": "holdeName@email.com",
        "holderName": "Holder Name",
        "holderPhone": "11111111111",
        "id": "4512566093021184",
        "installmentCount": 12,
        "metadata": {},
        "network": "",
        "source": "merchant-session/5375106121465856",
        "status": "created",
        "tags": ["yourtags"],
        "updated": "2024-07-16T19:42:26.902423+00:00"
    },
    "id": "5638465999863808",
    "transactionId": "",
    "updated": "2024-07-16T19:42:26.902432+00:00"
})        
        

Ruby

log(
    id: 5444659316785152,
    created: 2025-02-20T23:25:57+00:00,
    type: failed,
    errors: [{"code"=>"invalidOperation", "message"=>"invalidOperation"}],
    purchase: merchantpurchase(
        id: 5777750581313536,
        amount: 120,
        billing_city: ,
        billing_country_code: ,
        billing_state_code: ,
        billing_street_line1: ,
        billing_street_line2: ,
        billing_zip_code: ,
        card_ending: ,
        card_id: ,
        challenge_mode: ,
        challenge_url: ,
        created: 2024-06-24T22:18:50+00:00,
        currency_code: ,
        end_to_end_id: ,
        fee: 0,
        funding_type: ,
        holder_email: ,
        holder_name: ,
        holder_phone: ,
        installment_count: ,
        metadata: {
            "extraData"=>"extraData",
            "language"=>"pt-BR", 
            "timezoneOffset"=>3, 
            "userAgent"=>"userAgent", 
            "userIp"=>"255.255.255.255"
        },
        network: mastercard,
        source: merchant-card/6199595021369344,
        status: approved,
        tags: ["auzi-teste"],
        updated: 2025-02-20T23:25:58+00:00
    )
)        
        

Elixir

%StarkBank.MerchantPurchase.Log{
    created: ~U[2024-07-16T19:42:25.078227Z],
    purchase: %StarkBank.MerchantPurchase{
        amount: 180,
        billing_city: "São Paulo",
        billing_country_code: "BRA",
        billing_state_code: "SP",
        billing_street_line_1: "Rua do Holder Name, 123",
        billing_street_line_2: "",
        billing_zip_code: "01450-000",
        card_ending: "",
        card_id: "",
        challenge_mode: "disabled",
        challenge_url: "",
        created: ~U[2024-07-16T19:42:25.059361Z],
        currency_code: "BRL",
        end_to_end_id: "ee77111c-644c-4a67-a4cf-6cbc9da15ceb",
        fee: 0,
        funding_type: "credit",
        holder_email: "holdeName@email.com",
        holder_name: "Holder Name",
        holder_phone: "11111111111",
        id: "4512566093021184",
        installment_count: 12,
        metadata: %{},
        network: "",
        source: "merchant-session/5375106121465856",
        status: "created",
        tags: ["yourtags"],
        updated: ~U[2024-07-16T19:42:26.902423Z]
    },
    errors: [],
    id: "5638465999863808",
    type: "created",
    transaction_id: "",
    updated: ~U[2024-07-16T19:42:26.902432Z]
}        
        

C#

Log(
    Created: 2/20/2025 11:59:15 PM,
    Type: created,
    Errors: {  },
    Purchase: MerchantPurchase(
        Amount: 180,
        FundingType: credit,
        CardId: ,
        InstallmentCount: 12,
        HolderEmail: holdeName@email.com,
        HolderPhone: 11111111111,
        BillingCountryCode: BRA,
        BillingCity: São Paulo,
        BillingStateCode: SP,
        BillingStreetLine1: Rua do Holder Name, 123,
        BillingStreetLine2: casa,
        BillingZipCode: 11111-111,
        ChallengeMode: disabled,
        Metadata: {},
        ID: "5507194040614912",
        BillingStreetLine2: "",
        ChallengeUrl: "",
        Created: "2025-02-21T02:54:37.177501+00:00",
        CurrencyCode: "BRL",
        EndToEndId: "e35d6174-af66-47fa-9606-44977065e4e7",
        Fee: 0,
        HolderName: "Marasi Colms",
        Network: "hipercard",
        Source: "merchant-card/6549906873384960",
        Status: "paid",
        Tags: [],
        Updated: "01/30/2025 18:39:54",
    ),
    ID: 6633093947457536
)        
        

Go

{
    Id: 5638465999863808,
    Purchase: {
        Id: 4512566093021184,
        Amount: 180,
        BillingCity: "São Paulo",
        BillingCountryCode: "BRA",
        BillingStateCode: "SP",
        BillingStreetLine1: "Rua do Holder Name, 123",
        BillingStreetLine2: "",
        BillingZipCode: "01450-000",
        CardEnding: "",
        CardId: "",
        ChallengeMode: "disabled",
        ChallengeUrl: "",
        Created: "2024-07-16T19:42:25.059361+00:00",
        CurrencyCode: "BRL",
        EndToEndId: "ee77111c-644c-4a67-a4cf-6cbc9da15ceb",
        Fee: 0,
        FundingType: "credit",
        HolderEmail: "holdeName@email.com",
        HolderName: "Holder Name",
        HolderPhone: "11111111111",
        InstallmentCount: 12,
        Metadata: {},
        Network: "",
        Source: "merchant-session/5375106121465856",
        Status: "created",
        Tags: [yourtags],
        Updated: "2024-07-16T19:42:26.902423+00:00"
    },
    Errors: [],
    Type: "created",
    TransactionId: "",
    Created: "2024-07-16T19:42:25.078227+00:00",
    Updated: "2024-07-16T19:42:26.902432+00:00"
}

        

Clojure

{
    :id 5638465999863808,
    :created "2024-07-16T19:42:25.078227+00:00",
    :errors [],
    :type "created",
    :purchase {
        :amount 180,
        :billing-city "São Paulo",
        :billing-country-code "BRA",
        :billing-state-code "SP",
        :billing-street-line-1 "Rua do Holder Name, 123",
        :billing-street-line-2 "",
        :billing-zip-code "01450-000",
        :card-ending "",
        :card-id "",
        :challenge-mode "disabled",
        :challenge-url "",
        :created "2024-07-16T19:42:25.059361+00:00",
        :currency-code "BRL",
        :end-to-end-id "ee77111c-644c-4a67-a4cf-6cbc9da15ceb",
        :fee 0,
        :funding-type "credit",
        :holder-email "holdeName@email.com",
        :holder-name "Holder Name",
        :holder-phone "11111111111",
        :id 4512566093021184,
        :installment-count 12,
        :metadata [],
        :network "",
        :source "merchant-session/5375106121465856",
        :status "created",
        :tags [yourtags],
        :updated "2024-07-16T19:42:26.902423+00:00"
    },
    :transaction-id "",
    :updated "2024-07-16T19:42:26.902432+00:00"
}
       
        

Curl

{
    "cursor": "CloKFAoHY3JlYXRlZBIJCO2hw9uorIcDEj5qGml-YXBpLW1zLWNhcmQtbWVyY2hhbnQtc2J4ciALEhNNZXJjaGFudFB1cmNoYXNlTG9nGICAgJj1qIsKDBgAIAE=",
    "logs": [
        {
            "created": "2024-07-16T19:42:26.639110+00:00",
            "errors": [],
            "id": "6489149636870144",
            "purchase": {
                "amount": 180,
                "billingCity": "São Paulo",
                "billingCountryCode": "BRA",
                "billingStateCode": "SP",
                "billingStreetLine1": "Rua do Holder Name, 123",
                "billingStreetLine2": "",
                "billingZipCode": "01450-000",
                "cardEnding": "9733",
                "cardId": "",
                "challengeMode": "disabled",
                "challengeUrl": "",
                "created": "2024-07-16T15:26:41.391876+00:00",
                "currencyCode": "BRL",
                "endToEndId": "53e0246b-be7a-4de3-9e99-793f80b8cb89",
                "fee": 0,
                "fundingType": "credit",
                "holderEmail": "holdeName@email.com",
                "holderName": "Holder Name",
                "holderPhone": "11111111111",
                "id": "6066273465139200",
                "installmentCount": 12,
                "metadata": {},
                "network": "mastercard",
                "source": "merchant-session/6097606526631936",
                "status": "denied",
                "tags": [
                    "yourtags"
                ],
                "updated": "2024-07-16T15:26:44.679776+00:00"
            },
            "transactionId": null,
            "type": "denied",
            "updated": "2024-07-16T19:42:26.902595+00:00"
        }
    ]
}
    

Get a Merchant Purchase Log

Get a single merchant purchase log by its id.

Parameters

id REQUIRED

The unique identifier for the merchant purchase that needs to be retrieved.

fields OPTIONAL

List of strings to filter response JSON keys. Not available in the SDKs.

ENDPOINT
GET /v2/merchant-purchase/log/:id
REQUEST

Python

import starkbank

log = starkbank.merchantpurchase.log.get('4529865642475520')

print(log)        
        

Javascript

const starkbank = require('starkbank');

(async() => {
    let log = await starkbank.merchantPurchase.log.get('6262175110791168');
    console.log(log);
})();
    

PHP

use StarkBank\MerchantPurchase\Log;

$log = Log::get("5950134772826112");

print_r($log);        
        

Java

import com.starkbank.*;

MerchantPurchase.Log log = MerchantPurchase.Log.get("5950134772826112");

System.out.println(log);        
        

Ruby

require 'starkbank'

log = StarkBank::MerchantPurchase::Log.get('5444659316785152')

puts log        
        

Elixir

{:ok, merchant_purchase} = StarkBank.MerchantPurchase.Log.get("5950134772826112")
IO.inspect(merchant_purchase)        
        

C#

using System;

MerchantPurchase.Log log = MerchantPurchase.Log.Get("6633093947457536");

Console.WriteLine(log);        
        

Go

package main

import (
    "fmt"
    "github.com/starkbank/sdk-go/starkbank"
    "github.com/starkbank/sdk-go/starkbank/merchantpurchase/log"
)

func main() {

    log, err := log.Get("5950134772826112", nil)
    if err.Errors != nil {
        for _, e := range err.Errors {
            fmt.Printf("code: %s, message: %s", e.Code, e.Message)
        }
    }

    fmt.Printf("%+v", log)
}        
        

Clojure

(let [log (merchant-purchase.log/get "5950134772826112")]

(println log))        
        

Curl

curl --location --request GET '{{baseUrl}}/v2/merchant-purchase/log/5950134772826112' 
    --header 'Access-Id: {{accessId}}' 
    --header 'Access-Time: {{accessTime}}' 
    --header 'Access-Signature: {{accessSignature}}' 
    --header 'Content-Type: application/json' 
RESPONSE

Python

Log(
    created=2025-02-20 20:51:47.554421,
    errors=[],
    id=4529865642475520,
    purchase=MerchantPurchase(
        amount=180,
        billing_city=São Paulo,
        billing_country_code=BRA,
        billing_state_code=SP,
        billing_street_line_1=Rua do Holder Name, 123,
        billing_street_line_2=,
        billing_zip_code=11111-111,
        card_ending=9733,
        card_id=,
        challenge_mode=disabled,
        challenge_url=,
        created=2024-07-16 19:42:25.059361,
        currency_code=BRL,
        end_to_end_id=ee77111c-644c-4a67-a4cf-6cbc9da15ceb,
        fee=0,
        funding_type=credit,
        holder_email=holdeName@email.com,
        holder_name=Holder Name,
        holder_phone=11111111111,
        id=4512566093021184,
        installment_count=12,
        metadata={},
        network=mastercard,
        source=merchant-session/5375106121465856,
        status=created,
        tags=['yourtags'],
        updated=2024-07-16 19:42:26.878894
    ),
    type=canceling
)
        

Javascript

Log {
    id: '6262175110791168',
    created: '2025-02-20T20:47:43.257939+00:00',
    type: 'created',
    errors: [],
    purchase: {
        amount: 1800,
        billingCity: 'Sao Paulo',
        billingCountryCode: 'BRA',
        billingStateCode: 'SP',
        billingStreetLine1: 'Rua do Dragão, 123',
        billingStreetLine2: '11 andar',
        billingZipCode: '06010-010',
        cardEnding: '9733',
        cardId: '5428415054327227',
        challengeMode: 'disabled',
        challengeUrl: '',
        created: '2025-02-20T20:47:43.237974+00:00',
        currencyCode: 'BRL',
        endToEndId: 'ee77111c-644c-4a67-a4cf-6cbc9da15ceb',
        fee: 60,
        fundingType: 'credit',
        holderEmail: 'rhaenyra.targaryen@gmail.com',
        holderName: 'Rhaenyra Targaryen',
        holderPhone: '11111111111',
        id: '4512566093021184',
        installmentCount: 12,
        metadata: {},
        network: 'mastercard',
        source: 'merchant-session/5375106121465856',
        status: 'created',
        tags: ['yourtags'],
        updated: '2024-07-16T19:42:26.902423+00:00'
    },
    transactionId: '',
    updated: '2024-07-16T19:42:26.902432+00:00'
    }
    

PHP

StarkBank\MerchantPurchase\Log Object
(
    [id] => 5950134772826112
    [created] => DateTime Object
        (
            [date] => 2024-07-16T19:42:25.078227
            [timezone_type] => 1
            [timezone] => +00:00
        )

    [type] => created
    [errors] => Array
        (
        )

    [purchase] => StarkBankPurchase Object
        (
            [amount] => 180
            [billingCity] => São Paulo
            [billingCountryCode] => BRA
            [billingStateCode] => SP
            [billingStreetLine1] => Rua do Holder Name, 123
            [billingStreetLine2] => 
            [billingZipCode] => 01450-000
            [cardEnding] => 
            [cardId] => 
            [challengeMode] => disabled
            [challengeUrl] => 
            [created] => DateTime Object
                (
                    [date] => 2024-07-16T19:42:25.059361
                    [timezone_type] => 1
                    [timezone] => +00:00
                )
            [currencyCode] => BRL
            [endToEndId] => ee77111c-644c-4a67-a4cf-6cbc9da15ceb
            [fee] => 0
            [fundingType] => credit
            [holderEmail] => holdeName@email.com
            [holderName] => Holder Name
            [holderPhone] => 11111111111
            [id] => 4512566093021184
            [installmentCount] => 12
            [metadata] => Array
                (
                )
            [network] => 
            [source] => merchant-purchase/5375106121465856
            [status] => created
            [tags] => Array
                (
                    [0] => yourtags
                )
            [updated] => DateTime Object
                (
                    [date] => 2024-07-16T19:42:26.902423
                    [timezone_type] => 1
                    [timezone] => +00:00
                )
        )

    [transactionId] => 
    [updated] => DateTime Object
        (
            [date] => 2024-07-16T19:42:26.902432
            [timezone_type] => 1
            [timezone] => +00:00
        )
)        
        

Java

MerchantPurchase.Log({
    "created": "2024-07-16T19:42:25.078227+00:00",
    "type": "created",
    "errors": [],
    "purchase": {
        "amount": 180,
        "billingCity": "São Paulo",
        "billingCountryCode": "BRA",
        "billingStateCode": "SP",
        "billingStreetLine1": "Rua do Holder Name, 123",
        "billingStreetLine2": "",
        "billingZipCode": "01450-000",
        "cardEnding": "",
        "cardId": "",
        "challengeMode": "disabled",
        "challengeUrl": "",
        "created": "2024-07-16T19:42:25.059361+00:00",
        "currencyCode": "BRL",
        "endToEndId": "ee77111c-644c-4a67-a4cf-6cbc9da15ceb",
        "fee": 0,
        "fundingType": "credit",
        "holderEmail": "holdeName@email.com",
        "holderName": "Holder Name",
        "holderPhone": "11111111111",
        "id": "4512566093021184",
        "installmentCount": 12,
        "metadata": {},
        "network": "",
        "source": "merchant-purchase/5375106121465856",
        "status": "created",
        "tags": ["yourtags"],
        "updated": "2024-07-16T19:42:26.902423+00:00"
    },
    "id": "5950134772826112",
    "transactionId": "",
    "updated": "2024-07-16T19:42:26.902432+00:00"
})        
        

Ruby

log(
    id: 5444659316785152,
    created: 2025-02-20T23:25:57+00:00,
    type: failed,
    transactionId: ,
    errors: [{"code"=>"invalidOperation", "message"=>"invalidOperation"}],
    purchase: merchantpurchase(
        id: 5777750581313536,
        amount: 120,
        billing_city: ,
        billing_country_code: ,
        billing_state_code: ,
        billing_street_line1: ,
        billing_street_line2: ,
        billing_zip_code: ,
        card_ending: ,
        card_id: ,
        challenge_mode: ,
        challenge_url: ,
        created: 2024-06-24T22:18:50+00:00,
        currency_code: ,
        end_to_end_id: ,
        fee: 0,
        funding_type: ,
        holder_email: ,
        holder_name: ,
        holder_phone: ,
        installment_count: ,
        metadata: {
            "extraData"=>"extraData", 
            "language"=>"pt-BR", 
            "timezoneOffset"=>3, 
            "userAgent"=>"userAgent", 
            "userIp"=>"255.255.255.255"
        },
        network: mastercard,
        source: merchant-card/6199595021369344,
        status: approved,
        tags: ["auzi-teste"],
        updated: 2025-02-20T23:25:58+00:00
    )
)        
        

Elixir

%StarkBank.MerchantPurchase.Log{
    created: ~U[2024-07-16T19:42:25.078227Z],
    purchase: %StarkBank.MerchantPurchase{
        amount: 180,
        billing_city: "São Paulo",
        billing_country_code: "BRA",
        billing_state_code: "SP",
        billing_street_line_1: "Rua do Holder Name, 123",
        billing_street_line_2: "",
        billing_zip_code: "01450-000",
        card_ending: "",
        card_id: "",
        challenge_mode: "disabled",
        challenge_url: "",
        created: ~U[2024-07-16T19:42:25.059361Z],
        currency_code: "BRL",
        end_to_end_id: "ee77111c-644c-4a67-a4cf-6cbc9da15ceb",
        fee: 0,
        funding_type: "credit",
        holder_email: "holdeName@email.com",
        holder_name: "Holder Name",
        holder_phone: "11111111111",
        id: "4512566093021184",
        installment_count: 12,
        metadata: %{},
        network: "",
        source: "merchant-purchase/5375106121465856",
        status: "created",
        tags: ["yourtags"],
        updated: ~U[2024-07-16T19:42:26.902423Z]
    },
    errors: [],
    id: "5950134772826112",
    type: "created",
    transaction_id: "",
    updated: ~U[2024-07-16T19:42:26.902432Z]
}        
        

C#

Log(
    Created: 2/20/2025 11:59:15 PM,
    Type: created,
    Errors: {  },
    Purchase: MerchantPurchase(
        Amount: 0,
        FundingType: "credit",
        CardId: "5720800615202816",
        InstallmentCount: 1,
        HolderEmail: ,
        HolderPhone: ,
        BillingCountryCode: ,
        BillingCity: ,
        BillingStateCode: ,
        BillingStreetLine1: ,
        BillingStreetLine2: ,
        BillingZipCode: ,
        ChallengeMode: "disabled",
        Metadata: {},
        ID: "5630505680633856",
        ChallengeUrl: "",
        Created: "2025-02-21T02:54:37.177501+00:00",
        CurrencyCode: "BRL",
        EndToEndId: "e35d6174-af66-47fa-9606-44977065e4e7",
        Fee: 0,
        HolderName: "Marasi Colms",
        Network: "hipercard",
        Source: "merchant-card/6549906873384960",
        Status: "paid",
        Tags: [],
        Updated: "01/30/2025 18:39:54",
        ),
    TransactionId: ,
    ID: 6633093947457536,

)        
        

Go

{
    Id: 5950134772826112,
    Purchase: {
        Id: 4512566093021184,
        Amount: 180,
        BillingCity: "São Paulo",
        BillingCountryCode: "BRA",
        BillingStateCode: "SP",
        BillingStreetLine1: "Rua do Holder Name, 123",
        BillingStreetLine2: "",
        BillingZipCode: "01450-000",
        CardEnding: "",
        CardId: "",
        ChallengeMode: "disabled",
        ChallengeUrl: "",
        Created: "2024-07-16T19:42:25.059361+00:00",
        CurrencyCode: "BRL",
        EndToEndId: "ee77111c-644c-4a67-a4cf-6cbc9da15ceb",
        Fee: 0,
        FundingType: "credit",
        HolderEmail: "holdeName@email.com",
        HolderName: "Holder Name",
        HolderPhone: "11111111111",
        InstallmentCount: 12,
        Metadata: {},
        Network: "",
        Source: "merchant-purchase/5375106121465856",
        Status: "created",
        Tags: ["yourtags"],
        Updated: "2024-07-16T19:42:26.902423+00:00"
    },
    Errors: [],
    Type: "created",
    TransactionId = "",    
    Created: "2024-07-16T19:42:25.078227+00:00",
    Updated: "2024-07-16T19:42:26.902432+00:00"
}        
        

Clojure

{
    :id 5950134772826112,
    :created "2024-07-16T19:42:25.078227+00:00",
    :errors [],
    :type "created",
    :purchase {
        :amount 180,
        :billing-city "São Paulo",
        :billing-country-code "BRA",
        :billing-state-code "SP",
        :billing-street-line-1 "Rua do Holder Name, 123",
        :billing-street-line-2 "",
        :billing-zip-code "01450-000",
        :card-ending "",
        :card-id "",
        :challenge-mode "disabled",
        :challenge-url "",
        :created "2024-07-16T19:42:25.059361+00:00",
        :currency-code "BRL",
        :end-to-end-id "ee77111c-644c-4a67-a4cf-6cbc9da15ceb",
        :fee 0,
        :funding-type "credit",
        :holder-email "holdeName@email.com",
        :holder-name "Holder Name",
        :holder-phone "11111111111",
        :id 4512566093021184,
        :installment-count 12,
        :metadata [],
        :network "",
        :source "merchant-purchase/5375106121465856",
        :status "created",
        :tags ["yourtags"],
        :updated "2024-07-16T19:42:26.902423+00:00"
    },
    :transaction-id "",
    :updated "2024-07-16T19:42:26.902432+00:00"
}
        

Curl

{
    "log": {
        "created": "2024-07-16T19:42:25.078227+00:00",
        "errors": [],
        "id": "5638465999863808",
        "purchase": {
            "amount": 180,
            "billingCity": "São Paulo",
            "billingCountryCode": "BRA",
            "billingStateCode": "SP",
            "billingStreetLine1": "Rua do Holder Name, 123",
            "billingStreetLine2": "",
            "billingZipCode": "01450-000",
            "cardEnding": "",
            "cardId": "",
            "challengeMode": "disabled",
            "challengeUrl": "",
            "created": "2024-07-16T19:42:25.059361+00:00",
            "currencyCode": "BRL",
            "endToEndId": "ee77111c-644c-4a67-a4cf-6cbc9da15ceb",
            "fee": 0,
            "fundingType": "credit",
            "holderEmail": "holdeName@email.com",
            "holderName": "Holder Name",
            "holderPhone": "11111111111",
            "id": "4512566093021184",
            "installmentCount": 12,
            "metadata": {},
            "network": "",
            "source": "merchant-purchase/5375106121465856",
            "status": "created",
            "tags": [
                "yourtags"
            ],
            updated: "2024-07-16T19:42:26.902423+00:00"
        },
        "transactionId": "",
        "type": "created",
        "updated": "2024-07-16T19:42:26.902432+00:00"
    }
}

Merchant Card

The Merchant Card resource stores information about cards used in approved purchases.

These cards can be used in new purchases without the need to create a new session.

The Merchant Card object

Attributes

id STRING

Unique id for the merchant card.

created STRING

Creation datetime. Example: "2020-04-23T23:00:00.000000+00:00".

ending STRING

Last 4 digits of the card number.

expiration STRING

Card expiration date. Example: "2025-06".

fundingType STRING

Funding type. Options: "credit", "debit".

holderName STRING

Name of the card holder.

network STRING

Card network.

status STRING

Current card status. Options: "active", "expired", "canceled", "blocked".

tags LIST OF STRINGS

Tags associated with the card.

updated STRING

Last update datetime. Example: "2020-04-23T23:00:00.000000+00:00".

List Merchant Cards

Get a list of merchant cards in chunks of at most 100. If you need smaller chunks, use the limit parameter.

Parameters

after OPTIONAL

Filter entities created after this date.

before OPTIONAL

Filter entities created before this date.

cursor OPTIONAL

String used to get the next batch of results. Our SDKs handle this for you.

fields OPTIONAL

List of strings to filter response JSON keys. Not available in the SDKs.

ids OPTIONAL

List of strings to get specific entities by ids.

limit OPTIONAL

Number of results per cursor. Max = 100.

status OPTIONAL

Filter cards by the specified status, such as: active, expired, canceled or blocked.

tags OPTIONAL

Filter entities that contain the specified tags.

ENDPOINT
GET /v2/merchant-card
REQUEST

Python

import starkbank

merchant_cards = starkbank.merchantcard.query(limit=1)

for merchant_card in merchant_cards:
    print(merchant_card)
        

Javascript

const starkbank = require('starkbank');

(async() => {
    let merchantCards = await starkbank.merchantCard.query({limit: 1});

    for await (let merchantCard of merchantCards){
        console.log(merchantCard);
    }
})();
    

PHP

use StarkBank\MerchantCard;

$merchantCards = MerchantCard::query([
    "limit" => 1
]);

foreach($merchantCards as $merchantCard){
    print_r($merchantCard);
}
        

Java

import com.starkbank.*;
import com.starkbank.utils.Generator;
import java.util.HashMap;


HashMap<String, Object> params = new HashMap<>()();
params.put("limit", 1);
Generator<MerchantCard> merchantCards = MerchantCard.query(params);

for (MerchantCard merchantCard : merchantCards) {
    System.out.println(merchantCard);
}
        

Ruby

require 'starkbank'

merchantCards = StarkBank::MerchantCard.query(limit: 1)

merchantCards.each do |merchantCard|
    puts merchantCard
end
        

Elixir

merchantCards = StarkBank.MerchantCard.query!(limit: 1)

for merchantCard <- merchantCards do
    merchantCard |> IO.inspect
end
        

C#

using System;
using StarkBank;

List<MerchantCard> merchantCards = MerchantCard.Query(limit: 1).ToList();

foreach (MerchantCard merchantCard in merchantCards)
{
    Console.WriteLine(merchantCard);
}
        

Go

package main

import (
    "fmt"
    MerchantCard "github.com/starkbank/sdk-go/starkbank/merchantcard"
)

func main() {

    var params = map[string]interface{}{}
    params["limit"] = 1

    merchantcards, errorChannel := MerchantCard.Query(params, nil)

    loop:
    for {
        select {
        case err := <-errorChannel:
            if err.Errors != nil {
                for _, e := range err.Errors {
                    fmt.Printf("code: %s, message: %s", e.Code, e.Message)
                }
            }
        case merchantcard, ok := <-merchantcards:
            if !ok {
                break loop
            }
            fmt.Printf("%+v", merchantcard)
        }
    }
}
        

Clojure

(def merchant-cards
  (starkbank.merchant-card/query
    {
      :limit 1
    }))
(dorun (map println merchant-cards))
        

Curl

curl --location --request GET '{{baseUrl}}/v2/merchant-card' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}' 
--header 'Content-Type: application/json' 
    
RESPONSE

Python

MerchantCard(
    created=2025-02-18 18:39:28.597425,
    ending=0007,
    expiration=2045-02-01 02:59:59.999999,
    funding_type=credit,
    holder_name=Margaery Tyrell,
    id=6295415968235520,
    network=mastercard,
    status=active,
    tags=[],
    updated=2025-02-19 20:08:50.497358
)
        

Javascript

MerchantCard {
    id: '5950134772826112',
    ending: '9011',
    fundingType: 'credit',
    holderName: 'Rhaenyra Targaryen',
    network: 'mastercard',
    status: 'active',
    tags: [],
    expiration: '2035-01-31T23:59:59.999999+00:00',
    created: '2024-09-05T18:33:32.262976+00:00',
    updated: '2024-09-05T18:33:32.618219+00:00'
}
    

PHP

StarkBank\MerchantCard Object
(
    [id] => 5950134772826112
    [ending] => 9011
    [fundingType] => credit
    [holderName] => Rhaenyra Targaryen
    [network] => mastercard
    [status] => active
    [tags] => Array
        (
        )
    [expiration] => DateTime Object
        (
            [date] => 2035-01-31 23:59:59.999999
            [timezone_type] => 1
            [timezone] => +00:00
        )
    [created] => DateTime Object
        (
            [date] => 2024-09-05 18:33:32.262976
            [timezone_type] => 1
            [timezone] => +00:00
        )
    [updated] => DateTime Object
        (
            [date] => 2024-09-05 18:33:32.618219
            [timezone_type] => 1
            [timezone] => +00:00
        )
)
        

Java

MerchantCard ({
    "id": "5950134772826112",
    "ending": "9011",
    "fundingType": "credit",
    "holderName": "Rhaenyra Targaryen",
    "network": "mastercard",
    "status": "active",
    "tags": [],
    "expiration": "2035-01-31T23:59:59.999999+00:00",
    "created": "2024-09-05T18:33:32.262976+00:00",
    "updated": "2024-09-05T18:33:32.618219+00:00"
})
        

Ruby

merchantcard(
    id: 6227768756928512,
    ending: 9272,
    expiration: 2035-03-01T02:59:59.999999+00:00,
    fundingType: credit,
    holderName: Rhaenyra Targaryen,
    created: 2025-01-22T17:40:35+00:00,
    network: hipercard,
    status: active,
    tags: [],
    updated: 2025-02-19T20:08:50+00:00
)
        

Elixir

%StarkBank.MerchantCard{
    id: "5950134772826112",
    ending: "9011",
    funding_type: "credit",
    holder_name: "Rhaenyra Targaryen",
    network: "mastercard",
    status: "active",
    tags: [],
    expiration: ~U[2035-01-31 23:59:59.999999Z],
    created: ~U[2024-09-05 18:33:32.262976Z],
    updated: ~U[2024-09-05 18:33:32.618219Z]
}
        

C#

MerchantCard(
    Created: 2025-01-22T17:40:35.229638+00:00,
    Ending: 9272,
    Expiration: 2035-03-01T02:59:59.999999+00:00,
    FundingType: credit,
    HolderName: Marasi Colms,
    Network: hipercard,
    Status: active,
    Tags: {  },
    Updated: 2025-02-19T20:08:50.476504+00:00,
    ID: 6227768756928512
)
        

Go

{
    Id: '5950134772826112'
    Ending: '9011'
    FundingType: 'credit'
    HolderName: 'Rhaenyra Targaryen'
    Network: 'mastercard'
    Status: 'active'
    Tags: []
    Expiration: '2035-01-31T23:59:59.999999+00:00'
    Created: '2024-09-05T18:33:32.262976+00:00'
    Updated: '2024-09-05T18:33:32.618219+00:00'
}
        

Clojure

{
    :id "5950134772826112",
    :ending "9011",
    :funding-type "credit",
    :holder-name "Rhaenyra Targaryen",
    :network "mastercard",
    :status "active",
    :tags [],
    :expiration "2035-01-31T23:59:59.999999+00:00",
    :created "2024-09-05T18:33:32.262976+00:00",
    :updated "2024-09-05T18:33:32.618219+00:00"
}
        

Curl

    {
        "cursor": "ClcKFAoHY3JlYXRlZBIJCKDD2tebqYcDEjtqGml-YXBpLW1zLWNhcmQtbWVyY2hhbnQtc2J4ch0LEhBNZXJjaGFudFB1cmNoYXNlGICAgNil4boIDBgAIAE=",
        "cards": [
            {
                "id": "5950134772826112",
                "ending": "9011",
                "fundingType": "credit",
                "holderName": "Rhaenyra Targaryen",
                "network": "mastercard",
                "status": "active",
                "tags": [],
                "expiration": "2035-01-31T23:59:59.999999+00:00",
                "created": "2024-09-05T18:33:32.262976+00:00",
                "updated": "2024-09-05T18:33:32.618219+00:00"
            }
        ]
    }

Get a Merchant Card

Retrieve detailed information about a specific card by its id.

Parameters

id REQUIRED

The unique identifier for the merchant card that needs to be retrieved.

fields OPTIONAL

List of strings to filter response JSON keys. Not available in the SDKs.

ENDPOINT
GET /v2/merchant-card/:id
REQUEST

Python

import starkbank

merchant_card = starkbank.merchantcard.get('6295415968235520')

print(merchant_card)
        

Javascript

const starkbank = require('starkbank');

(async() => {
    let merchantCard = await starkbank.merchantCard.get('5950134772826112');
    console.log(merchantCard);
})();
    

PHP

use StarkBank\MerchantCard;

$merchantCard = MerchantCard::get("5950134772826112");

print_r($merchantCard);
        

Java

import com.starkbank.*;

MerchantCard merchantCard = MerchantCard.get("5950134772826112");

System.out.println(merchantCard);
        

Ruby

require 'starkbank'

merchant_card = StarkBank::MerchantCard.get('5950134772826112')

puts merchant_card
        

Elixir

{:ok, merchant_card} = StarkBank.MerchantCard.get("5950134772826112")
IO.inspect(merchant_card)
        

C#

using System;

MerchantCard merchantCard = MerchantCard.Get("6227768756928512");

Console.WriteLine(merchantCard);
        

Go

package main

import (
    "fmt"
    "github.com/starkbank/sdk-go/starkbank"
    MerchantCard "github.com/starkbank/sdk-go/starkbank/merchantcard"
)

func main() {

    merchantCard, err := MerchantCard.Get("5950134772826112", nil)
    if err.Errors != nil {
        for _, e := range err.Errors {
            fmt.Printf("code: %s, message: %s", e.Code, e.Message)
        }
    }

    fmt.Printf("%+v", merchantCard)
}
        

Clojure

(def log (merchant-card/get "5950134772826112"))
(println log)
        

Curl

curl --location --request GET '{{baseUrl}}/v2/merchant-card/5950134772826112' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}' 
--header 'Content-Type: application/json' 
    
RESPONSE

Python

MerchantCard(
    created=2025-02-18 18:39:28.597425,
    ending=0007,
    expiration=2045-02-01 02:59:59.999999,
    funding_type=credit,
    holder_name=Margaery Tyrell,
    id=6295415968235520,
    network=mastercard,
    status=active,
    tags=[],
    updated=2025-02-19 20:08:50.497358
)
        

Javascript

MerchantCard {
    id: '5950134772826112',
    ending: '9011',
    fundingType: 'credit',
    holderName: 'Rhaenyra Targaryen',
    network: 'mastercard',
    status: 'active',
    tags: [],
    expiration: '2035-01-31T23:59:59.999999+00:00',
    created: '2024-09-05T18:33:32.262976+00:00',
    updated: '2024-09-05T18:33:32.618219+00:00'
}
    

PHP

StarkBank\MerchantCard Object
(
    [id] => 5950134772826112
    [ending] => 9011
    [fundingType] => credit
    [holderName] => Rhaenyra Targaryen
    [network] => mastercard
    [status] => active
    [tags] => Array
        (
        )
    [expiration] => DateTime Object
        (
            [date] => 2035-01-31 13:59:59.999999
            [timezone_type] => 1
            [timezone] => +00:00
        )
    [created] => DateTime Object
        (
            [date] => 2024-09-05 18:33:32.262976
            [timezone_type] => 1
            [timezone] => +00:00
        )
    [updated] => DateTime Object
        (
            [date] => 2024-09-05 18:33:32.618219
            [timezone_type] => 1
            [timezone] => +00:00
        )
)
        

Java

MerchantCard({
    "id": "5950134772826112",
    "ending": "9011",
    "fundingType": "credit",
    "holderName": "Rhaenyra Targaryen",
    "network": "mastercard",
    "status": "active",
    "tags": [],
    "expiration": "2035-01-31T23:59:59.999999+00:00",
    "created": "2024-09-05T18:33:32.262976+00:00",
    "updated": "2024-09-05T18:33:32.618219+00:00"
})
        

Ruby

merchantcard(
    id: '5950134772826112',
    ending: '9011',
    funding_type: 'credit',
    holder_name: 'Rhaenyra Targaryen',
    network: 'mastercard',
    status: 'active',
    tags: [],
    expiration: '2035-01-31T23:59:59.999999+00:00',
    created: '2024-09-05T18:33:32.262976+00:00',
    updated: '2024-09-05T18:33:32.618219+00:00'
)
        

Elixir

%StarkBank.MerchantCard{
    id: "5950134772826112",
    ending: "9011",
    funding_type: "credit",
    holder_name: "Rhaenyra Targaryen",
    network: "mastercard",
    status: "active",
    tags: [],
    expiration: ~U[2035-01-31 23:59:59.999999Z],
    created: ~U[2024-09-05 18:33:32.262976Z],
    updated: ~U[2024-09-05 18:33:32.618219Z]
}
        

C#

MerchantCard(
    Created: 2025-01-22T17:40:35.229638+00:00,
    Ending: 9272,
    Expiration: 2035-03-01T02:59:59.999999+00:00,
    FundingType: credit,
    HolderName: Marasi Colms,
    Network: hipercard,
    Status: active,
    Tags: {  },
    Updated: 2025-02-19T20:08:50.476504+00:00,
    ID: 6227768756928512
)
        

Go

{
    Id: '5950134772826112'
    Ending: '9011'
    FundingType: 'credit'
    HolderName: 'Rhaenyra Targaryen'
    Network: 'mastercard'
    Status: 'active'
    Tags: []
    Expiration: '2035-01-31T23:59:59.999999+00:00'
    Created: '2024-09-05T18:33:32.262976+00:00'
    Updated: '2024-09-05T18:33:32.618219+00:00'
}
        

Clojure

{
    :id "5950134772826112",
    :ending "9011",
    :funding-type "credit",
    :holder-name "Rhaenyra Targaryen",
    :network "mastercard",
    :status "active",
    :tags [],
    :expiration "2035-01-31T23:59:59.999999+00:00",
    :created "2024-09-05T18:33:32.262976+00:00",
    :updated "2024-09-05T18:33:32.618219+00:00"
}
        

Curl

{
    "card": {
        "id": "5950134772826112",
        "ending": "9011",
        "fundingType": "credit",
        "holderName": "Rhaenyra Targaryen",
        "network": "mastercard",
        "status": "active",
        "tags": [],
        "expiration": "2035-01-31T23:59:59.999999+00:00",
        "created": "2024-09-05T18:33:32.262976+00:00",
        "updated": "2024-09-05T18:33:32.618219+00:00"
    }
}
    

List Merchant Card Logs

Get a paged list of merchant card logs.

A log tracks a change in the card entity according to its lifecycle.

Parameters

after OPTIONAL

Filter entities created after this date.

before OPTIONAL

Filter entities created before this date.

cardIds OPTIONAL

Array of card ids that are linked to the logs you desire.

cursor OPTIONAL

String used to get the next batch of results. Our SDKs handle this for you.

fields OPTIONAL

List of strings to filter response JSON keys. Not available in the SDKs.

limit OPTIONAL

Number of results per cursor. Max = 100.

types OPTIONAL

Filters logs by log types.

ENDPOINT
GET /v2/merchant-card/log
REQUEST

Python

import starkbank

logs = starkbank.merchantcard.log.query(limit=1)

for log in logs:
    print(log)
        

Javascript

const starkbank = require('starkbank');

(async() => {
    let logs = await starkbank.merchantCard.log.query({limit: 1});

    for await (let log of logs){
        console.log(log);
    }
})();
    

PHP

use StarkBank\MerchantCard\Log;

$logs = Log::query(["limit" => 1]);

foreach($logs as $log){
    print_r($log);
}
        

Java

import com.starkbank.*;
import com.starkbank.utils.Generator;
import java.util.HashMap;


HashMap<String, Object> params = new HashMap<>();
params.put("limit", 1);
Generator<MerchantCard.Log> logs = MerchantCard.Log.query(params);

for (MerchantCard.Log log : logs) {
    System.out.println(log);
}
        

Ruby

require 'starkbank'

logs = StarkBank::MerchantCard::Log.query(limit: 1)

logs.each do |log|
    puts log
end
        

Elixir

logs = StarkBank.MerchantCard.Log.query!(limit: 1)

for log <- logs do
    log |> IO.inspect
end
        

C#

using System;
using StarkBank;

List<MerchantCard.Log> logs = MerchantCard.Log.Query(limit: 1).ToList();

foreach (MerchantCard.Log log in logs)
{
    Console.WriteLine(log);
}
        

Go

package main

import (
    "fmt"
    "github.com/starkbank/sdk-go/starkbank/merchantcard/log"
)

func main() {

    var params = map[string]interface{}{}
    params["limit"] = 1

    logs, errorChannel := log.Query(params, nil)

    loop:
    for {
        select {
        case err := <-errorChannel:
            if err.Errors != nil {
                for _, e := range err.Errors {
                    fmt.Printf("code: %s, message: %s", e.Code, e.Message)
                }
            }
        case log, ok := <-logs:
            if !ok {
                break loop
            }
            fmt.Printf("%+v", log)
        }
    }
}
        

Clojure

(def logs
  (starkbank.merchant-card.log/query
    {
      :limit 1
    }))
(dorun (map println logs))
        

Curl

curl --location --request GET '{{baseUrl}}/v2/merchant-card/log' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}' 
--header 'Content-Type: application/json' 
    
RESPONSE

Python

Log(
    created=2025-02-18 18:39:28.612480,
    errors=[],
    id=4888041084682240,
    card=MerchantCard(
        created=2025-02-18 18:39:28.597425,
        ending=0007,
        expiration=2045-02-01 02:59:59.999999,
        funding_type=credit,
        holder_name=Margaery Tyrell,
        id=6295415968235520,
        network=mastercard,
        status=active,
        tags=[],
        updated=2025-02-19 20:08:50.497358
    ),
    type=active,
)
        

Javascript

MerchantCard.Log {
    card: {
        created: '2024-09-05T18:33:32.262976+00:00',
        ending: '9011',
        expiration: '2035-01-31T23:59:59.999999+00:00',
        fundingType: 'credit',
        holderName: 'Rhaenyra Targaryen',
        id: '5833998009892864',
        network: 'mastercard',
        status: 'active',
        tags: [],
        updated: '2024-09-05T18:33:32.656403+00:00'
    },
    created: '2024-09-05T18:33:32.277195+00:00',
    errors: [],
    id: '5950134772826112',
    type: 'active'
}
    

PHP

StarkBank\MerchantCard\Log Object
(
    [id] => 5950134772826112
    [created] => DateTime Object
        (
            [date] => 2024-09-05 18:33:32.277195
            [timezone_type] => 1
            [timezone] => +00:00
        )

    [type] => active
    [errors] => Array
        (
        )

    [card] => StarkBank\MerchantCard Object
        (
            [created] => DateTime Object
                (
                    [date] => 2024-09-05 18:33:32.262976
                    [timezone_type] => 1
                    [timezone] => +00:00
                )
            [ending] => 9011
            [expiration] => DateTime Object
                (
                    [date] => 2035-01-31 23:59:59.999999
                    [timezone_type] => 1
                    [timezone] => +00:00
                )
            [fundingType] => credit
            [holderName] => Rhaenyra Targaryen
            [id] => 5833998009892864
            [network] => mastercard
            [status] => active
            [tags] => Array
                (
                )
            [updated] => DateTime Object
                (
                    [date] => 2024-09-05 18:33:32.656403
                    [timezone_type] => 1
                    [timezone] => +00:00
                )
        )

    [updated] => DateTime Object
        (
            [date] => 2024-09-05 18:33:32.656403
            [timezone_type] => 1
            [timezone] => +00:00
        )
)
        

Java

Log({
    "id": "5950134772826112",
    "created": "2024-09-05T18:33:32.277195+00:00",
    "errors": [],
    "type": "active",
    "card": {
        "created": "2024-09-05T18:33:32.262976+00:00",
        "ending": "9011",
        "expiration": "2035-01-31T23:59:59.999999+00:00",
        "fundingType": "credit",
        "holderName": "Rhaenyra Targaryen",
        "id": "5833998009892864",
        "network": "mastercard",
        "status": "active",
        "tags": [],
        "updated": "2024-09-05T18:33:32.656403+00:00"
    },
    "updated": "2024-09-05T18:33:32.656403+00:00"
})
        

Ruby

log(
    id: 5950134772826112,
    created: '2024-09-05T18:33:32.277195+00:00',
    type: 'active',
    errors: [],
    card: {
        created: '2024-09-05T18:33:32.262976+00:00',
        ending: '9011',
        expiration: '2035-01-31T23:59:59.999999+00:00',
        funding_type: 'credit',
        holder_name: 'Rhaenyra Targaryen',
        id: '5833998009892864',
        network: 'mastercard',
        status: 'active',
        tags: [],
        updated: '2024-09-05T18:33:32.656403+00:00'
    },
    updated: '2024-09-05T18:33:32.656403+00:00'
)
        

Elixir

%StarkBank.Log{
    card: %StarkBank.MerchantCard{
        created: ~U[2024-09-05T18:33:32.262976Z],
        ending: "9011",
        expiration: ~U[2035-01-31T23:59:59.999999Z],
        funding_type: "credit",
        holder_name: "Rhaenyra Targaryen",
        id: "5833998009892864",
        network: "mastercard",
        status: "active",
        tags: [],
        updated: ~U[2024-09-05T18:33:32.656403Z]
    },
    created: ~U[2024-09-05T18:33:32.277195Z],
    errors: [],
    id: "5950134772826112",
    type: "active"
}
        

C#

Log(
    Created: 1/22/2025 2:40:35 PM,
    Type: active,
    Errors: {  },
    Card: MerchantCard(
        Created: 2025-01-22T17:40:35.229638+00:00,
        Ending: 9272,
        Expiration: 2035-02-28T23:59:59.999999+00:00,
        FundingType: credit,
        HolderName: Marasi Colms,
        Network: hipercard,
        Status: active,
        Tags: {  },
        Updated: 2025-01-24T17:42:43.911193+00:00,
        ID: 6227768756928512
    ),
    ID: 4820393873375232
)
        

Go

Log{
    Id: "5950134772826112"
    Card: {
        Created: "2024-09-05T18:33:32.262976+00:00"
        Ending: "9011"
        Expiration: "2035-01-31T23:59:59.999999+00:00"
        FundingType: "credit"
        HolderName: "Rhaenyra Targaryen"
        Id: "5833998009892864"
        Network: "mastercard"
        Status: "active"
        Tags: []
        Updated: "2024-09-05T18:33:32.656403+00:00"
    },
    Created: "2024-09-05T18:33:32.277195+00:00"
    Errors: []
    Type: "active"
    Updated: "2024-09-05T18:33:32.656403+00:00",
}
        

Clojure

{:id "5950134772826112",
 :created "2024-09-05T18:33:32.277195+00:00",
 :errors [],
 :type "active",
 :card {
    :created "2024-09-05T18:33:32.262976+00:00",
    :ending "9011",
    :expiration "2035-01-31T23:59:59.999999+00:00",
    :funding-type "credit",
    :holder-name "Rhaenyra Targaryen",
    :id "5833998009892864",
    :network "mastercard",
    :status "active",
    :tags [],
    :updated "2024-09-05T18:33:32.656403+00:00"
 },
 :updated "2024-09-05T18:33:32.656403+00:00"
 }
        

Curl

{
    "cursor": "CloKFAoHY3JlYXRlZBIJCO2hw9uorIcDEj5qGml-YXBpLW1zLWNhcmQtbWVyY2hhbnQtc2J4ciALEhNNZXJjaGFudFB1cmNoYXNlTG9nGICAgJj1qIsKDBgAIAE=",
    "logs": [
        {
            "card": {
                "created": "2024-09-05T18:33:32.262976+00:00",
                "ending": "9011",
                "expiration": "2035-01-31T23:59:59.999999+00:00",
                "fundingType": "credit",
                "holderName": "Rhaenyra Targaryen",
                "id": "5833998009892864",
                "network": "mastercard",
                "status": "active",
                "tags": [],
                "updated": "2024-09-05T18:33:32.656403+00:00"
            },
            "created": "2024-09-05T18:33:32.277195+00:00",
            "errors": [],
            "id": "5950134772826112",
            "type": "active"
        }
    ]
}
    

Get a Merchant Card Log

Get a single merchant card log by its id.

Parameters

id REQUIRED

The unique identifier for the merchant card that needs to be retrieved.

fields OPTIONAL

List of strings to filter response JSON keys. Not available in the SDKs.

ENDPOINT
GET /v2/merchant-card/log/:id
REQUEST

Python

import starkbank

merchant_card_log = starkbank.merchantcard.log.get('4888041084682240')

print(merchant_card_log)
        

Javascript

const starkbank = require('starkbank');

(async() => {
    let log = await starkbank.merchantCard.log.get('5950134772826112');
    console.log(log);
})();
    

PHP

use StarkBank\MerchantCard\Log;

$merchantCardLog = Log::get("5950134772826112");

print_r($merchantCardLog);
        

Java

import com.starkbank.*;

MerchantCard.Log merchantCardLog = MerchantCard.Log.get("5950134772826112");

System.out.println(merchantCardLog);
        

Ruby

require 'starkbank'

merchant_card_log = StarkBank::MerchantCard::Log.get('4720319524765696')

puts merchant_card_log
        

Elixir

{:ok, merchant_card_log} = StarkBank.MerchantCard.Log.get("5950134772826112")
IO.inspect(merchant_card_log)
        

C#

using System;

MerchantCard.Log merchantCardLog = MerchantCard.Log.Get("4979921977868288");

Console.WriteLine(merchantCardLog);
        

Go

package main

import (
    "fmt"
    "github.com/starkbank/sdk-go/starkbank"
    "github.com/starkbank/sdk-go/starkbank/merchantcard/log"
)

func main() {

    log, err := log.Get("5950134772826112", nil)
    if err.Errors != nil {
        for _, e := range err.Errors {
            fmt.Printf("code: %s, message: %s", e.Code, e.Message)
        }
    }

    fmt.Printf("%+v", log)
}
        

Clojure

(def log (starkbank.merchant-card.log/get "5950134772826112"))
(println log)
        

Curl

curl --location --request GET '{{baseUrl}}/v2/merchant-card/log/5950134772826112' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}' 
--header 'Content-Type: application/json' 
    
RESPONSE

Python

Log(
    created=2025-02-18 18:39:28.612480,
    errors=[],
    id=4888041084682240,
    card=MerchantCard(
        created=2025-02-18 18:39:28.597425,
        ending=0007,
        expiration=2045-02-01 02:59:59.999999,
        funding_type=credit,
        holder_name=Margaery Tyrell,
        id=6295415968235520,
        network=mastercard,
        status=active,
        tags=[],
        updated=2025-02-19 20:08:50.497358
    ),
    type=active,
    updated=None
)
    

Javascript

MerchantCard.Log {
    card: {
        created: '2024-09-05T18:33:32.262976+00:00',
        ending: '9011',
        expiration: '2035-01-31T23:59:59.999999+00:00',
        fundingType: 'credit',
        holderName: 'Rhaenyra Targaryen',
        id: '5128535692341644',
        network: 'mastercard',
        status: 'active',
        tags: [],
        updated: '2024-09-05T18:33:32.656403+00:00'
    },
    created: '2024-09-05T18:33:32.277195+00:00',
    errors: [],
    id: '5950134772826112',
    type: 'active'
}
    

PHP

StarkBank\MerchantCard\Log Object
(
    [card] => StarkBank\MerchantCard Object
        (
            [created] => DateTime Object
                (
                    [date] => 2024-09-05 18:33:32.262976
                    [timezone_type] => 1
                    [timezone] => +00:00
                )
            [ending] => 9011
            [expiration] => DateTime Object
                (
                    [date] => 2035-01-31 23:59:59.999999
                    [timezone_type] => 1
                    [timezone] => +00:00
                )
            [fundingType] => credit
            [holderName] => Rhaenyra Targaryen
            [id] => 5128535692341644
            [network] => mastercard
            [status] => active
            [tags] => Array
                (
                )
            [updated] => DateTime Object
                (
                    [date] => 2024-09-05 18:33:32.656403
                    [timezone_type] => 1
                    [timezone] => +00:00
                )
        )
    [created] => DateTime Object
        (
            [date] => 2024-09-05 18:33:32.277195
            [timezone_type] => 1
            [timezone] => +00:00
        )
    [errors] => Array
        (
        )
    [id] => 5950134772826112
    [type] => active
)
    

Java

Log({
    card: {
        created: "2024-09-05T18:33:32.262976+00:00",
        ending: "9011",
        expiration: "2035-01-31T23:59:59.999999+00:00",
        fundingType: "credit",
        holderName: "Rhaenyra Targaryen",
        id: "5128535692341644",
        network: "mastercard",
        status: "active",
        tags: [],
        updated: "2024-09-05T18:33:32.656403+00:00"
    },
    created: "2024-09-05T18:33:32.277195+00:00",
    errors: [],
    id: "5950134772826112",
    type: "active"
})
    

Ruby

log(
    id: 4720319524765696,
    created: 2025-01-22T17:39:25+00:00,
    type: active,
    errors: [],
    card: merchantcard(
        id: 6549906873384960,
        ending: 9272,
        expiration: 2035-02-01T02:59:59.999999+00:00,
        fundingType: ,
        holderName: ,
        created: 2025-01-22T17:39:25+00:00,
        network: hipercard,
        status: active,
        tags: [],
        updated: 2025-01-22T17:40:07+00:00
    )
)
    

Elixir

%StarkBank.MerchantCard.Log{
    card: %StarkBank.MerchantCard{
        created: ~U[2024-09-05 18:33:32.262976Z],
        ending: "9011",
        expiration: ~U[2035-01-31 23:59:59.999999Z],
        funding_type: "credit",
        holder_name: "Rhaenyra Targaryen",
        id: "5128535692341644",
        network: "mastercard",
        status: "active",
        tags: [],
        updated: ~U[2024-09-05 18:33:32.656403Z]
    },
    created: ~U[2024-09-05 18:33:32.277195Z],
    errors: [],
    id: "5950134772826112",
    type: "active"
}
    

C#

Log(
    Created: 2/12/2025 12:12:34 AM,
    Type: active,
    Errors: {  },
    Card: MerchantCard(
        Created: 2025-02-12T03:12:34.087060+00:00,
        Ending: 9733,
        Expiration: 2035-01-31T23:59:59.999999+00:00,
        FundingType: debit,
        HolderName: Tywin Lannister,
        Network: mastercard,
        Status: active,
        Tags: {  },
        Updated: 2025-02-12T03:31:57.347254+00:00,
        ID: 6387296861421568
    ),
    ID: 4979921977868288
    )
    

Go

{
    Id: '5950134772826112'
    Card: {
        Created: '2024-09-05T18:33:32.262976+00:00'
        Ending: '9011'
        Expiration: '2035-01-31T23:59:59.999999+00:00'
        FundingType: 'credit'
        HolderName: 'Rhaenyra Targaryen'
        Id: '5128535692341644'
        Network: 'mastercard'
        Status: 'active'
        Tags: []
        Updated: '2024-09-05T18:33:32.656403+00:00'
    }
    Created: '2024-09-05T18:33:32.277195+00:00'
    Errors: []
    Type: 'active'
}
    

Clojure

{
    :id "5950134772826112",
    :card {
        :created "2024-09-05T18:33:32.262976+00:00",
        :ending "9011",
        :expiration "2035-01-31T23:59:59.999999+00:00",
        :funding-type "credit",
        :holder-name "Rhaenyra Targaryen",
        :id "5128535692341644",
        :network "mastercard",
        :status "active",
        :tags [],
        :updated "2024-09-05T18:33:32.656403+00:00"
    },
    :created "2024-09-05T18:33:32.277195+00:00",
    :errors [],
    :type "active"
}
    

Curl

{
    "log": {
        "card": {
            "created": "2024-09-05T18:33:32.262976+00:00",
            "ending": "9011",
            "expiration": "2035-01-31T23:59:59.999999+00:00",
            "fundingType": "credit",
            "holderName": "Rhaenyra Targaryen",
            "id": "5833998009892864",
            "network": "mastercard",
            "status": "active",
            "tags": [],
            "updated": "2024-09-05T18:33:32.656403+00:00"
        },
        "created": "2024-09-05T18:33:32.277195+00:00",
        "errors": [],
        "id": "5950134772826112",
        "type": "active"
    }
}
    

Merchant Installment

Merchant Installments are created for every installment in a purchase.

These resources will track its own due payment date and settlement lifecycle.

Merchant Installment Status

Each merchant installment has a status that can change over time according to its life cycle: merchant-installment-status

Merchant Installment Logs

Every time Stark Bank makes a change to a Merchant Installment, we create a log. Logs are pretty useful for understanding the life cycle of each Merchant Installment and the changes that happened to it. Here you can see the flow of possible logs: merchant-installment-log

The Merchant Installment object

Attributes

id STRING

Unique id for the merchant installment.

amount INTEGER

Installment amount in cents.

created STRING

Creation datetime. Example: "2020-04-23T23:00:00.000000+00:00".

due STRING

Expected settlement date. Example: "2020-04-23T23:00:00.000000+00:00".

fee INTEGER

Fee charged in cents.

fundingType STRING

Funding type. Options: "credit", "debit".

network STRING

Card network.

purchaseId STRING

ID of the Merchant Purchase linked to the installment.

status STRING

Current installment status. Options: "created", "paid", "canceled", "voided".

tags LIST OF STRINGS

Tags associated with the installment.

transactionIds LIST OF STRINGS

Ledger transaction IDs linked to the installment.

updated STRING

Last update datetime. Example: "2020-04-23T23:00:00.000000+00:00".

List Merchant Installments

Get a list of merchant installments in chunks of at most 100. If you need smaller chunks, use the limit parameter.

Parameters

after OPTIONAL

Filter entities created after this date.

before OPTIONAL

Filter entities created before this date.

cursor OPTIONAL

String used to get the next batch of results. Our SDKs handle this for you.

fields OPTIONAL

List of strings to filter response JSON keys. Not available in the SDKs.

ids OPTIONAL

List of strings to get specific entities by ids.

limit OPTIONAL

Number of results per cursor. Max = 100.

status OPTIONAL

Filter installments by the specified status, such as: created, paid, canceled, voided.

tags OPTIONAL

Filter entities that contain the specified tags.

ENDPOINT
GET /v2/merchant-installment
REQUEST

Python

import starkbank

merchant_installments = starkbank.merchantinstallment.query(limit=1)

for merchant_installment in merchant_installments:
    print(merchant_installment)
        

Javascript

const starkbank = require('starkbank');

(async() => {
    let merchantInstallments = await starkbank.merchantInstallment.query({limit= 1});

    for await (let merchantInstallment of merchantInstallments){
        console.log(merchantInstallment);
    }
})();
    

PHP

use StarkBank\MerchantInstallment;

$merchantInstallments = MerchantInstallment::query(["limit" => 1]);

foreach($merchantInstallments as $merchantInstallment){
    print_r($merchantInstallment);
}
        

Java

import com.starkbank.*;
import com.starkbank.utils.Generator;
import java.util.HashMap;


HashMap<String, Object> params = new HashMap<>();
params.put("limit", 1);
Generator<MerchantInstallment> merchantInstallments = MerchantInstallment.query(params);

for (MerchantInstallment merchantInstallment : merchantInstallments) {
    System.out.println(merchantInstallment);
}
        

Ruby

require 'starkbank'

merchantInstallments = StarkBank::MerchantInstallment.query(limit: 1)

merchantInstallments.each do |merchantInstallment|
    puts merchantInstallment
end
        

Elixir

merchantInstallments = StarkBank.MerchantInstallment.query!(limit: 1)

for merchantInstallment <- merchantInstallments do
    merchantInstallment |> IO.inspect
end
        

C#

using System;
using StarkBank;

List<MerchantInstallment> merchantInstallments = MerchantInstallment.Query(limit: 1).ToList();

foreach (MerchantInstallment merchantInstallment in merchantInstallments)
{
    Console.WriteLine(merchantInstallment);
}
        

Go

package main

import (
    "fmt"
    MerchantInstallment "github.com/starkbank/sdk-go/starkbank/merchantinstallment"
)

func main() {

    var params = map[string]interface{}{}
    params["limit"] = 1

    merchantinstallments, errorChannel := MerchantInstallment.Query(params, nil)

    loop:
    for {
        select {
        case err := <-errorChannel:
            if err.Errors != nil {
                for _, e := range err.Errors {
                    fmt.Printf("code: %s, message: %s", e.Code, e.Message)
                }
            }
        case merchantinstallment, ok := <-merchantinstallments:
            if !ok {
                break loop
            }
            fmt.Printf("%+v", merchantinstallment)
        }
    }
}
        

Clojure

(def merchant-installments
  (starkbank.merchant-installment/query
    {
      :limit 1
    }))
(dorun (map println merchant-installments))
        

Curl

curl --location --request GET '{{baseUrl}}/v2/merchant-installment' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}' 
--header 'Content-Type: application/json' 
    
RESPONSE

Python

MerchantInstallment(
    amount=1000,
    created=2025-02-20 20:01:58.529828,
    due=2025-05-21 03:00:00.529828,
    fee=16,
    funding_type=credit,
    id=4848075206033408,
    network=mastercard,
    purchase_id=5559970598748160,
    status=paid,
    tags=[],
    transaction_ids=["38502321313064121177062848528552"],
    updated=2025-02-20 20:02:02.185613
)
        

Javascript

MerchantInstallment {
    id: '4848075206033408',
    amount: 1000,
    fee: 16,
    fundingType: 'credit',
    network: 'mastercard',
    purchaseId: '5559970598748160',
    status: 'paid',
    transactionIds: ['38502321313064121177062848528552'],
    tags: [],
    due: '2025-05-21T03:00:00+00:00',
    created: '2025-02-20T20:01:58.529828+00:00',
    updated: '2025-02-20T20:02:02.185613+00:00'
}
    

PHP

StarkBank\MerchantInstallment Object
(
    [id] => 5823924298317824
    [amount] => 1000
    [created] => DateTime Object
        (
            [date] => 2025-02-12 04:01:53.170457
            [timezone_type] => 1
            [timezone] => +00:00
        )
    [due] => DateTime Object
        (
            [date] => 2025-03-13 03:00:00
            [timezone_type] => 1
            [timezone] => +00:00
        )
    [fee] => 24
    [fundingType] => credit
    [network] => diners
    [purchaseId] => 5798109464494080
    [status] => paid
    [tags] => Array
        (
        )
    [transactionIds] => Array
        (
            [0] => 38502321313064121177062848528552
        )
    [updated] => DateTime Object
        (
            [date] => 2025-02-12 06:00:17.047231
            [timezone_type] => 1
            [timezone] => +00:00
        )
)
        

Java

MerchantInstallment({
  "amount": 1000,
  "created": "2025-02-12T04:01:53.170457+00:00",
  "due": "2025-03-13T03:00:00+00:00",
  "fee": 24,
  "fundingType": "credit",
  "network": "diners",
  "purchaseId": "5798109464494080",
  "status": "paid",
  "tags": [],
  "transactionIds": [
    "38502321313064121177062848528552"
  ],
  "updated": "2025-02-12T06:00:17.047231+00:00",
  "id": "5823924298317824"
})
        

Ruby

merchantinstallment(
    id: 4881709363363840,
    amount: 5000,
    fundingType: ,
    purchaseId: ,
    due: 2025-03-21T03:00:00+00:00,
    created: 2025-02-20T23:16:10+00:00,
    fee: 120,
    network: diners,
    status: paid,
    tags: ["stark", "suit"],
    transactionIds: ["38502321313064121177062848528552"],
    updated: 2025-02-21T00:00:05+00:00
)
        

Elixir

%StarkBank.MerchantInstallment{
    amount: 1000,
    created: ~U[2025-02-12T04:01:53.170457Z],
    due: ~U[2025-03-13T03:00:00Z],
    fee: 24,
    funding_type: "credit",
    network: "diners",
    purchase_id: "5798109464494080",
    status: "paid",
    tags: [],
    transaction_ids: ["38502321313064121177062848528552"],
    updated: ~U[2025-02-12T06:00:17.047231Z],
    id: "5823924298317824"
}
        

C#

MerchantInstallment(
    Amount: 1000,
    Created: 2/21/2025 12:10:48 AM,
    Due: 3/24/2025 12:00:00 AM,
    Fee: 16,
    FundingType: credit,
    Network: mastercard,
    PurchaseId: 5917035389255680,
    Status: created,
    Tags: {  },
    TransactionIds: { 38502321313064121177062848528552 },
    Updated: 2/21/2025 12:10:50 AM,
    ID: 6717676390973440
)
        

Go

{
    Id: "5823924298317824",
    Amount: 1000,
    Created: "2025-02-12T04:01:53.170457+00:00",
    Due: "2025-03-13T03:00:00+00:00",
    Fee: 24,
    FundingType: "credit",
    Network: "diners",
    PurchaseId: "5798109464494080",
    Status: "paid",
    Tags: [],
    TransactionIds: ["38502321313064121177062848528552"],
    Updated: "2025-02-12T06:00:17.047231+00:00"
}
        

Clojure

{:amount 1000,
 :created "2025-02-12T04:01:53.170457+00:00",
 :due "2025-03-13T03:00:00+00:00",
 :fee 24,
 :funding-type "credit",
 :network "diners",
 :purchase-id "5798109464494080",
 :status "paid",
 :tags [],
 :transaction-ids ["38502321313064121177062848528552"],
 :updated "2025-02-12T06:00:17.047231+00:00",
 :id "5823924298317824"}
        

Curl

    {
        "cursor": "ClcKFAoHY3JlYXRlZBIJCKDD2tebqYcDEjtqGml-YXBpLW1zLWNhcmQtbWVyY2hhbnQtc2J4ch0LEhBNZXJjaGFudFB1cmNoYXNlGICAgNil4boIDBgAIAE=",
        "installments": [
            {
                "amount": 1000,
                "created": "2025-02-12T21:36:20.489713+00:00",
                "due": "2024-10-07T03:00:00+00:00",
                "fee": 24,
                "fundingType": "credit",
                "id": "4584324594663424",
                "network": "mastercard",
                "purchaseId": "6237525488173056",
                "status": "created",
                "tags": [],
                "transactionIds": ["38502321313064121177062848528552"],
                "updated": "2024-09-06T21:36:20.911595+00:00"
            }
        ]
    }
    

Get a Merchant Installment

Retrieve detailed information about a specific installment by its id.

Parameters

id REQUIRED

The unique identifier for the merchant installment that needs to be retrieved.

fields OPTIONAL

List of strings to filter response JSON keys. Not available in the SDKs.

ENDPOINT
GET /v2/merchant-installment/:id
REQUEST

Python

import starkbank

merchant_installment = starkbank.merchantinstallment.get('4848075206033408')

print(merchant_installment)
        

Javascript

const starkbank = require('starkbank');

(async() => {
    let merchantInstallment = await starkbank.merchantInstallment.get('4848075206033408');
    console.log(merchantInstallment);
})();
    

PHP

use StarkBank\MerchantInstallment;

$merchant_installment = MerchantInstallment::get("4848075206033408");

print_r($merchant_installment);
        

Java

import com.starkbank.*;

MerchantInstallment merchantInstallment = MerchantInstallment.get("4848075206033408");

System.out.println(merchantInstallment);
        

Ruby

require 'starkbank'

merchant_installment = StarkBank::MerchantInstallment.get('4848075206033408')

puts merchant_installment
        

Elixir

{:ok, merchant_installment} = StarkBank.MerchantInstallment.get("4848075206033408")
IO.inspect(merchant_installment)
        

C#

using System;

MerchantInstallment merchantInstallment = MerchantInstallment.Get("4848075206033408");

Console.WriteLine(merchantInstallment);
        

Go

package main

import (
    "fmt"
    "github.com/starkbank/sdk-go/starkbank"
    MerchantInstallment "github.com/starkbank/sdk-go/starkbank/merchantinstallment"
)

func main() {

    merchantinstallment, err := MerchantInstallment.Get("4848075206033408", nil)
    if err.Errors != nil {
        for _, e := range err.Errors {
            fmt.Printf("code: %s, message: %s", e.Code, e.Message)
        }
    }

    fmt.Printf("%+v", merchantinstallment)
}
        

Clojure

(def merchant-installment (merchant-installment/get "4848075206033408"))

(println merchant-installment)
        

Curl

curl --location --request GET '{{baseUrl}}/v2/merchant-installment/4848075206033408' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}' 
--header 'Content-Type: application/json' 
    
RESPONSE

Python

MerchantInstallment(
        amount=1000,
        created=2025-02-20 20:01:58.529828,
        due=2025-05-21 03:00:00.529828,
        fee=16,
        funding_type=credit,
        id=4848075206033408,
        network=mastercard,
        purchase_id=5559970598748160,
        status=paid,
        tags=[],
        transaction_ids=["38502321313064121177062848528552"],
        updated=2025-02-20 20:02:02.185613
)
        

Javascript

MerchantInstallment {
    id: '4848075206033408',
    amount: 1000,
    fee: 16,
    fundingType: 'credit',
    network: 'mastercard',
    purchaseId: '5559970598748160',
    status: 'paid',
    transactionIds: ['38502321313064121177062848528552'],
    tags: [],
    due: '2025-05-21T03:00:00+00:00',
    created: '2025-02-20T20:01:58.529828+00:00',
    updated: '2025-02-20T20:02:02.185613+00:00'
}
    

PHP

StarkBank\MerchantInstallment Object
(
    [id] => 4848075206033408
    [amount] => 1000
    [created] => DateTime Object
        (
            [date] => 2025-02-12 04:01:53.170457
            [timezone_type] => 1
            [timezone] => +00:00
        )
    [due] => DateTime Object
        (
            [date] => 2025-03-13 03:00:00
            [timezone_type] => 1
            [timezone] => +00:00
        )
    [fee] => 24
    [fundingType] => credit
    [network] => diners
    [purchaseId] => 5798109464494080
    [status] => paid
    [tags] => Array
        (
        )
    [transactionIds] => Array
        (
            [0] => 38502321313064121177062848528552
        )
    [updated] => DateTime Object
        (
            [date] => 2025-02-12 06:00:17.047231
            [timezone_type] => 1
            [timezone] => +00:00
        )
)
        

Java

MerchantInstallment({
  "amount": 1000,
  "created": "2025-02-12T04:01:53.170457+00:00",
  "due": "2025-03-13T03:00:00+00:00",
  "fee": 24,
  "fundingType": "credit",
  "network": "diners",
  "purchaseId": "5798109464494080",
  "status": "paid",
  "tags": [],
  "transactionIds": [
    "38502321313064121177062848528552"
  ],
  "updated": "2025-02-12T06:00:17.047231+00:00",
  "id": "4848075206033408"
})
        

Ruby

merchantinstallment(
    id: 4848075206033408,
    amount: 2000,
    fundingType: credit,
    purchaseId: 6237525488173056,
    due: 2025-07-14T03:00:00+00:00,
    created: 2025-02-13T20:09:57+00:00,
    fee: 53,
    network: diners,
    status: paid,
    tags: [],
    transactionIds: ["38502321313064121177062848528552"],
    updated: 2025-02-14T00:00:31+00:00
)
        

Elixir

%StarkBank.MerchantInstallment{
    amount: 1000,
    created: ~U[2025-02-12T04:01:53.170457Z],
    due: ~U[2025-03-13T03:00:00Z],
    fee: 24,
    funding_type: "credit",
    network: "diners",
    purchase_id: "5798109464494080",
    status: "paid",
    tags: [],
    transaction_ids: ["38502321313064121177062848528552"],
    updated: ~U[2025-02-12T06:00:17.047231Z],
    id: "4848075206033408"
}
        

C#

MerchantInstallment(
    Amount: 1000,
    Created: 2/21/2025 12:10:48 AM,
    Due: 4/22/2025 12:00:00 AM,
    Fee: 16,
    FundingType: credit,
    Network: mastercard,
    PurchaseId: 5917035389255680,
    Status: paid,
    Tags: {  },
    TransactionIds: { 38502321313064121177062848528552 },
    Updated: 2/21/2025 12:10:51 AM,
    ID: 4848075206033408
)
        

Go

{
    Id: "4848075206033408"
    Amount: 1000
    Created: "2025-02-12T04:01:53.170457+00:00"
    Due: "2025-03-13T03:00:00+00:00"
    Fee: 24
    FundingType: "credit"
    Network: "diners"
    PurchaseId: "5798109464494080"
    Status: "paid"
    Tags: []string{}
    TransactionIds: []string{"38502321313064121177062848528552"}
    Updated: "2025-02-12T06:00:17.047231+00:00"
}
        

Clojure

{:amount 1000,
 :created "2025-02-12T04:01:53.170457+00:00",
 :due "2025-03-13T03:00:00+00:00",
 :fee 24,
 :funding-type "credit",
 :network "diners",
 :purchase-id "5798109464494080",
 :status "paid",
 :tags [],
 :transaction-ids ["38502321313064121177062848528552"],
 :updated "2025-02-12T06:00:17.047231+00:00",
 :id "4848075206033408"}
        

Curl

{
    "installment": {
        "amount": 5000,
        "created": "2024-09-06T21:36:20.489713+00:00",
        "due": "2024-10-07T03:00:00+00:00",
        "fee": 60,
        "fundingType": "credit",
        "id": "4848075206033408",
        "network": "mastercard",
        "purchaseId": "6237525488173056",
        "status": "paid",
        "tags": [],
        "transactionIds": ["38502321313064121177062848528552"],
        "updated": "2024-09-06T21:36:20.911595+00:00"
    }
}
    

List Merchant Installment Logs

Get a paged list of merchant installment logs.

A log tracks a change in the installment entity according to its life cycle.

Parameters

after OPTIONAL

Filter entities created after this date.

before OPTIONAL

Filter entities created before this date.

cursor OPTIONAL

String used to get the next batch of results. Our SDKs handle this for you.

fields OPTIONAL

List of strings to filter response JSON keys. Not available in the SDKs.

installmentIds OPTIONAL

Filter the merchant installment ids to only include their corresponding logs

limit OPTIONAL

Number of results per cursor. Max = 100.

types OPTIONAL

Filters logs by log types.

ENDPOINT
GET /v2/merchant-installment/log
REQUEST

Python

import starkbank

merchant_installment_logs = starkbank.merchantinstallment.log.query(limit=1)

for log in merchant_installment_logs:
    print(log)
        

Javascript

const starkbank = require('starkbank');

(async() => {
    let merchantInstallments = await starkbank.merchantInstallment.log.query({limit: 1});

    for await (let merchantInstallment of merchantInstallments){
        console.log(merchantInstallment);
    }
})();
    

PHP

use StarkBank\MerchantInstallment\Log;

$logs = Log::query(["limit" => 1]);

foreach($logs as $log){
    print_r($log);
}
        

Java

import com.starkbank.*;
import com.starkbank.utils.Generator;
import java.util.HashMap;


HashMap<String, Object> params = new HashMap<>();
params.put("limit", 1);
Generator<MerchantInstallment.Log> logs = MerchantInstallment.Log.query(params);

for (MerchantInstallment.Log log : logs) {
    System.out.println(log);
}
        

Ruby

require 'starkbank'

logs = StarkBank::MerchantInstallment::Log.query(limit: 1)

logs.each do |log|
    puts log
end
        

Elixir

logs = StarkBank.MerchantInstallment.Log.query!(limit: 1)

for log <- logs do
    log |> IO.inspect
end
        

C#

using System;
using StarkBank;

List<MerchantInstallment.Log> logs = MerchantInstallment.Log.Query(limit: 1).ToList();

foreach (MerchantInstallment.Log log in logs)
{
    Console.WriteLine(log);
}
        

Go

package main

import (
    "fmt"
    "github.com/starkbank/sdk-go/starkbank/merchantinstallment/log"
)

func main() {

    var params = map[string]interface{}{}
    params["limit"] = 1

    logs, errorChannel := log.Query(params, nil)

    loop:
    for {
        select {
        case err := <-errorChannel:
            if err.Errors != nil {
                for _, e := range err.Errors {
                    fmt.Printf("code: %s, message: %s", e.Code, e.Message)
                }
            }
        case log, ok := <-logs:
            if !ok {
                break loop
            }
            fmt.Printf("%+v", log)
        }
    }
}
        

Clojure

(def logs
  (starkbank.merchant-installment.log/query
    {
      :limit 1
    }))
(dorun (map println logs))
        

Curl

curl --location --request GET '{{baseUrl}}/v2/merchant-installment/log' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}' 
--header 'Content-Type: application/json' 
    
RESPONSE

Python

Log(
    created=2025-02-20 21:05:03.520701,
    errors=[],
    id=6218715502739456,
    installment=MerchantInstallment(
        amount=5000,
        created=2025-02-20 21:05:03.515855,
        due=2025-03-21 03:00:00,
        fee=60,
        funding_type=credit,
        id=5092815595896832,
        network=mastercard,
        purchase_id=6332003586670592,
        status=created,
        tags=[],
        transaction_ids=[],
        updated=2025-02-20 21:05:04.705022
    ),
    type=created,
    updated=2025-02-20 21:05:04.720418
)
        

Javascript

Log {
    id: '6536925066297344',
    created: '2025-02-20T20:01:58.538986+00:00',
    type: 'created',
    errors: [],
    installment: {
        amount: 1000,
        created: '2025-02-20T20:01:58.529828+00:00',
        due: '2025-05-21T03:00:00+00:00',
        fee: 16,
        fundingType: 'credit',
        id: '4848075206033408',
        network: 'mastercard',
        purchaseId: '5559970598748160',
        status: 'created',
        tags: [],
        transactionIds: [],
        updated: '2025-02-20T20:02:02.212054+00:00'
    },
    updated: '2025-02-20T20:02:02.212061+00:00'
}
    

PHP

StarkBank\MerchantInstallment\Log Object
(
    [created] => DateTime Object
        (
            [date] => 2024-09-09T03:00:04.754608+00:00
            [timezone_type] => 1
            [timezone] => +00:00
        )
    [errors] => Array
        (
        )
    [id] => 5177774721466368
    [installment] => StarkBank\MerchantInstallment Object
        (
            [amount] => 122
            [created] => 2024-09-06T18:37:42.445978+00:00
            [due] => 2024-09-09T03:00:00+00:00
            [fee] => 3
            [fundingType] => credit
            [id] => 6147068645081088
            [network] => mastercard
            [purchaseId] => 6224062846074880
            [status] => paid
            [tags] => Array
                (
                )
            [transactionIds] => Array
                (
                    [0] => 53962437879807990290615252629327
                )
            [updated] => 2024-09-09T03:00:05.126276+00:00
        )
    [type] => credited
    [updated] => DateTime Object
        (
            [date] => 2024-09-09T03:00:05.126321+00:00
            [timezone_type] => 1
            [timezone] => +00:00
        )
)
        

Java

MerchantInstallment.Log({
    "created": "2024-09-09T03:00:04.754608+00:00",
    "errors": [],
    "id": "5177774721466368",
    "installment": {
        "amount": 122,
        "created": "2024-09-06T18:37:42.445978+00:00",
        "due": "2024-09-09T03:00:00+00:00",
        "fee": 3,
        "fundingType": "credit",
        "id": "6147068645081088",
        "network": "mastercard",
        "purchaseId": "6224062846074880",
        "status": "paid",
        "tags": [],
        "transactionIds": [
            "53962437879807990290615252629327"
        ],
        "updated": "2024-09-09T03:00:05.126276+00:00"
    },
    "type": "credited",
    "updated": "2024-09-09T03:00:05.126321+00:00"
})
        

Ruby

log(
    id: 6754756320034816,
    created: 2025-02-21T00:00:33+00:00,
    type: credited,
    errors: [],
    installment: merchantinstallment(
        id: 5019869871341568,
        amount: 2000,
        fundingType: ,
        purchaseId: ,
        due: 2025-07-21T03:00:00+00:00,
        created: 2025-02-20T22:18:28+00:00,
        fee: 32,
        network: mastercard,
        status: paid,
        tags: [],
        transactionIds: ,
        updated: 2025-02-21T00:00:39+00:00
    )
)
        

Elixir

%MerchantInstallment.Log{
    created: ~U[2024-09-09T03:00:04.754608Z],
    errors: [],
    id: "5177774721466368",
    installment: %{
        amount: 122,
        created: ~U[2024-09-06T18:37:42.445978Z],
        due: ~U[2024-09-09T03:00:00Z],
        fee: 3,
        funding_type: "credit",
        id: "6147068645081088",
        network: "mastercard",
        purchase_id: "6224062846074880",
        status: "paid",
        tags: [],
        transaction_ids: [
            "53962437879807990290615252629327"
        ],
        updated: ~U[2024-09-09T03:00:05.126276Z]
    },
    type: "credited",
    updated: ~U[2024-09-09T03:00:05.126321Z]
}
        

C#

Log(
    Created: 2/21/2025 12:10:48 AM,
    Type: created,
    Errors: {  },
    Installment: MerchantInstallment(
        Amount: 1000,
        Created: 2/21/2025 12:10:48 AM,
        Due: 3/24/2025 12:00:00 AM,
        Fee: 16,
        FundingType: credit,
        Network: mastercard,
        PurchaseId: 5917035389255680,
        Status: created,
        Tags: {  },
        TransactionIds: {  },
        Updated: 2/21/2025 12:10:50 AM,
        ID: 6717676390973440
    ),
    ID: 5134379646976000
)
        

Go

{
    Id: "5177774721466368",
    Installment: {
        Amount: 122,
        Created: "2024-09-06T18:37:42.445978+00:00",
        Due: "2024-09-09T03:00:00+00:00",
        Fee: 3,
        FundingType: "credit",
        Id: "6147068645081088",
        Network: "mastercard",
        PurchaseId: "6224062846074880",
        Status: "paid",
        Tags: [],
        TransactionIds: ["53962437879807990290615252629327"],
        Updated: "2024-09-09T03:00:05.126276+00:00"
    },
    Created: "2024-09-09T03:00:04.754608+00:00",
    Errors: [],
    Type: "credited",
    Updated: "2024-09-09T03:00:05.126321+00:00"
}
        

Clojure

{:created "2024-09-09T03:00:04.754608+00:00",
 :errors [],
 :id "5177774721466368",
 :installment {:amount 122,
               :created "2024-09-06T18:37:42.445978+00:00",
               :due "2024-09-09T03:00:00+00:00",
               :fee 3,
               :funding-type "credit",
               :id "6147068645081088",
               :network "mastercard",
               :purchase-id "6224062846074880",
               :status "paid",
               :tags [],
               :transaction-ids ["53962437879807990290615252629327"],
               :updated "2024-09-09T03:00:05.126276+00:00"},
 :type "credited",
 :updated "2024-09-09T03:00:05.126321+00:00"}
        

Curl

{
    "cursor": "CloKFAoHY3JlYXRlZBIJCO2hw9uorIcDEj5qGml-YXBpLW1zLWNhcmQtbWVyY2hhbnQtc2J4ciALEhNNZXJjaGFudFB1cmNoYXNlTG9nGICAgJj1qIsKDBgAIAE=",
    "logs": [
        {
            "created": "2024-09-09T03:00:04.754608+00:00",
            "errors": [],
            "id": "5177774721466368",
            "installment": {
                "amount": 122,
                "created": "2024-09-06T18:37:42.445978+00:00",
                "due": "2024-09-09T03:00:00+00:00",
                "fee": 3,
                "fundingType": "credit",
                "id": "6147068645081088",
                "network": "mastercard",
                "purchaseId": "6224062846074880",
                "status": "paid",
                "tags": [],
                "transactionIds": [
                    "53962437879807990290615252629327"
                ],
                "updated": "2024-09-09T03:00:05.126276+00:00"
            },
            "type": "credited",
            "updated": "2024-09-09T03:00:05.126321+00:00"
        }
    ]
}
    

Get a Merchant Installment Log

Get a single merchant installment log by its id.

Parameters

id REQUIRED

The unique identifier for the merchant installment that needs to be retrieved.

fields OPTIONAL

List of strings to filter response JSON keys. Not available in the SDKs.

ENDPOINT
GET /v2/merchant-installment/log/:id
REQUEST

Python

import starkbank

log = starkbank.merchantinstallment.log.get('6218715502739456')

print(log)
        

Javascript

const starkbank = require('starkbank');

(async() => {
    let log = await starkbank.merchantInstallment.log.get('5950134772826112');
    console.log(log);
})();
    

PHP

use StarkBank\MerchantInstallment\Log;

$log = Log::get("5950134772826112");

print_r($log);
        

Java

import com.starkbank.*;

MerchantInstallment.Log log = MerchantInstallment.Log.get("5950134772826112");

System.out.println(log);
        

Ruby

require 'starkbank'

log = StarkBank::MerchantInstallment::Log.get('5350139703066624')

puts log
        

Elixir

{:ok, log} = StarkBank.MerchantInstallment.Log.get("5950134772826112")
IO.inspect(log)
        

C#

using System;

MerchantInstallment.Log log = MerchantInstallment.Log.Get("6260279553818624");

Console.WriteLine(log);
        

Go

package main

import (
    "fmt"
    "github.com/starkbank/sdk-go/starkbank"
    "github.com/starkbank/sdk-go/starkbank/merchantInstallment/log"
)

func main() {

    log, err := log.Get("5950134772826112", nil)
    if err.Errors != nil {
        for _, e := range err.Errors {
            fmt.Printf("code: %s, message: %s", e.Code, e.Message)
        }
    }

    fmt.Printf("%+v", log)
}
        

Clojure

(let [log (merchant-installment.log/get "5950134772826112")]

(println log))
        

Curl

curl --location --request GET '{{baseUrl}}/v2/merchant-installment/log/5950134772826112' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}' 
--header 'Content-Type: application/json' 
    
RESPONSE

Python

Log(
    created=2025-02-20 21:05:03.520701,
    errors=[],
    id=6218715502739456,
    installment=MerchantInstallment(
        amount=5000,
        created=2025-02-20 21:05:03.515855,
        due=2025-03-21 03:00:00,
        fee=60,
        funding_type=credit,
        id=5092815595896832,
        network=mastercard,
        purchase_id=6332003586670592,
        status=created,
        tags=[],
        transaction_ids=[],
        updated=2025-02-20 21:05:04.705022
    ),
    type=created,
    updated=2025-02-20 21:05:04.720418
)
        

Javascript

MerchantInstallment.Log: {
    created: '2024-09-09T03:00:04.754608+00:00',
    errors: [],
    id: '5950134772826112',
    installment: {
        amount: 122,
        created: '2024-09-06T18:37:42.445978+00:00',
        due: '2024-09-09T03:00:00+00:00',
        fee: 3,
        fundingType: 'credit',
        id: '6147068645081088',
        network: 'mastercard',
        purchaseId: '6224062846074880',
        status: 'paid',
        tags: [],
        transactionIds: [
            '53962437879807990290615252629327'
        ],
        updated: '2024-09-09T03:00:05.126276+00:00'
    },
    type: 'credited',
    updated: '2024-09-09T03:00:05.126321+00:00'
}
    

PHP

StarkBank\MerchantInstallment\Log
(
    [created] => DateTime Object
        (
            [date] => 2024-09-09T03:00:04.754608+00:00
            [timezone_type] => 1
            [timezone] => +00:00
        )
    [errors] => Array
        (
        )
    [id] => 5950134772826112
    [installment] => StarkBank\Installment Object
        (
            [amount] => 122
            [created] => 2024-09-06T18:37:42.445978+00:00
            [due] => 2024-09-09T03:00:00+00:00
            [fee] => 3
            [fundingType] => credit
            [id] => 6147068645081088
            [network] => mastercard
            [purchaseId] => 6224062846074880
            [status] => paid
            [tags] => Array
                (
                )
            [transactionIds] => Array
                (
                    [0] => 53962437879807990290615252629327
                )
            [updated] => 2024-09-09T03:00:05.126276+00:00
        )
    [type] => credited
    [updated] => DateTime Object
        (
            [date] => 2024-09-09T03:00:05.126321+00:00
            [timezone_type] => 1
            [timezone] => +00:00
        )
)
        

Java

MerchantInstallment.Log({
    "created": "2024-09-09T03:00:04.754608+00:00",
    "errors": [],
    "id": "5950134772826112",
    "installment": {
        "amount": 122,
        "created": "2024-09-06T18:37:42.445978+00:00",
        "due": "2024-09-09T03:00:00+00:00",
        "fee": 3,
        "fundingType": "credit",
        "id": "6147068645081088",
        "network": "mastercard",
        "purchaseId": "6224062846074880",
        "status": "paid",
        "tags": [],
        "transactionIds": [
            "53962437879807990290615252629327"
        ],
        "updated": "2024-09-09T03:00:05.126276+00:00"
    },
    "type": "credited",
    "updated": "2024-09-09T03:00:05.126321+00:00"
})
        

Ruby

log(
    id: 5350139703066624,
    created: 2025-02-21T00:00:33+00:00,
    type: paid,
    errors: [],
    installment: merchantinstallment(
        id: 6195208878292992,
        amount: 1000,
        fundingType: credit,
        purchaseId: 6224062846074880,
        due: 2025-04-22T03:00:00+00:00,
        created: 2025-02-20T21:55:23+00:00,
        fee: 34,
        network: hipercard,
        status: paid,
        tags: [],
        transactionIds: ["53962437879807990290615252629327"],
        updated: 2025-02-21T00:00:40+00:00
    )
)
        

Elixir

%MerchantInstallment.Log{
    created: ~U[2024-09-09T03:00:04.754608Z],
    errors: [],
    id: "5950134772826112",
    installment: %{
        amount: 122,
        created: ~U[2024-09-06T18:37:42.445978Z],
        due: ~U[2024-09-09T03:00:00Z],
        fee: 3,
        funding_type: "credit",
        id: "6147068645081088",
        network: "mastercard",
        purchase_id: "6224062846074880",
        status: "paid",
        tags: [],
        transaction_ids: [
            "53962437879807990290615252629327"
        ],
        updated: ~U[2024-09-09T03:00:05.126276Z]
    },
    type: "credited",
    updated: ~U[2024-09-09T03:00:05.126321Z]
}
        

C#

Log(
    Created: 2/21/2025 12:10:48 AM,
    Type: created,
    Errors: {  },
    Installment: MerchantInstallment(
        Amount: 1000,
        Created: 2/21/2025 12:10:48 AM,
        Due: 4/22/2025 12:00:00 AM,
        Fee: 16,
        FundingType: credit,
        Network: mastercard,
        PurchaseId: 5917035389255680,
        Status: created,
        Tags: {  },
        TransactionIds: {  },
        Updated: 2/21/2025 12:10:51 AM,
        ID: 4571429693554688
    ),
    ID: 6260279553818624
)
        

Go

{
    Id: "5950134772826112"
    Installment: {
        Amount: 122
        Created: "2024-09-06T18:37:42.445978+00:00"
        Due: "2024-09-09T03:00:00+00:00"
        Fee: 3
        FundingType: "credit"
        Id: "6147068645081088"
        Network: "mastercard"
        PurchaseId: "6224062846074880"
        Status: "paid"
        Tags: []
        TransactionIds: ["53962437879807990290615252629327"]
        Updated: "2024-09-09T03:00:05.126276+00:00"
    }
    Created: "2024-09-09T03:00:04.754608+00:00"
    Errors: []
    Type: "credited"
    Updated: "2024-09-09T03:00:05.126321+00:00"
}
        

Clojure

{:created "2024-09-09T03:00:04.754608+00:00",
 :errors [],
 :id "5950134772826112",
 :installment {:amount 122,
               :created "2024-09-06T18:37:42.445978+00:00",
               :due "2024-09-09T03:00:00+00:00",
               :fee 3,
               :funding-type "credit",
               :id "6147068645081088",
               :network "mastercard",
               :purchase-id "6224062846074880",
               :status "paid",
               :tags [],
               :transaction-ids ["53962437879807990290615252629327"],
               :updated "2024-09-09T03:00:05.126276+00:00"},
 :type "credited",
 :updated "2024-09-09T03:00:05.126321+00:00"}
        

Curl

{
    "log": {
        "created": "2024-09-09T03:00:04.754608+00:00",
        "errors": [],
        "id": "5950134772826112",
        "installment": {
            "amount": 122,
            "created": "2024-09-06T18:37:42.445978+00:00",
            "due": "2024-09-09T03:00:00+00:00",
            "fee": 3,
            "fundingType": "credit",
            "id": "6147068645081088",
            "network": "mastercard",
            "purchaseId": "6224062846074880",
            "status": "paid",
            "tags": [],
            "transactionIds": [
                "53962437879807990290615252629327"
            ],
            "updated": "2024-09-09T03:00:05.126276+00:00"
        },
        "type": "credited",
        "updated": "2024-09-09T03:00:05.126321+00:00"
    }
}
    

Transfer

Transfers are used to send money to any bank account in Brazil using the Ted or Pix systems.

Here we will show you how to create and manage them.

Transfer Status

Each transfer has a status that can change over time according to its life cycle: transfer-status

Transfer Log

Every time we change a transfer, we create a log. Logs are pretty useful for understanding the life cycle of each transfer. Check out this diagram to understand the possible transfer events:

transfer-log

A paid transfer can be either partially or fully reversed back to its payer. Multiple reversals can be made for the same transfer and each time, the following flow of logs will occur:

transfer-reversal

The Transfer object

Attributes

id STRING

Unique id for the transfer.

accountNumber STRING

Receiver bank account number.

accountType STRING

Receiver bank account type. Options: "checking", "savings", "salary", "payment".

amount INTEGER

Amount in cents to be transferred. Example: 100 (R$1.00).

bankCode STRING

Receiver bank code or ISPB.

branchCode STRING

Receiver bank account branch.

created STRING

Creation datetime. Example: "2020-04-23T23:00:00.000000+00:00".

description STRING

Text displayed in the bank statement.

displayDescription STRING

Description shown in the receiver bank interface.

externalId STRING

Unique external ID to prevent duplicates.

fee INTEGER

Fee charged in cents.

name STRING

Receiver full name.

rules LIST OF OBJECTS

List of rule objects with key and value.

scheduled STRING

Scheduled payment datetime. Example: "2020-04-23T23:00:00.000000+00:00".

status STRING

Current transfer status. Options: "created", "processing", "confirmed", "success", "failed", "canceled".

tags LIST OF STRINGS

Tags associated with the transfer.

taxId STRING

Receiver CPF or CNPJ.

transactionIds LIST OF STRINGS

Ledger transaction IDs linked to the transfer.

updated STRING

Last update datetime. Example: "2020-04-23T23:00:00.000000+00:00".

Create Transfers

This route is used to send your transfers to their receivers.

You can create up to 100 transfers in a single request.

Parameters

accountNumber REQUIRED

Receiver bank account number. Use "-" before the validation digit. Example: 876543-2.

amount REQUIRED

A positive integer that represents the amount in cents to be transferred. Example: 100 (R$1.00)

bankCode REQUIRED

Besides informing the receiver bank, this parameter specifies whether this will be a Pix or a Ted transfer. If you wish to send a Pix, pass the bank ISPB (8 digits). Example: 20018183 = StarkBank. If you wish to send a Ted, pass the usual bank code (1 to 3 digits). Example: 665 = Stark

branchCode REQUIRED

Receiver bank account branch. Use "-" in case there is a validation digit. Example: 1234-5

name REQUIRED

Receiver full name. Example: "Joana da Silva"

taxId REQUIRED

Receiver CPF (11 digits formatted or unformatted) or CNPJ (14 digits formatted or unformatted). Example: 012.345.678-90

accountType OPTIONAL

Receiver bank account type. Options are "checking", "payment", "savings" and "salary". "checking" is the default. This parameter only has effect on Pix Transfers.

description OPTIONAL

Optional description to override default description to be shown in the bank statement. Example: "Payment for service #1234"

displayDescription OPTIONAL

Description to be shown in the receiver bank interface. ex: "Payment for service #1234"

externalId OPTIONAL

Unique ID to prevent duplicate transfers. Repeated externalIds should cause failures by duplication. By default, it blocks transfers to the same bank account with the same amount on the same day. Example: "my-internal-id-123456"

rules OPTIONAL

List of rules for modifying transfer behavior. Example:

[
    {
        "key": "resendingLimit",
        "value": 5
    }
]

scheduled OPTIONAL

Schedule the transfer for a specific date. Today is the default. Ted Transfer's schedules for today will be accepted until 16:00 (BRT) and will be pushed to the next business day afterwards. Pix Transfers are available 24/7 and can be scheduled for any date and time. Example: "2020-08-14T15:23:26+00:00" or "2020-08-14"

tags OPTIONAL

Array of strings to tag the entity for future queries. All tags will be converted to lowercase.

ENDPOINT
POST /v2/transfer
REQUEST

Python

import starkbank

transfers = starkbank.transfer.create([
    starkbank.Transfer(
        amount=1000000,
        tax_id="123.456.789-10",
        name="Daenerys Targaryen Stormborn",
        bank_code="20018183",
        branch_code="2201",
        account_number="76543-8",
        external_id="my-external-id",
        scheduled="2020-08-14",
        tags=["daenerys", "invoice/1234"],
        rules=[
            starkbank.transfer.Rule(
                key="resendingLimit",
                value=5
            )
        ]
    )
])

for transfer in transfers:
    print(transfer)
  

Javascript

const starkbank = require('starkbank');

(async() => {
    let transfers = await starkbank.transfer.create([
        {
            amount: 1000000,
            bankCode: '20018183',
            branchCode: '2201',
            accountNumber: '10000-0',
            taxId: '123.456.789-10',
            name: 'Daenerys Targaryen Stormborn',
            externalId: 'my-external-id',
            scheduled: '2020-08-14',
            tags: ['daenerys', 'invoice/1234'],
            displayDescription: 'Payment for service #1234',
            rules: [
                {
                    key: 'resendingLimit',
                    value: 5
                }
            ]
        }
    ])

    for (let transfer of transfers) {
        console.log(transfer);
    }
})();
  

PHP

$transfers = StarkBank\Transfer::create([
    new StarkBank\Transfer([
        "amount" => 1000000,
        "bankCode" => "20018183",
        "branchCode" => "2201",
        "accountNumber" => "10000-0",
        "taxId" => "123.456.789-10",
        "name" => "Daenerys Targaryen Stormborn",
        "externalId" => "my-external-id",
        "scheduled" => "2020-08-14",
        "tags" => ["daenerys", "invoice/1234"],
        "rules" => [
            new StarkBank\Transfer\Rule([
                "key" => "resendingLimit",
                "value" => 5
            ])
        ]
    ])
]);

foreach($transfers as $transfer){
    print_r($transfer);
}
  

Java

import com.starkbank.*;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

List<Transfer> transfers = new ArrayList<>();

List<Transfer.Rule> rules = new ArrayList<>();
rules.add(new Transfer.Rule("resendingLimit", 5));

HashMap<String, Object> data = new HashMap<>();
data.put("amount", 1000000);
data.put("bankCode", "20018183");
data.put("branchCode", "2201");
data.put("accountNumber", "10000-0");
data.put("taxId", "123.456.789-10");
data.put("name", "Daenerys Targaryen Stormborn");
data.put("externalId", "my-external-id");
data.put("scheduled", "2020-08-14");
data.put("tags", new String[]{"daenerys", "invoice/1234"});
data.put("rules", rules);
transfers.add(new Transfer(data));

transfers = Transfer.create(transfers);

for (Transfer transfer : transfers){
    System.out.println(transfer);
}
  

Ruby

require('starkbank')

transfers = StarkBank::Transfer.create(
    [
        StarkBank::Transfer.new(
            amount: 1000000,
            bank_code: '20018183',
            branch_code: '2201',
            account_number: '10000-0',
            tax_id: '123.456.789-10',
            name: 'Daenerys Targaryen Stormborn',
            external_id: 'my-external-id',
            scheduled: "2020-08-14",
            tags: %w[daenerys invoice/1234],
            rules: [
                StarkBank::Transfer::Rule.new(
                    key: 'resendingLimit',
                    value: 5
                )
            ]
        )
    ]
)

transfers.each do |transfer|
    puts transfer
end
  

Elixir

transfers = StarkBank.Transfer.create!([
    %StarkBank.Transfer{
        amount: 1000000,
        bank_code: "20018183",
        branch_code: "2201",
        account_number: "10000-0",
        tax_id: "123.456.789-10",
        name: "Daenerys Targaryen Stormborn",
        external_id: "my-external-id",
        scheduled: "2020-08-14",
        tags: ["daenerys", "invoice/1234"]
        rules: [
        %StarkBank.Transfer.Rule{
            key: "resendingLimit",
            value: 5
            }
        ]
    }
])

for transfer <- transfers do
    transfer |> IO.inspect
end
  

C#

using System;
using System.Collections.Generic;

List<StarkBank.Transfer> transfers = StarkBank.Transfer.Create(
    new List<StarkBank.Transfer> {
        new StarkBank.Transfer(
            amount: 1000000,
            bankCode: "20018183",
            branchCode: "2201",
            accountNumber: "10000-0",
            taxID: "123.456.789-10",
            name: "Daenerys Targaryen Stormborn",
            externalID: "my-external-id",
            scheduled: DateTime.Today.Date.AddDays(1),
            tags: new List<string> { "daenerys", "invoice/1234" },
            rules: new List<Transfer.Rule>
            {
                new Transfer.Rule(
                    key: "resendingLimit",
                    value: 5
                )
            }
        )
    }
);

foreach(StarkBank.Transfer transfer in transfers)
{
    Console.WriteLine(transfer);
}
  

Go

package main

import (
    "fmt"
    "github.com/starkbank/sdk-go/starkbank/transfer"
)

func main() {

    scheduled := time.Date(2020, 08, 14, 0, 0, 0, 0, time.UTC)

    transfers, err := transfer.Create(
        []transfer.Transfer{
            {
                Amount:        1000000,
                Name:          "Daenerys Targaryen Stormborn",
                TaxId:         "123.456.789-10",
                BankCode:      "20018183",
                BranchCode:    "2201",
                AccountNumber: "10000-0",
                ExternalId:    "my-external-id",
                Scheduled:     &scheduled,
                Tags:          []string{"daenerys", "invoice/1234"},
                Rules:         []rule.Rule{{Key: "resendingLimit", Value: 5}},
            },
        }, nil)
    if err.Errors != nil {
        for _, e := range err.Errors {
            fmt.Printf("code: %s, message: %s", e.Code, e.Message)
        }
    }

    for _, transfer := range transfers {
        fmt.Printf("%+v", transfer)
    }
}
  

Clojure

(def transfers
  (starkbank.transfer/create
    [
      {
        :amount 1000000
        :bank-code "20018183"
        :branch-code "2201"
        :account-number "10000-0"
        :tax-id "123.456.789-10"
        :name "Daenerys Targaryen Stormborn"
        :external-id: "my-external-id"
        :tags ["daenerys" "invoice/1234"]
        :scheduled (date/future-datetime)
      }
    ]))
(dorun (map println transfers))
  

Curl

curl --location --request POST '{{baseUrl}}/v2/transfer' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}' 
--header 'Content-Type: application/json' 
--data-raw '{
    "transfers": [
        {
            "amount": 1000000,
            "taxId": "123.456.789-10",
            "name": "Daenerys Targaryen Stormborn",
            "bankCode": "20018183",
            "branchCode": "2201",
            "accountNumber": "10000-0",
            "externalId": "my-external-id",
            "scheduled": "2020-08-14",
            "tags": ["daenerys", "invoice/1234"],
            "displayDescription": "Payment for service #1234",
            "rules": [
                {
                    "key": "resendingLimit",
                    "value": 5
                }
            ]
        },
    ]
}'
  
RESPONSE

Python

Transfer(
    account_number=76543-8,
    account_type=checking,
    amount=1000000,
    bank_code=20018183,
    branch_code=2201,
    created=2020-02-06 16:22:24.664134,
    description=Daenerys Targaryen Stormborn (594.739.480-42),
    external_id=my-external-id,
    fee=0,
    id=5412038532661248,
    name=Daenerys Targaryen Stormborn,
    rules=[
        Rule(
            key=resendingLimit,
            value=5
        )
    ],
    scheduled=2020-08-14 10:00:00,
    status=created,
    tags=['daenerys', 'invoice/1234'],
    tax_id=123.456.789-10,
    transaction_ids=[],
    updated=2020-02-06 16:22:24.664148
)
  

Javascript

Transfer {
    id: '5412038532661248',
    amount: 1000000,
    name: 'Daenerys Targaryen Stormborn',
    taxId: '276.685.415-00',
    bankCode: '20018183',
    branchCode: '2201',
    accountNumber: '76543-8',
    accountType: 'checking',
    externalId: 'my-external-id',
    scheduled: '2023-08-14T10:00:00+00:00',
    description: 'Daenerys Targaryen Stormborn (594.739.480-42)',
    tags: [ 'daenerys', 'invoice/1234' ],
    displayDescription: 'Payment for service #1234',
    rules: [
        {
            key: 'resendingLimit',
            value: 5
        }
    ],
    fee: 0,
    status: 'created',
    created: '2020-02-06T16:22:24.664148+00:00',
    updated: '2020-02-06T16:22:24.664148+00:00',
    transactionIds: []
}
  

PHP

StarkBank\Transfer Object
(
    [id] => 5412038532661248
    [amount] => 1000000
    [name] => Daenerys Targaryen Stormborn
    [taxId] => 594.739.480-42
    [bankCode] => 20018183
    [branchCode] => 2201
    [accountNumber] => 76543-8
    [accountType] => checking
    [externalId] => my-external-id
    [scheduled] => DateTime Object
        (
            [date] => 2023-08-14 10:00:00.000000
            [timezone_type] => 1
            [timezone] => +00:00
        )

    [description] => Daenerys Targaryen Stormborn (594.739.480-42)
    [tags] => Array
        (
            [0] => daenerys
            [1] => invoice/1234
        )

    [rules] => Array
        (
            [0] => StarkBank\Transfer\Rule Object
                (
                    [key] => resendingLimit
                    [value] => 5
                )

        )

    [fee] => 0
    [status] => created
    [transactionIds] => Array
        (
        )

    [created] => DateTime Object
        (
            [date] => 2020-02-06 16:22:24.664148
            [timezone_type] => 1
            [timezone] => +00:00
        )

    [updated] => DateTime Object
        (
            [date] => 2020-02-06 16:22:24.664148
            [timezone_type] => 1
            [timezone] => +00:00
        )

)
  

Java

Transfer({
    "amount": 1000000,
    "name": "Daenerys Targaryen Stormborn",
    "taxId": "594.739.480-42",
    "bankCode": "20018183",
    "branchCode": "2201",
    "accountNumber": "76543-8",
    "accountType": "checking",
    "externalId": "my-external-id",
    "scheduled": "2023-08-14T10:00:00+00:00",
    "description": "Daenerys Targaryen Stormborn (594.739.480-42)",
    "tags": [
        "daenerys",
        "invoice/1234"
    ],
    "rules": [
        {
            "key": "resendingLimit",
            "value": 5
        }
    ],
    "fee": 0,
    "status": "created",
    "transactionIds": [],
    "created": "2020-02-06T16:22:24.664148+00:00",
    "updated": "2020-02-06T16:22:24.664148+00:00",
    "id": "5412038532661248"
})
  

Ruby

transfer(
    id: 5412038532661248,
    amount: 1000000,
    name: Daenerys Targaryen Stormborn,
    tax_id: 594.739.480-42,
    bank_code: 20018183,
    branch_code: 2201,
    account_number: 76543-8,
    account_type: checking,
    external_id: my-external-id,
    scheduled: 2023-08-14T10:00:00+00:00,
    description: Daenerys Targaryen Stormborn (594.739.480-42),
    tags: ["daenerys", "invoice/1234"],
    rules: [
        rule(
            key: resendingLimit,
            value: 5
        )
    ],
    fee: 0,
    status: created,
    transaction_ids: [],
    created: 2020-02-06T16:22:24+00:00,
    updated: 2020-02-06T16:22:24+00:00
)
  

Elixir

%StarkBank.Transfer {
    account_number: "76543-8",
    account_type: "checking",
    amount: 1000000,
    bank_code: "20018183",
    branch_code: "2201",
    created: ~U[2020-02-06 16:22:24.664148Z],
    external_id: "my-external-id",
    fee: 200,
    id: "5412038532661248",
    name: "Daenerys Targaryen Stormborn",
    status: "created",
    scheduled: ~U[2020-08-14 11:00:00Z],
    rules: %Transfer.Rule[
        %{
            "key" => "resendingLimit",
            "value" => 5
        }
    ],
    description: "Daenerys Targaryen Stormborn (594.739.480-42)",
    tags: ["daenerys", "invoice/1234"],
    tax_id: "594.739.480-42",
    transaction_ids: [],
    updated: ~U[2020-02-06 16:22:24.664148Z]
}
  

C#

Transfer(
    Amount: 1000000,
    Name: Daenerys Targaryen Stormborn,
    BranchCode: 2201,
    AccountNumber: 76543-8,
    TaxID: 594.739.480-42,
    AccountType: checking,
    ExternalID: my-external-id,
    Description: Daenerys Targaryen Stormborn (594.739.480-42),
    BankCode: 20018183,
    Scheduled: 07/02/2020 07:00:00,
    Tags: { daenerys, invoice/1234 },
    Rules: {
        Rule(
            Key: resendingLimit,
            Value: 5
        )
    },
    Status: created,
    Fee: 0,
    TransactionIds: {  },
    Created: 06/02/2020 16:22:24,
    Updated: 06/02/2020 16:22:24,
    ID: 5412038532661248
)
  

Go

{
    Id:5412038532661248
    Amount:1000000
    Name:Daenerys Targaryen Stormborn,
    TaxId:330.731.970-10
    BankCode:20018183
    BranchCode:2201
    AccountNumber:76543-8
    AccountType:checking
    ExternalId:my-external-id
    Scheduled:2023-02-06 10:00:00 +0000 +0000
    Description:Daenerys Targaryen Stormborn (594.739.480-42)
    Tags:[daenerys invoice/1234]
    Rules:[
        {
            Key:resendingLimit
            Value:5
        }
    ]
    Fee:0
    Status:created
    TransactionIds:[]
    Created:2020-02-06 16:22:24.664148 +0000 +0000
    Updated:2020-02-06 16:22:24.664148 +0000 +0000
}
  

Clojure

{:amount 1000000,
 :fee 200,
 :tags ["daenerys" "invoice/1234"],
 :branch-code "2201",
 :updated "2020-02-06T16:22:24.664148+00:00",
 :name "Daenerys Targaryen Stormborn",
 :description "Daenerys Targaryen Stormborn (594.739.480-42)",
 :tax-id "594.739.480-42",
 :created "2020-02-06T16:22:24.664148+00:00",
 :status "created",
 :id "5412038532661248",
 :transaction-ids [],
 :account-number "76543-8",
 :bank-code "20018183",
 :account-type: "checking",
 :external-id: "my-external-id"}
  

Curl

{
    "message": "Transfer(s) successfully created",
    "transfers": [
        {
            "accountNumber": "76543-8",
            "accountType": "checking",
            "amount": 1000000,
            "bankCode": "20018183",
            "branchCode": "2201",
            "created": "2020-02-06T16:22:24.387022+00:00",
            "description": "Daenerys Targaryen Stormborn (594.739.480-42)",
            "externalId": "my-external-id",
            "fee": 0,
            "id": "5412038532661248",
            "name": "Daenerys Targaryen Stormborn",
            "displayDescription": "Payment for service #1234",
            "rules": [
                {
                    "key": "resendingLimit",
                    "value": 5
                }
            ],
            "scheduled": "2023-08-14T10:00:00+00:00",
            "status": "created",
            "tags": [
                "daenerys",
                "invoice/1234"
            ],
            "taxId": "594.739.480-42",
            "transactionIds": [],
            "updated": "2020-02-06T16:22:24.664148+00:00"
        },
    ]
}
  

List Transfers

Here you can list and filter all transfers you have made. We return it paged.

Parameters

after OPTIONAL

Filter entities created after this date.

before OPTIONAL

Filter entities created before this date.

cursor OPTIONAL

String used to get the next batch of results. Our SDKs handle this for you.

fields OPTIONAL

List of strings to filter response JSON keys. Not available in the SDKs.

ids OPTIONAL

List of strings to get specific entities by ids.

limit OPTIONAL

Number of results per cursor. Max = 100.

sort OPTIONAL

Sort order considered in the response. Options are: "created", "-created", "updated" and "-updated". "-" means descending order. Default is "-created".

status OPTIONAL

Filter transfers by the specified status.

tags OPTIONAL

Filter entities that contain the specified tags.

taxId OPTIONAL

Filter transfers sent to the specified tax ID.

transactionIds OPTIONAL

List of transaction IDs linked to the desired transfers.

ENDPOINT
GET /v2/transfer
REQUEST

Python

import starkbank

transfers = starkbank.transfer.query(
    after="2020-04-01",
    before="2020-04-30",
)

for transfer in transfers:
    print(transfer)
  

Javascript

const starkbank = require('starkbank');

(async() => {
    let transfers = await starkbank.transfer.query({
        after: '2020-04-01',
        before: '2020-04-30',
    });

    for await (let transfer of transfers) {
        console.log(transfer);
    }
})();
  

PHP

$transfers = StarkBank\Transfer::query([
    "after" => "2020-04-01",
    "before" => "2020-04-30"
]);

foreach($transfers as $transfer){
    print_r($transfer);
}
  

Java

import com.starkbank.*;
import com.starkbank.utils.Generator;
import java.util.HashMap;

HashMap<String, Object> params = new HashMap<>();
params.put("after", "2020-04-01");
params.put("before", "2020-04-30");
Generator<Transfer> transfers = Transfer.query(params);

for (Transfer transfer : transfers){
    System.out.println(transfer);
}
  

Ruby

require('starkbank')

transfers = StarkBank::Transfer.query(
    after: '2020-04-01',
    before: '2020-04-30'
)

transfers.each do |transfer|
    puts transfer
end
  

Elixir

transfers = StarkBank.Transfer.query!(
    after: "2020-04-01",
    before: "2020-04-30"
)

for transfer <- transfers do
    transfer |> IO.inspect
end
  

C#

using System;
using System.Collections.Generic;

IEnumerable<StarkBank.Transfer> transfers = StarkBank.Transfer.Query(
    after: new DateTime(2020, 4, 1),
    before: new DateTime(2020, 4, 30)
);

foreach(StarkBank.Transfer transfer in transfers)
{
    Console.WriteLine(transfer);
}
  

Go

package main

import (
    "fmt"
    "time"
    "github.com/starkbank/sdk-go/starkbank/transfer"
)

func main() {

    var params = map[string]interface{}{}
    params["after"] = time.Date(2020, 4, 1, 0, 0, 0, 0, time.UTC)
    params["before"] = time.Date(2020, 4, 30, 0, 0, 0, 0, time.UTC)

    transfers, errorChannel := transfer.Query(params, nil)

    loop:
    for {
        select {
        case err := <-errorChannel:
            if err.Errors != nil {
                for _, e := range err.Errors {
                    fmt.Printf("code: %s, message: %s", e.Code, e.Message)
                }
            }
        case transfer, ok := <-transfers:
            if !ok {
                break loop
            }
            fmt.Printf("%+v", transfer)
        }
    }
}
  

Clojure

(def transfers
    (starkbank.transfer/query
    {
        :after "2020-04-01"
        :before "2020-04-30"
    }))

(dorun (map println transfers))
  

Curl

curl --location --request GET '{{baseUrl}}/v2/transfer?after=2020-04-01&before=2020-04-30' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}'
  
RESPONSE

Python

Transfer(
    account_number=76543-8,
    account_type=checking,
    amount=1000000,
    bank_code=665,
    branch_code=2201,
    created=2020-04-24 17:49:10.225810,
    description=Daenerys Targaryen Stormborn (594.739.480-42),
    external_id=my-external-id,
    fee=200,
    id=5950134772826112,
    name=Daenerys Targaryen Stormborn,
    rules=[
        Rule(
            key=resendingLimit,
            value=5
        )
    ],
    status=processing,
    scheduled=2020-08-14 11:00:00,
    tags=['daenerys', 'invoice/1234'],
    tax_id=594.739.480-42,
    transaction_ids=['5991715760504832'],
    updated=2020-04-24 17:49:10.225810
)
  

Javascript

Transfer {
    id: '5950134772826112',
    amount: 1000000,
    name: 'Daenerys Targaryen Stormborn',
    taxId: '594.739.480-42',
    bankCode: '665',
    branchCode: '2201',
    accountNumber: '76543-8',
    accountType: 'checking',
    externalId: 'my-external-id',
    description: 'Daenerys Targaryen Stormborn (594.739.480-42)',
    tags: [ 'daenerys', 'invoice/1234' ],
    rules: [
        {
            key: 'resendingLimit',
            value: 5
        }
    ],
    fee: 200,
    status: 'processing',
    scheduled: '2020-08-14T11:00:00+00:00',
    created: '2020-04-24T17:49:10.225810+00:00',
    updated: '2020-04-24T17:49:10.225810+00:00',
    transactionIds: [ '5991715760504832' ]
}
  

PHP

StarkBank\Transfer Object
(
    [id] => 5950134772826112
    [amount] => 1000000
    [name] => Daenerys Targaryen Stormborn
    [taxId] => 594.739.480-42
    [bankCode] => 665
    [branchCode] => 2201
    [accountNumber] => 76543-8
    [accountType] => checking
    [externalId] => my-external-id
    [description] => Daenerys Targaryen Stormborn (594.739.480-42)
    [tags] => Array
        (
            [0] => daenerys
            [1] => invoice/1234
        )

    [rules] => Array
        (
            [0] => StarkBank\Transfer\Rule Object
                (
                    [key] => resendingLimit
                    [value] => 5
                )

        )

    [fee] => 200
    [status] => processing
    [scheduled] => DateTime Object
        (
            [date] => 2020-08-14 11:00:00
            [timezone_type] => 1
            [timezone] => +00:00
        )

    [transactionIds] => Array
        (
            [0] => 5991715760504832
        )

    [created] => DateTime Object
        (
            [date] => 2020-04-24 17:49:10.225810
            [timezone_type] => 1
            [timezone] => +00:00
        )

    [updated] => DateTime Object
        (
            [date] => 2020-04-24 17:49:10.225810
            [timezone_type] => 1
            [timezone] => +00:00
        )
)
  

Java

Transfer({
    "id": "5950134772826112",
    "amount": 1000000,
    "name": "Daenerys Targaryen Stormborn",
    "taxId": "594.739.480-42",
    "bankCode": "665",
    "branch_code": "2201",
    "accountNumber": "76543-8",
    "accountType": "checking",
    "externalId": "my-external-id",
    "description": "Daenerys Targaryen Stormborn (594.739.480-42)",
    "transactionIds": ["5991715760504832"],
    "fee": 200,
    "tags": [
        "daenerys",
        "invoice/1234"
    ],
    "rules": [
        {
            "key": "resendingLimit",
            "value": 5
        }
    ],
    "status": "processing",
    "scheduled": '2020-08-14T11:00:00+00:00',
    "created": "2020-04-24T17:49:10+00:00",
    "updated": "2020-04-24T17:49:10+00:00"
})
  

Ruby

transfer(
    id: 5950134772826112,
    amount: 1000000,
    name: Daenerys Targaryen Stormborn,
    tax_id: 594.739.480-42,
    bank_code: 665,
    branch_code: 2201,
    account_number: 76543-8,
    account_type: checking,
    external_id: my-external-id,
    description: Daenerys Targaryen Stormborn (594.739.480-42),
    transaction_ids: ["5991715760504832"],
    fee: 200,
    tags: ["daenerys", "invoice/1234"],
    rules: [
        rule(
            key: resendingLimit,
            value: 5
        )
    ],
    status: processing,
    scheduled: 2020-08-14T11:00:00+00:00,
    created: 2020-04-24T17:49:10+00:00,
    updated: 2020-04-24T17:49:10+00:00
)
  

Elixir

%StarkBank.Transfer {
    account_number: "76543-8",
    account_type: "checking",
    amount: 1000000,
    bank_code: "665",
    branch_code: "2201",
    created: ~U[2020-04-24 17:49:10.225810Z],
    external_id: "my-external-id",
    fee: 200,
    id: "5950134772826112",
    name: "Daenerys Targaryen Stormborn",
    status: "processing",
    scheduled: ~U[2020-08-14 11:00:00Z],
    rules: %Transfer.Rule[
    %{"key" => "resendingLimit", "value" => 5}
    ],
    description: "Daenerys Targaryen Stormborn (594.739.480-42)",
    tags: ["daenerys", "invoice/1234"],
    tax_id: "594.739.480-42",
    transaction_ids: ["5991715760504832"],
    updated: ~U[2020-04-24 17:49:10.225810Z]
}
  

C#

Transfer(
    Amount: 1000000,
    Name: Daenerys Targaryen Stormborn,
    TaxID: 594.739.480-42,
    BankCode: 665,
    BranchCode: 2201,
    AccountNumber: 76543-8,
    AccountType: checking,
    ExternalID: my-external-id,
    Description: Daenerys Targaryen Stormborn (594.739.480-42),
    TransactionIds: { 5991715760504832 },
    Fee: 200,
    Tags: { daenerys, invoice/1234 },
    Rules: {
        Rule(
            Key: resendingLimit,
            Value: 5
        )
    },
    Status: processing,
    Scheduled: 08/14/2020 11:00:00,
    Created: 04/24/2020 17:49:10,
    Updated: 04/24/2020 17:49:10,
    ID: 5950134772826112
)
  

Go

{
    Id:5950134772826112
    Amount:1000000
    Name:Daenerys Targaryen Stormborn
    TaxId:594.739.480-42
    BankCode:665
    BranchCode:2201
    AccountNumber:76543-8
    AccountType:checking
    ExternalId:my-external-id
    Scheduled:2020-08-14 11:00:00 +0000 +0000
    Description:Daenerys Targaryen Stormborn (594.739.480-42),
    Tags:[daenerys invoice/1234]
    Rules:[
        {
            Key:resendingLimit
            Value:5
        }
    ]
    Fee:200
    Status:canceled
    TransactionIds:[5991715760504832]
    Created:2023-04-24 17:49:10.225810 +0000 +0000
    Updated:2023-04-24 17:49:10.225810 +0000 +0000
}
  

Clojure

{:amount 1000000,
 :fee 200,
 :tags ["daenerys" "invoice/1234"],
 :branch-code "2201",
 :updated "2020-04-24T17:49:10.225810+00:00",
 :name "Daenerys Targaryen Stormborn",
 :description "Daenerys Targaryen Stormborn (594.739.480-42)",
 :tax-id "594.739.480-42",
 :created "2020-04-24T17:49:10.225810+00:00",
 :status "processing",
 :id "5950134772826112",
 :transaction-ids ["5991715760504832"],
 :account-number "76543-8",
 :bank-code "665",
 :account-type: "checking",
 :external-id: "my-external-id"}
  

Curl

{
    "cursor": null,
    "transfers": [
        {
            "id": "5950134772826112",
            "status": "processing",
            "amount": 1000000,
            "name": "Daenerys Targaryen Stormborn",
            "rules": [
                {
                    "key": "resendingLimit",
                    "value": 5
                }
            ],
            "taxId": "594.739.480-42",
            "bankCode": "665",
            "branchCode": "2201",
            "accountNumber": "76543-8",
            "accountType": "checking",
            "scheduled": "2020-08-14T11:00:00+00:00",
            "tags": ["daenerys", "invoice/1234"],
            "created": "2020-04-24T17:49:10.225810+00:00",
            "description": "Daenerys Targaryen Stormborn (594.739.480-42)",
            "externalId": "my-external-id",
            "updated": "2020-04-24T17:49:10.225810+00:00",
            "transactionIds": ["5991715760504832"],
            "fee": 200,
        },
    ]
}
  

Get a Transfer

Get a single transfer by its id.

Parameters

id REQUIRED

Id of the transfer entity.

fields OPTIONAL

List of strings to filter response JSON keys. Not available in the SDKs.

ENDPOINT
GET /v2/transfer/:id
REQUEST

Python

import starkbank

transfer = starkbank.transfer.get("5950134772826112")

print(transfer)
  

Javascript

const starkbank = require('starkbank');

(async() => {
    let transfer = await starkbank.transfer.get('5950134772826112');
    console.log(transfer);
})();
  

PHP

$transfer = StarkBank\Transfer::get("5950134772826112");

print_r($transfer);
  

Java

import com.starkbank.*;

Transfer transfer = Transfer.get("5950134772826112");

System.out.println(transfer);
  

Ruby

require('starkbank')

transfer = StarkBank::Transfer.get('5950134772826112')

puts transfer
  

Elixir

transfer = StarkBank.Transfer.get!("5950134772826112")

transfer |> IO.inspect
  

C#

using System;

StarkBank.Transfer transfer = StarkBank.Transfer.Get("5950134772826112");

Console.WriteLine(transfer);
  

Go

package main

import (
    "fmt"
    "github.com/starkbank/sdk-go/starkbank/transfer"
)

func main() {

    transfer, err := transfer.Get("5950134772826112", nil)
    if err.Errors != nil {
        for _, e := range err.Errors {
            fmt.Printf("code: %s, message: %s", e.Code, e.Message)
        }
    }

    fmt.Println(transfer)
}
  

Clojure

(def transfer (starkbank.transfer/get "5950134772826112"))

(println transfer)
  

Curl

curl --location --request GET '{{baseUrl}}/v2/transfer/5950134772826112' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}'
  
RESPONSE

Python

Transfer(
    account_number=76543-8,
    account_type=checking,
    amount=1000000,
    bank_code=665,
    branch_code=2201,
    created=2020-04-24 17:49:10.225810,
    description=Daenerys Targaryen Stormborn (594.739.480-42),
    external_id=my-external-id,
    fee=200,
    id=5950134772826112,
    name=Daenerys Targaryen Stormborn,
    rules=[
        Rule(
            key=resendingLimit,
            value=5
        )
    ],
    status=processing,
    scheduled=2020-08-14 11:00:00,
    tags=['daenerys', 'invoice/1234'],
    tax_id=594.739.480-42,
    transaction_ids=['5991715760504832'],
    updated=2020-04-24 17:49:10.225810
)
  

Javascript

Transfer {
    id: '5950134772826112',
    amount: 1000000,
    name: 'Daenerys Targaryen Stormborn',
    taxId: '594.739.480-42',
    bankCode: '665',
    branchCode: '2201',
    accountNumber: '76543-8',
    accountType: 'checking',
    externalId: 'my-external-id',
    description: 'Daenerys Targaryen Stormborn (594.739.480-42)',
    tags: [ 'daenerys', 'invoice/1234' ],
    rules: [
        {
            key: 'resendingLimit',
            value: 5
        }
    ],
    fee: 200,
    status: 'processing',
    scheduled: '2020-08-14T11:00:00+00:00',
    created: '2020-04-24T17:49:10.225810+00:00',
    updated: '2020-04-24T17:49:10.225810+00:00',
    transactionIds: [ '5991715760504832' ]
}
  

PHP

StarkBank\Transfer Object
(
    [id] => 5950134772826112
    [amount] => 1000000
    [name] => Daenerys Targaryen Stormborn
    [taxId] => 594.739.480-42
    [bankCode] => 665
    [branchCode] => 2201
    [accountNumber] => 76543-8
    [accountType] => checking
    [externalId] => my-external-id
    [description] => Daenerys Targaryen Stormborn (594.739.480-42)
    [tags] => Array
        (
            [0] => daenerys
            [1] => invoice/1234
        )

    [rules] => Array
        (
            [0] => StarkBank\Transfer\Rule Object
                (
                    [key] => resendingLimit
                    [value] => 5
                )

        )

    [fee] => 200
    [status] => processing
    [scheduled] => DateTime Object
        (
            [date] => 2020-08-14 11:00:00
            [timezone_type] => 1
            [timezone] => +00:00
        )

    [transactionIds] => Array
        (
            [0] => 5991715760504832
        )

    [created] => DateTime Object
        (
            [date] => 2020-04-24 17:49:10.225810
            [timezone_type] => 1
            [timezone] => +00:00
        )

    [updated] => DateTime Object
        (
            [date] => 2020-04-24 17:49:10.225810
            [timezone_type] => 1
            [timezone] => +00:00
        )

)
  

Java

Transfer({
    "id": "5950134772826112",
    "amount": 1000000,
    "name": "Daenerys Targaryen Stormborn",
    "taxId": "594.739.480-42",
    "bankCode": "665",
    "branchCode": "2201",
    "accountNumber": "76543-8",
    "accountType": "checking",
    "externalId": "my-external-id",
    "description": "Daenerys Targaryen Stormborn (594.739.480-42)",
    "transactionIds": ["5991715760504832"],
    "fee": 200,
    "tags": [
        "daenerys",
        "invoice/1234"
    ],
    "rules": [
        {
            "key": "resendingLimit",
            "value": 5
        }
    ],
    "status": "processing",
    "scheduled": '2020-08-14T11:00:00+00:00',
    "created": "2020-04-24T17:49:10+00:00",
    "updated": "2020-04-24T17:49:10+00:00"
})
  

Ruby

transfer(
    id: 5950134772826112,
    amount: 1000000,
    name: Daenerys Targaryen Stormborn,
    tax_id: 594.739.480-42,
    bank_code: 665,
    branch_code: 2201,
    account_number: 76543-8,
    account_type: checking,
    external_id: my-external-id,
    description: Daenerys Targaryen Stormborn (594.739.480-42),
    transaction_ids: ["5991715760504832"],
    fee: 200,
    tags: ["daenerys", "invoice/1234"],
    rules: [
        rule(
            key: resendingLimit,
            value: 5
        )
    ],
    status: processing,
    scheduled: 2020-08-14T11:00:00+00:00,
    created: 2020-04-24T17:49:10+00:00,
    updated: 2020-04-24T17:49:10+00:00
)
  

Elixir

%StarkBank.Transfer {
    account_number: "76543-8",
    account_type: "checking",
    amount: 1000000,
    bank_code: "665",
    branch_code: "2201",
    created: ~U[2020-04-24 17:49:10.225810Z],
    external_id: "my-external-id",
    fee: 200,
    id: "5950134772826112",
    name: "Daenerys Targaryen Stormborn",
    status: "processing",
    scheduled: ~U[2020-08-14 11:00:00Z],
    rules: %Transfer.Rule[
    %{"key" => "resendingLimit", "value" => 5}
    ],
    description: "Daenerys Targaryen Stormborn (594.739.480-42)",
    tags: ["daenerys", "invoice/1234"],
    tax_id: "594.739.480-42",
    transaction_ids: ["5991715760504832"],
    updated: ~U[2020-04-24 17:49:10.225810Z]
}
  

C#

Transfer(
    Amount: 1000000,
    Name: Daenerys Targaryen Stormborn,
    TaxID: 594.739.480-42,
    BankCode: 665,
    BranchCode: 2201,
    AccountNumber: 76543-8,
    AccountType: checking,
    ExternalID: my-external-id,
    Description: Daenerys Targaryen Stormborn (594.739.480-42),
    TransactionIds: { 5991715760504832 },
    Fee: 200,
    Tags: { daenerys, invoice/1234 },
    Rules: {
        Rule(
            Key: resendingLimit,
            Value: 5
        )
    },
    Status: processing,
    Scheduled: 08/14/2020 11:00:00,
    Created: 04/24/2020 17:49:10,
    Updated: 04/24/2020 17:49:10,
    ID: 5950134772826112
)
  

Go

{
    Id:5950134772826112
    Amount:1000000
    Name:Daenerys Targaryen Stormborn
    TaxId:594.739.480-42
    BankCode:665
    BranchCode:2201
    AccountNumber:76543-8
    AccountType:checking
    ExternalId:my-external-id
    Scheduled:2020-08-14 11:00:00 +0000 +0000
    Description:Daenerys Targaryen Stormborn (594.739.480-42),
    Tags:[daenerys invoice/1234]
    Rules:[
        {
            Key:resendingLimit
            Value:5
        }
    ]
    Fee:200
    Status:canceled
    TransactionIds:[5991715760504832]
    Created:2023-04-24 17:49:10.225810 +0000 +0000
    Updated:2023-04-24 17:49:10.225810 +0000 +0000
}
  

Clojure

{:amount 1000000,
 :fee 200,
 :tags ["daenerys" "invoice/1234"],
 :branch-code "2201",
 :updated "2020-04-24T17:49:10.225810+00:00",
 :name "Daenerys Targaryen Stormborn",
 :description "Daenerys Targaryen Stormborn (594.739.480-42)",
 :tax-id "594.739.480-42",
 :created "2020-04-24T17:49:10.225810+00:00",
 :status "processing",
 :id "5950134772826112",
 :transaction-ids ["5991715760504832"],
 :account-number "76543-8",
 :bank-code "665",
 :account-type: "checking",
 :external-id: "my-external-id"}
  

Curl

{
    "transfer": {
        "id": "5950134772826112",
        "status": "processing",
        "amount": 1000000,
        "name": "Daenerys Targaryen Stormborn",
        "rules": [
            {
                "key": "resendingLimit",
                "value": 5
            }
        ],
        "taxId": "594.739.480-42",
        "bankCode": "665",
        "branchCode": "2201",
        "accountNumber": "76543-8",
        "accountType": "checking",
        "scheduled": "2020-08-14T11:00:00+00:00",
        "tags": ["daenerys", "invoice/1234"],
        "created": "2020-04-24T17:49:10.225810+00:00",
        "description": "Daenerys Targaryen Stormborn (594.739.480-42)",
        "externalId": "my-external-id",
        "updated": "2020-04-24T17:49:10.225810+00:00",
        "transactionIds": ["5991715760504832"],
        "fee": 200,
    }
}
  

Cancel a scheduled Transfer

Cancel a scheduled transfer. You can only cancel transfers before they start being processed.

NOTE: Canceled transfers will still appear in your queries.

Parameters

id REQUIRED

Id of the transfer entity.

ENDPOINT
DELETE /v2/transfer/:id
REQUEST

Python

import starkbank

transfer = starkbank.transfer.delete("6693962735681536")

print(transfer)
  

Javascript

const starkbank = require('starkbank');

(async() => {
    let transfer = await starkbank.transfer.delete('6693962735681536');
    console.log(transfer);
})();
  

PHP

$transfer = StarkBank\Transfer::delete("6693962735681536");

print_r($transfer);
  

Java

import com.starkbank.*;

Transfer transfer = Transfer.delete("6693962735681536");

System.out.println(transfer);
  

Ruby

require('starkbank')

transfer = StarkBank::Transfer.delete('6693962735681536')

puts transfer
  

Elixir

transfer = StarkBank.Transfer.delete!("6693962735681536")

transfer |> IO.inspect
  

C#

using System;

StarkBank.Transfer transfer = StarkBank.Transfer.Delete("6693962735681536");

Console.WriteLine(transfer);
  

Go

package main

import (
    "fmt"
    "github.com/starkbank/sdk-go/starkbank/transfer"
)

func main() {

    transfer, err := transfer.Delete("6693962735681536", nil)
    if err.Errors != nil {
        for _, e := range err.Errors {
            fmt.Printf("code: %s, message: %s", e.Code, e.Message)
        }
    }

    fmt.Println(transfer)
}
  

Clojure

(def transfer (starkbank.transfer/delete "6693962735681536"))

(println transfer)
  

Curl

curl --location --request DELETE '{{baseUrl}}/v2/transfer/6693962735681536' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}'
  
RESPONSE

Python

Transfer(
    account_number=76543-8,
    account_type=checking,
    amount=100000000,
    bank_code=665,
    branch_code=2201,
    created=2020-04-24 17:49:10.225810,
    description=Daenerys Targaryen Stormborn (594.739.480-42),
    external_id=my-external-id,
    fee=200,
    id=6693962735681536,
    name=Daenerys Targaryen Stormborn,
    rules=[
        Rule(
            key=resendingLimit,
            value=5
        )
    ],
    status=canceled,
    scheduled=2020-08-14 11:00:00,
    tags=['daenerys', 'invoice/1234'],
    tax_id=594.739.480-42,
    transaction_ids=['5991715760504832'],
    updated=2020-04-24 17:49:10.225810
)
  

Javascript

Transfer {
    id: '6693962735681536',
    amount: 100000000,
    name: 'Daenerys Targaryen Stormborn',
    taxId: '594.739.480-42',
    bankCode: '665',
    branchCode: '2201',
    accountNumber: '10000-0',
    accountType: 'checking',
    externalId: 'my-external-id',
    description: 'Daenerys Targaryen Stormborn (594.739.480-42)',
    tags: [ 'daenerys', 'invoice/1234 ],
    rules: [
        {
            key: 'resendingLimit',
            value: 5
        }
    ],
    fee: 200,
    status: 'canceled',
    scheduled: '2020-08-14T11:00:00+00:00',
    created: '2020-04-24T17:49:10.225810+00:00',
    updated: '2020-04-24T17:49:10.225810+00:00',
    transactionIds: [ '5991715760504832' ]
}
  

PHP

StarkBank\Transfer Object
(
    [id] => 6693962735681536
    [amount] => 100000000
    [name] => Daenerys Targaryen Stormborn
    [taxId] => 594.739.480-42
    [bankCode] => 665
    [branchCode] => 2201
    [accountNumber] => 76543-8
    [accountType] => checking
    [externalId] => my-external-id
    [description] => Daenerys Targaryen Stormborn (594.739.480-42)
    [tags] => Array
        (
            [0] => daenerys
            [1] => invoice/1234
        )

    [rules] => Array
        (
            [0] => StarkBank\Transfer\Rule Object
                (
                    [key] => resendingLimit
                    [value] => 5
                )

        )

    [fee] => 200
    [status] => canceled
    [scheduled] => DateTime Object
        (
            [date] => 2020-08-14 11:00:00
            [timezone_type] => 1
            [timezone] => +00:00
        )

    [transactionIds] => Array
        (
            [0] => 5991715760504832
        )

    [created] => DateTime Object
        (
            [date] => 2020-04-09 16:26:08.988538
            [timezone_type] => 1
            [timezone] => +00:00
        )

    [updated] => DateTime Object
        (
            [date] => 2020-04-09 16:26:10.280537
            [timezone_type] => 1
            [timezone] => +00:00
        )

)
  

Java

Transfer({
    "id": "6693962735681536",
    "amount": 100000000,
    "name": "Daenerys Targaryen Stormborn",
    "taxId": "594.739.480-42",
    "bankCode": "665",
    "branchCode": "2201",
    "accountNumber": "76543-8",
    "accountType": "checking",
    "externalId": "my-external-id",
    "description": "Daenerys Targaryen Stormborn (594.739.480-42)",
    "tags": [
        "daenerys",
        "invoice/1234"
    ],
    "rules": [
        {
            "key": "resendingLimit",
            "value": 5
        }
    ],
    "transactionIds": ["5991715760504832"],
    "fee": 200,
    "status": "canceled",
    "scheduled": '2020-08-14T11:00:00+00:00',
    "created": "2020-04-11T01:08:29+00:00",
    "updated": "2020-04-11T01:08:31+00:00"
})
  

Ruby

transfer(
    id: 6693962735681536,
    amount: 100000000,
    name: Daenerys Targaryen Stormborn,
    tax_id: 594.739.480-42,
    bank_code: 665,
    branch_code: 2201,
    account_number: 76543-8,
    account_type: checking,
    external_id: my-external-id,
    description: Daenerys Targaryen Stormborn (594.739.480-42),
    transaction_ids: ["5991715760504832"],
    fee: 200,
    tags: ["daenerys", "invoice/1234"],
    rules: [
        rule(
            key: resendingLimit,
            value: 5
        )
    ],
    status: canceled,
    scheduled: 2020-08-14T11:00:00+00:00,
    created: 2020-04-11T01:08:29+00:00,
    updated: 2020-04-11T01:08:31+00:00
)
  

Elixir

%StarkBank.Transfer {
    account_number: "76543-8",
    account_type: "checking",
    amount: 100000000,
    bank_code: "665",
    branch_code: "2201",
    created: ~U[2020-04-24 17:49:10.039009Z],
    external_id: "my-external-id",
    fee: 200,
    id: "6693962735681536",
    name: "Daenerys Targaryen Stormborn",
    status: "canceled",
    scheduled: ~U[2020-08-14 11:00:00Z],
    rules: %Transfer.Rule[
    %{"key" => "resendingLimit", "value" => 5}
    ],
    description: "Daenerys Targaryen Stormborn (594.739.480-42)",
    tags: ["daenerys", "invoice/1234"],
    tax_id: "594.739.480-42",
    transaction_ids: ["5991715760504832"],
    updated: ~U[2020-04-24 17:49:10.611646Z]
}
  

C#

Transfer(
    Amount: 100000000,
    Name: Daenerys Targaryen Stormborn,
    TaxID: 594.739.480-42,
    BankCode: 665,
    BranchCode: 2201,
    AccountNumber: 76543-8,
    AccountType: checking,
    ExternalID: my-external-id,
    Description: Daenerys Targaryen Stormborn (594.739.480-42),
    TransactionIds: { 5991715760504832 },
    Fee: 200,
    Tags: { daenerys, invoice/1234 },
    Rules: {
        Rule(
            Key: resendingLimit,
            Value: 5
        )
    },
    Status: canceled,
    Scheduled: 08/14/2020 11:00:00,
    Created: 04/14/2020 17:49:10,
    Updated: 04/14/2020 17:49:10,
    ID: 6693962735681536
)
  

Go

{
    Id:6693962735681536
    Amount:100000000
    Name:Daenerys Targaryen Stormborn
    TaxId:594.739.480-42
    BankCode:001
    BranchCode:1234
    AccountNumber:123456-0
    AccountType:checking
    ExternalId:my-external-id
    Scheduled:2020-08-14 11:00:00 +0000 +0000
    Description:Daenerys Targaryen Stormborn (594.739.480-42)
    Tags:[daenerys invoice/1234]
    Rules:[
        {
            Key:resendingLimit
            Value:5
        }
    ]
    Fee:200
    Status:canceled
    TransactionIds:[5991715760504832]
    Created:2020-04-24 17:49:10.611646Z +0000 +0000
    Updated:2020-04-24 17:49:10.611646Z +0000 +0000
}
  

Clojure

{
    :amount 100000000,
    :fee 200,
    :tags [daenerys invoice/1234],
    :branch-code 0001,
    :updated 2020-04-24T17:49:10.225810+00:00,
    :name Daenerys Targaryen Stormborn,
    :description "Daenerys Targaryen Stormborn (594.739.480-42)",
    :tax-id 012.345.678-90,
    :created 2020-12-05T01:08:39.415347+00:00,
    :status canceled,
    :id 6693962735681536,
    :scheduled 2020-08-14T11:00:0.000000+00:00,
    :transaction-ids [5991715760504832],
    :account-number 00000-0,
    :bank-code 60701190,
    :account-type: "checking",
    :external-id: "my-external-id"
}
  

Curl

{
    "transfer": {
        "id": "6693962735681536",
        "status": "canceled",
        "amount": 100000000,
        "name": "Daenerys Targaryen Stormborn",
        "rules": [
            {
                "key": "resendingLimit",
                "value": 5
            }
        ],
        "taxId": "594.739.480-42",
        "bankCode": "665",
        "branchCode": "2201",
        "accountNumber": "76543-8",
        "accountType": "checking",
        "scheduled": "2020-08-14T11:00:00+00:00",
        "tags": ["daenerys", "invoice/1234"],
        "created": "2020-03-25T19:59:02.130246+00:00",
        "description": "Daenerys Targaryen Stormborn (594.739.480-42)",
        "externalId": "my-external-id",
        "updated": "2020-04-24T17:49:10.225810+00:00",
        "transactionIds": ["5991715760504832"],
        "fee": 200,
    }
}
  

Get a Transfer PDF

Get a PDF from a single transfer by its id.

Parameters

id REQUIRED

Id of the transfer entity.

ENDPOINT
GET /v2/transfer/:id/pdf
REQUEST

Python

import starkbank

pdf = starkbank.transfer.pdf("5646210941583360")

with open("transfer.pdf", "wb") as file:
    file.write(pdf)
  

Javascript

const starkbank = require('starkbank');
const fs = require('fs').promises;

(async() => {
    let pdf = await starkbank.transfer.pdf('5646210941583360');
    await fs.writeFile('transfer.pdf', pdf);
})();
  

PHP

$pdf = StarkBank\Transfer::pdf("5646210941583360");

$fp = fopen('transfer.pdf', 'w');
fwrite($fp, $pdf);
fclose($fp);
  

Java

import java.io.File;
import java.io.InputStream;
import java.nio.file.StandardCopyOption;
import com.starkbank.*;

InputStream pdf = Transfer.pdf("5646210941583360");

java.nio.file.Files.copy(
    pdf,
    new File("transfer.pdf").toPath(),
    StandardCopyOption.REPLACE_EXISTING
);
  

Ruby

require('starkbank')

pdf = StarkBank::Transfer.pdf('5646210941583360')

File.open('transfer.pdf', 'w') { |file| file.write(pdf) }
  

Elixir

pdf = StarkBank.Transfer.pdf!("5646210941583360")

file = File.open!("transfer.pdf", [:write])
IO.binwrite(file, pdf)
File.close(file)
  

C#

byte[] pdf = Transfer.Pdf("5646210941583360");

System.IO.File.WriteAllBytes("transfer.pdf", pdf);
  

Go

package main

import (
    "fmt"
    "github.com/starkbank/sdk-go/starkbank/transfer"
    "io/ioutil"
)

func main() {

    pdf, err := transfer.Pdf("5646210941583360", nil)
    if err.Errors != nil {
        for _, e := range err.Errors {
            fmt.Printf("code: %s, message: %s", e.Code, e.Message)
        }
    }

    errFile := ioutil.WriteFile("transfer.pdf", pdf, 0666)
    if errFile != nil {
        fmt.Print(errFile)
    }
}
  

Clojure

(clojure.java.io/copy
    (starkbank.transfer/pdf "5646210941583360")
    (clojure.java.io/file "transfer.pdf"))
  

Curl

curl --location --request GET '{{baseUrl}}/v2/transfer/5646210941583360/pdf' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}'
  

List Transfer Logs

Get a paged list of all transfer logs. A log tracks a change in the transfer entity according to its life cycle.

Parameters

after OPTIONAL

Filter entities created after this date.

before OPTIONAL

Filter entities created before this date.

cursor OPTIONAL

String used to get the next batch of results. Our SDKs handle this for you.

fields OPTIONAL

List of strings to filter response JSON keys. Not available in the SDKs.

limit OPTIONAL

Number of results per cursor. Max = 100.

transferIds OPTIONAL

Array of transfer ids that are linked to the logs you desire.

types OPTIONAL

Filters logs by log types.

ENDPOINT
GET /v2/transfer/log
REQUEST

Python

import starkbank

logs = starkbank.transfer.log.query(
    after="2020-04-01",
    before="2020-04-30"
)

for log in logs:
    print(log)
  

Javascript

const starkbank = require('starkbank');

(async() => {
    let logs = await starkbank.transfer.log.query({
        after: '2020-04-01',
        before: '2020-04-30',
    });

    for await (let log of logs) {
        console.log(log);
    }
})();
  

PHP

$logs = StarkBank\Transfer\Log::query([
    "after" => "2020-04-01",
    "before" => "2020-04-30"
]);

foreach($logs as $log){
    print_r($log);
}
  

Java

import com.starkbank.*;
import com.starkbank.utils.Generator;
import java.util.HashMap;

HashMap<String, Object> params = new HashMap<>();
params.put("after", "2020-04-01");
params.put("before", "2020-04-30");
Generator<Transfer.Log> logs = Transfer.Log.query(params);

for (Transfer.Log log : logs){
    System.out.println(log);
}
  

Ruby

require('starkbank')

logs = StarkBank::Transfer::Log.query(
    after: '2020-04-01',
    before: '2020-04-30'
)

logs.each do |log|
    puts log
end
  

Elixir

logs = StarkBank.Transfer.Log.query!(
    after: "2020-04-01",
    before: "2020-04-30"
)

for log <- logs do
    log |> IO.inspect
end
  

C#

using System;
using System.Collections.Generic;

IEnumerable<StarkBank.Transfer.Log> logs = StarkBank.Transfer.Log.Query(
    after: new DateTime(2020, 4, 1),
    before: new DateTime(2020, 4, 30)
);

foreach(StarkBank.Transfer.Log log in logs)
{
    Console.WriteLine(log);
}
  

Go

package main

import (
    "fmt"
    "time"
    "github.com/starkbank/sdk-go/starkbank/transfer/log"
)

func main() {

    var params = map[string]interface{}{}
    params["after"] = time.Date(2020, 4, 1, 0, 0, 0, 0, time.UTC)
    params["before"] = time.Date(2020, 4, 30, 0, 0, 0, 0, time.UTC)

    logs, errorChannel := log.Query(params, nil)

    loop:
    for {
        select {
        case err := <-errorChannel:
            if err.Errors != nil {
                for _, e := range err.Errors {
                    fmt.Printf("code: %s, message: %s", e.Code, e.Message)
                }
            }
        case log, ok := <-logs:
            if !ok {
                break loop
            }
            fmt.Printf("%+v", log)
        }
    }
}
  

Clojure

(def logs
  (starkbank.transfer.log/query
    {
      :after "2020-04-01"
      :before "2020-04-30"
    }))
(dorun (map println logs))
  

Curl

curl --location --request GET '{{baseUrl}}/v2/transfer/log??after=2020-04-01&before=2020-04-30' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}'
  
RESPONSE

Python

Log(
    id=5662318377566208,
    created=2020-04-24 17:49:09.348444,
    errors=[],
    type=sending,
    transfer=Transfer(
        id=5950134772826112,
        account_number=76543-8,
        account_type=checking,
        amount=100000000,
        bank_code=665,
        branch_code=2201,
        created=2020-04-24 17:49:08.748893,
        description=Daenerys Targaryen Stormborn (594.739.480-42),
        external_id=my-external-id,
        fee=200,
        name=Daenerys Targaryen Stormborn,
        rules=[
            Rule(
                key=resendingLimit,
                value=5
            )
        ],
        status=processing,
        scheduled=2020-08-14 11:00:00,
        tags=['daenerys', 'invoice/1234'],
        tax_id=594.739.480-42,
        transaction_ids=['5991715760504832'],
        updated=2020-04-24 17:49:10.259578
    )
)
  

Javascript

Log {
    id: '5662318377566208',
    created: '2020-04-24T17:49:09.254098+00:00',
    type: 'sending',
    errors: [],
    transfer: {
        status: 'processing',
        updated: '2020-04-24T17:49:10.011542+00:00',
        tags: [ 'Daenerys', 'invoice/1234' ],
        rules: [
            {
                key: 'resendingLimit',
                value: 5
            }
        ],
        taxId: '594.739.480-42',
        transactionIds: [ '5991715760504832' ],
        bankCode: '665',
        scheduled: '2020-08-14T11:00:00+00:00',
        id: '5950134772826112',
        fee: 200,
        name: 'Daenerys Targaryen Stormborn',
        created: '2020-04-24T17:49:08.646900+00:00',
        accountNumber: '76543-8',
        accountType: 'checking',
        externalId: 'my-external-id',
        description: 'Daenerys Targaryen Stormborn (594.739.480-42)',
        branchCode: '2201',
        amount: 100000000
    }
}
  

PHP

StarkBank\Transfer\Log Object
(
    [id] => 5662318377566208
    [created] => DateTime Object
        (
            [date] => 2020-04-24 17:49:09.494828
            [timezone_type] => 1
            [timezone] => +00:00
        )

    [type] => sending
    [errors] => Array
        (
        )

    [transfer] => StarkBankTransfer Object
        (
            [id] => 5950134772826112
            [amount] => 100000000
            [name] => Daenerys Targaryen Stormborn
            [taxId] => 594.739.480-42
            [bankCode] => 665
            [branchCode] => 2201
            [accountNumber] => 76543-8
            [accountType] => checking
            [description] => Daenerys Targaryen Stormborn (594.739.480-42)
            [externalId] => my-external-id
            [tags] => Array
                (
                    [0] => daenerys
                    [1] => invoice/1234
                )

            [rules] => Array
                (
                    [0] => StarkBankTransferRule Object
                        (
                            [key] => resendingLimit
                            [value] => 5
                        )

                )

            [fee] => 200
            [status] => processing
            [scheduled] => DateTime Object
                (
                    [date] => 2020-08-14 11:00:00
                    [timezone_type] => 1
                    [timezone] => +00:00
                )

            [transactionIds] => Array
                (
                    [0] => 5991715760504832
                )

            [created] => DateTime Object
                (
                    [date] => 2020-04-24 17:49:08.884988
                    [timezone_type] => 1
                    [timezone] => +00:00
                )

            [updated] => DateTime Object
                (
                    [date] => 2020-04-24 17:49:10.319029
                    [timezone_type] => 1
                    [timezone] => +00:00
                )
        )
)
  

Java

Log({
    "id": "5662318377566208",
    "created": "2020-04-24T17:49:09+00:00",
    "type": "sending",
    "errors": [],
    "transfer": {
        "id": "5950134772826112",
        "amount": 100000000,
        "name": "Daenerys Targaryen Stormborn",
        "taxId": "594.739.480-42",
        "bankCode": "665",
        "branchCode": "2201",
        "accountNumber": "76543-8",
        "accountType": "checking",
        "externalId": "my-external-id",
        "description": "Daenerys Targaryen Stormborn (594.739.480-42)",
        "tags": [
            "daenerys",
            "invoice/1234"
        ],
        "rules": [
            {
                "key": "resendingLimit",
                "value": 5
            }
        ],
        "transactionIds": ["5768603836088320"],
        "fee": 200,
        "status": "processing",
        "scheduled": '2020-08-14T11:00:00+00:00',
        "created": "2020-04-24T17:49:10+00:00",
        "updated": "2020-04-24T17:49:10+00:00"
    }
})
  

Ruby

log(
    id: 5662318377566208,
    created: 2020-04-24T17:49:09+00:00,
    type: sending,
    errors: [],
    transfer: transfer(
        id: 5950134772826112,
        amount: 100000000,
        name: Daenerys Targaryen Stormborn,
        tax_id: 594.739.480-42,
        bank_code: 665,
        branch_code: 2201,
        account_number: 76543-8,
        account_type: checking,
        external_id: my-external-id,
        description: Daenerys Targaryen Stormborn (594.739.480-42),
        transaction_ids: ["5991715760504832"],
        fee: 200,
        tags: ["daenerys", "invoice/1234"],
        rules: [
        rule(
                key: resendingLimit,
                value: 5
            )
        ],
        status: processing,
        scheduled: 2020-08-14T11:00:00+00:00,
        created: 2020-04-24T17:49:10+00:00,
        updated: 2020-04-24T17:49:10+00:00
    )
)
  

Elixir

%StarkBank.Transfer.Log {
    id: "5662318377566208",
    created: ~U[2020-04-24 17:49:09.931897Z],
    errors: [],
    type: "sending"
    transfer: %StarkBank.Transfer{
        account_number: "76543-8",
        account_type: "checking",
        amount: 100000000,
        bank_code: "665",
        branch_code: "2201",
        created: ~U[2020-04-24 17:49:08.039009Z],
        external_id: "my-external-id",
        fee: 200,
        id: "5950134772826112",
        name: "Daenerys Targaryen Stormborn",
        status: "processing",
        scheduled: ~U[2020-08-14 11:00:00Z],
        rules: %Transfer.Rule[
        %{"key" => "resendingLimit", "value" => 5}
        ],
        description: "Daenerys Targaryen Stormborn (594.739.480-42)"",
        tags: ["daenerys", "invoice/1234"],
        tax_id: "594.739.480-42",
        transaction_ids: ["5991715760504832"],
        updated: ~U[2020-04-24 17:49:09.658635Z]
    }
}
  

C#

Log(
    ID: 5662318377566208,
    Created: 04/24/2020 17:49:09,
    Type: sending,
    Errors: {  },
    Transfer: Transfer(
        Amount: 100000000,
        Name: Daenerys Targaryen Stormborn,
        TaxID: 594.739.480-42,
        BankCode: 665,
        BranchCode: 2201,
        AccountNumber: 76543-8,
        AccountType: checking,
        ExternalID: my-external-id,
        Description: Daenerys Targaryen Stormborn (594.739.480-42),
        TransactionIds: { 5991715760504832 },
        Fee: 200,
        Tags: { daenerys, invoice/1234 },
        Rules: {
        Rule(
                Key: resendingLimit,
                Value: 5
            )
        },
        Status: processing,
        Scheduled: 08/14/2020 11:00:00,
        Created: 04/24/2020 17:49:09,
        Updated: 04/24/2020 17:49:09,
        ID: 5950134772826112
    )
)
  

Go

package main

import (
	"fmt"
	"github.com/starkbank/sdk-go/starkbank/transfer/log"

)

func main() {

	log, err := log.Get("5662318377566208", nil)
	if err.Errors != nil {
		for _, e := range err.Errors {
			fmt.Printf("code: %s, message: %s", e.Code, e.Message)
		}
	}

	fmt.Printf("%+v", log)
}
  

Clojure

{:id "5662318377566208",
 :created "2020-04-24T17:49:09.531199+00:00",
 :errors [],
 :type "sending",
 :transfer
 {:amount 100000000,
  :fee 200,
  :tags ["daenerys" "invoice/1234"],
  :branch-code "2201",
  :updated "2020-04-24T17:49:09.931279+00:00",
  :name "Daenerys Targaryen Stormborn",
  :description "Daenerys Targaryen Stormborn (594.739.480-42)",
  :tax-id "594.739.480-42",
  :created "2020-04-24T17:49:09.745548+00:00"
  :status "processing",
  :id "5950134772826112",
  :transaction-ids ["5991715760504832"],
  :account-number "76543-8",
  :bank-code "665",
  :account-type: "checking",
  :external-id: "my-external-id"}}
  

Curl

{
    "cursor": null,
    "logs": [
        {
            "id": "5662318377566208",
            "errors": [],
            "type": "sending",
            "created": "2020-03-24T17:49:43.751122+00:00",
            "transfer": {
                "id": "5950134772826112",
                "status": "processing",
                "amount": 100000000,
                "name": "Daenerys Targaryen Stormborn",
                "rules": [
                    {
                        "key": "resendingLimit",
                        "value": 5
                    }
                ],
                "taxId": "594.739.480-42",
                "bankCode": "665",
                "branchCode": "2201",
                "accountNumber": "76543-8",
                "accountType": "checking",
                "scheduled": "2020-08-14T11:00:00+00:00",
                "tags": ["daenerys", "invoice/1234"],
                "created": "2020-04-24T19:59:02.130246+00:00",
                "description": "Daenerys Targaryen Stormborn (594.739.480-42)",
                "externalId": "my-external-id",
                "updated": "2020-04-24T19:59:02.130255+00:00",
                "transactionIds": ["5991715760504832"],
                "fee": 200,
            }
        }
    ]
}
  

Get a Transfer Log

Get a single transfer log by its id.

Parameters

id REQUIRED

Id of the transfer entity.

fields OPTIONAL

List of strings to filter response JSON keys. Not available in the SDKs.

ENDPOINT
GET /v2/transfer/log/:id
REQUEST

Python

import starkbank

log = starkbank.transfer.log.get("5662318377566208")

print(log)
  

Javascript

const starkbank = require('starkbank');

(async() => {
    let log = await starkbank.transfer.log.get('5662318377566208');
    console.log(log);
})();
  

PHP

$log = StarkBank\Transfer\Log::get("5662318377566208");

print_r($log);
  

Java

import com.starkbank.*;

Transfer.Log log = Transfer.Log.get("5662318377566208");

System.out.println(log);
  

Ruby

require('starkbank')

log = StarkBank::Transfer::Log.get('5662318377566208')

puts log
  

Elixir

log = StarkBank.Transfer.Log.get!("5662318377566208")

log |> IO.inspect
  

C#

using System;

StarkBank.Transfer.Log log = StarkBank.Transfer.Log.Get("5662318377566208");

Console.WriteLine(log);
  

Go

package main

import (
    "fmt"
    "github.com/starkbank/sdk-go/starkbank/transfer/log"

)

func main() {

    log, err := log.Get("5662318377566208", nil)
    if err.Errors != nil {
        for _, e := range err.Errors {
            fmt.Printf("code: %s, message: %s", e.Code, e.Message)
        }
    }

    fmt.Printf("%+v", log)
}
  

Clojure

(def log (starkbank.transfer.log/get "5662318377566208"))
(println log)
  

Curl

curl --location --request GET '{{baseUrl}}/v2/transfer/log/5662318377566208' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}'
  
RESPONSE

Python

Log(
    id=5662318377566208,
    created=2020-04-24 17:49:09.348444,
    errors=[],
    type=sending,
    transfer=Transfer(
        id=5950134772826112,
        account_number=76543-8,
        account_type=checking,
        amount=100000000,
        bank_code=665,
        branch_code=2201,
        created=2020-04-24 17:49:08.748893,
        description=Daenerys Targaryen Stormborn (594.739.480-42),
        external_id=my-external-id,
        fee=200,
        name=Daenerys Targaryen Stormborn,
        rules=[
            Rule(
                key=resendingLimit,
                value=5
            )
        ],
        status=processing,
        scheduled=2020-08-14 11:00:00,
        tags=['daenerys', 'invoice/1234'],
        tax_id=594.739.480-42,
        transaction_ids=['5991715760504832'],
        updated=2020-04-24 17:49:10.259578
    )
)
  

Javascript

Log {
    id: '5662318377566208',
    created: '2020-04-24T17:49:09.254098+00:00',
    type: 'sending',
    errors: [],
    transfer: {
        status: 'processing',
        updated: '2020-04-24T17:49:10.011542+00:00',
        tags: [ 'Daenerys', 'invoice/1234' ],
        rules: [
            {
                key: 'resendingLimit',
                value: 5
            }
        ],
        taxId: '594.739.480-42',
        transactionIds: [ '5991715760504832' ],
        bankCode: '665',
        scheduled: '2020-08-14T11:00:00+00:00',
        id: '5950134772826112',
        fee: 200,
        name: 'Daenerys Targaryen Stormborn',
        created: '2020-04-24T17:49:08.646900+00:00',
        accountNumber: '76543-8',
        accountType: 'checking',
        externalId: 'my-external-id',
        description: 'Daenerys Targaryen Stormborn (594.739.480-42)',
        branchCode: '2201',
        amount: 100000000
    }
}
  

PHP

StarkBank\Transfer\Log Object
(
    [id] => 5662318377566208
    [created] => DateTime Object
        (
            [date] => 2020-04-24 17:49:09.494828
            [timezone_type] => 1
            [timezone] => +00:00
        )

    [type] => sending
    [errors] => Array
        (
        )

    [transfer] => StarkBank\Transfer Object
        (
            [id] => 5950134772826112
            [amount] => 100000000
            [name] => Daenerys Targaryen Stormborn
            [taxId] => 594.739.480-42
            [bankCode] => 665
            [branchCode] => 2201
            [accountNumber] => 76543-8
            [accountType] => checking
            [description] => Daenerys Targaryen Stormborn (594.739.480-42)
            [externalId] => my-external-id
            [tags] => Array
                (
                    [0] => daenerys
                    [1] => invoice/1234
                )

            [rules] => Array
                (
                    [0] => StarkBank\Transfer\Rule Object
                        (
                            [key] => resendingLimit
                            [value] => 5
                        )

                )

            [fee] => 200
            [status] => processing
            [scheduled] => DateTime Object
                (
                    [date] => 2020-08-14 11:00:00
                    [timezone_type] => 1
                    [timezone] => +00:00
                )

            [transactionIds] => Array
                (
                    [0] => 5991715760504832
                )

            [created] => DateTime Object
                (
                    [date] => 2020-04-24 17:49:08.884988
                    [timezone_type] => 1
                    [timezone] => +00:00
                )

            [updated] => DateTime Object
                (
                    [date] => 2020-04-24 17:49:10.319029
                    [timezone_type] => 1
                    [timezone] => +00:00
                )

        )

)
  

Java

Log({
    "id": "5662318377566208",
    "created": "2020-04-24T17:49:09+00:00",
    "type": "sending",
    "errors": [],
    "transfer": {
        "id": "5950134772826112",
        "amount": 100000000,
        "name": "Daenerys Targaryen Stormborn",
        "taxId": "594.739.480-42",
        "bankCode": "665",
        "branchCode": "2201",
        "accountNumber": "76543-8",
        "accountType": "checking",
        "externalId": "my-external-id",
        "description": "Daenerys Targaryen Stormborn (594.739.480-42)",
        "tags": [
            "daenerys",
            "invoice/1234"
        ],
        "rules": [
            {
                "key": "resendingLimit",
                "value": 5
            }
        ],
        "transactionIds": ["5768603836088320"],
        "fee": 200,
        "status": "processing",
        "scheduled": '2020-08-14T11:00:00+00:00',
        "created": "2020-04-24T17:49:10+00:00",
        "updated": "2020-04-24T17:49:10+00:00"
    }
})
  

Ruby

log(
    id: 5662318377566208,
    created: 2020-04-24T17:49:09+00:00,
    type: sending,
    errors: [],
    transfer: transfer(
        id: 5950134772826112,
        amount: 100000000,
        name: Daenerys Targaryen Stormborn,
        tax_id: 594.739.480-42,
        bank_code: 665,
        branch_code: 2201,
        account_number: 76543-8,
        account_type: checking,
        external_id: my-external-id,
        description: Daenerys Targaryen Stormborn (594.739.480-42),
        transaction_ids: ["5991715760504832"],
        fee: 200,
        tags: ["daenerys", "invoice/1234"],
        rules: [
        rule(
                key: resendingLimit,
                value: 5
            )
        ],
        status: processing,
        scheduled: 2020-08-14T11:00:00+00:00,
        created: 2020-04-24T17:49:10+00:00,
        updated: 2020-04-24T17:49:10+00:00
    )
)
  

Elixir

%StarkBank.Transfer.Log {
    id: "5662318377566208",
    created: ~U[2020-04-24 17:49:09.931897Z],
    errors: [],
    type: "sending"
    transfer: %StarkBank.Transfer{
        account_number: "76543-8",
        account_type: "checking",
        amount: 100000000,
        bank_code: "665",
        branch_code: "2201",
        created: ~U[2020-04-24 17:49:08.039009Z],
        external_id: "my-external-id",
        fee: 200,
        id: "5950134772826112",
        name: "Daenerys Targaryen Stormborn",
        status: "processing",
        scheduled: ~U[2020-08-14 11:00:00Z],
        rules: %Transfer.Rule[
        %{"key" => "resendingLimit", "value" => 5}
        ],
        description: "Daenerys Targaryen Stormborn (594.739.480-42)"",
        tags: ["daenerys", "invoice/1234"],
        tax_id: "594.739.480-42",
        transaction_ids: ["5991715760504832"],
        updated: ~U[2020-04-24 17:49:09.658635Z]
    }
}
  

C#

Log(
    ID: 5662318377566208,
    Created: 04/24/2020 17:49:09,
    Type: sending,
    Errors: {  },
    Transfer: Transfer(
        Amount: 100000000,
        Name: Daenerys Targaryen Stormborn,
        TaxID: 594.739.480-42,
        BankCode: 665,
        BranchCode: 2201,
        AccountNumber: 76543-8,
        AccountType: checking,
        ExternalID: my-external-id,
        Description: Daenerys Targaryen Stormborn (594.739.480-42),
        TransactionIds: { 5991715760504832 },
        Fee: 200,
        Tags: { daenerys, invoice/1234 },
        Rules: {
        Rule(
                Key: resendingLimit,
                Value: 5
            )
        },
        Status: processing,
        Scheduled: 08/14/2020 11:00:00,
        Created: 04/24/2020 17:49:09,
        Updated: 04/24/2020 17:49:09,
        ID: 5950134772826112
    )
)
  

Go

{
    Id:5662318377566208
    Created:2020-04-24 17:49:09.00773 +0000 +0000
    Type:sending
    Errors:[]
    Transfer:
        {
            Id:5950134772826112
            Amount:100000000
            Name:Daenerys Targaryen Stormborn
            TaxId:594.739.480-42
            BankCode:665
            BranchCode:2201
            AccountNumber:76543-8
            AccountType:checking
            ExternalId:my-external-id
            Scheduled:2020-04-24 11:00:00.000000 +0000 +0000
            Description:Good description
            Tags:[daenerys invoice/1234]
            Rules:[
                {
                    Key:resendingLimit
                    Value:5
                }
            ]
            Fee:200
            Status:created
            TransactionIds:[5991715760504832]
            Created:2020-04-24 17:49:10.001771 +0000 +0000
            Updated:2020-04-24 17:49:10.81727 +0000 +0000
        }
}
  

Clojure

{:id "5662318377566208",
 :created "2020-04-24T17:49:09.531199+00:00",
 :errors [],
 :type "sending",
 :transfer
 {:amount 100000000,
  :fee 200,
  :tags ["daenerys" "invoice/1234"],
  :branch-code "2201",
  :updated "2020-04-24T17:49:09.931279+00:00",
  :name "Daenerys Targaryen Stormborn",
  :description "Daenerys Targaryen Stormborn (594.739.480-42)",
  :tax-id "594.739.480-42",
  :created "2020-04-24T17:49:09.745548+00:00"
  :status "processing",
  :id "5950134772826112",
  :transaction-ids ["5991715760504832"],
  :account-number "76543-8",
  :bank-code "665",
  :account-type: "checking",
  :external-id: "my-external-id"}}
  

Curl

{
    "log": {
        "id": "5662318377566208",
        "errors": [],
        "type": "sending",
        "created": "2020-03-24T17:49:43.751122+00:00",
        "transfer": {
            "id": "5950134772826112",
            "status": "processing",
            "amount": 100000000,
            "name": "Daenerys Targaryen Stormborn",
            "rules": [
                {
                    "key": "resendingLimit",
                    "value": 5
                }
            ],
            "taxId": "594.739.480-42",
            "bankCode": "665",
            "branchCode": "2201",
            "accountNumber": "76543-8",
            "accountType": "checking",
            "scheduled": "2020-08-14T11:00:00+00:00",
            "tags": ["daenerys", "invoice/1234"],
            "created": "2020-04-24T19:59:02.130246+00:00",
            "description": "Daenerys Targaryen Stormborn (594.739.480-42)",
            "externalId": "my-external-id",
            "updated": "2020-04-24T19:59:02.130255+00:00",
            "transactionIds": ["5991715760504832"],
            "fee": 200,
        }
    }
}
  

Payment Status

Each payment has a status that can change over time according to its life cycle: brcode-payment-status

Payment Log

Every time we modify a brcode payment, we create a log. Logs are pretty useful for understanding the life cycle of each payment and the changes that happened to it. Here is the possible event flow: brcode-payment-log

A paid Brcode can be either partially or fully reversed back to its payer. Multiple reversals can be made for the same invoice and each time, the following flow of logs will occur: brcode-payment-reversal

The Brcode Payment object

Attributes

id STRING

Unique id for the brcode payment.

amount INTEGER

Payment amount in cents.

brcode STRING

Brcode that describes the payment.

created STRING

Creation datetime. Example: "2020-04-23T23:00:00.000000+00:00".

description STRING

Text displayed in the bank statement.

fee INTEGER

Fee charged in cents.

name STRING

Receiver full name.

rules LIST OF OBJECTS

List of rule objects with key and value.

scheduled STRING

Scheduled payment datetime. Example: "2020-04-23T23:00:00.000000+00:00".

status STRING

Current payment status. Options: "created", "processing", "confirmed", "success", "failed", "canceled".

tags LIST OF STRINGS

Tags associated with the brcode payment.

taxId STRING

Receiver CPF or CNPJ.

transactionIds LIST OF STRINGS

Ledger transaction IDs linked to the payment.

type STRING

Type of the brcode payment.

updated STRING

Last update datetime. Example: "2020-04-23T23:00:00.000000+00:00".

Create Brcode Payments

Use this route to pay registered brcodes generated at Stark Bank or at other financial institutions using the available balance in your Stark Bank account.

NOTE: Initially, the brcode entity amount will be zero because the brcode is processed asynchronously.

Parameters

brcode REQUIRED

Brcode that describes the payment.

description REQUIRED

Text to be displayed in your statement. Min length = 10.

taxId REQUIRED

Receiver CPF (11 digits formatted or unformatted) or CNPJ (14 digits formatted or unformatted). Example: 012.345.678-90.

amount CONDITIONALLY REQUIRED

If the brcode does not provide an amount, this parameter is mandatory, else it is optional. Example: 23456 (R$ 234,56).

rules OPTIONAL

List of rules for modifying brcodePayment behavior. Example:

[
    {
        "key": "resendingLimit",
        "value": 5
    }
]

scheduled OPTIONAL

Schedule the payment for a specific date. Default value is the current day.

tags OPTIONAL

Array of strings to tag the entity for future queries. All tags will be converted to lowercase.

ENDPOINT
POST /v2/brcode-payment
REQUEST

Python

import starkbank

payments = starkbank.brcodepayment.create([
    starkbank.BrcodePayment(
        brcode="00020101021226890014br.gov.bcb.pix2567brcode-h.sandbox.starkinfra.com/v2/ace289aac1ce453b9ca64fb12ec525855204000053039865802BR5925Stark Bank S.A. - Institu6009Sao Paulo62070503***63044DDF",
        tax_id="012.345.678-90",
        scheduled="2021-01-13",
        description="this will be fast",
        tags=["pix", "qrcode"],
        rules=[
            starkbank.brcodepayment.Rule(key="resendingLimit", value=5)
        ]
    )
])

for payment in payments:
    print(payment)
  

Javascript

const starkbank = require('starkbank');

(async() => {
    let payments = await starkbank.brcodePayment.create([
        {
            brcode: "00020101021226890014br.gov.bcb.pix2567brcode-h.sandbox.starkinfra.com/v2/ace289aac1ce453b9ca64fb12ec525855204000053039865802BR5925Stark Bank S.A. - Institu6009Sao Paulo62070503***63044DDF",
            taxId: '012.345.678-90',
            description: "this will be fast",
            scheduled: '2021-01-13',
            tags: ['pix', 'qrcode'],
            rules: [
                {
                    key: 'resendingLimit',
                    value: 5
                }
            ]
        },
    ]);

    for (let payment of payments) {
        console.log(payment);
    }
})();
  

PHP

use StarkBank\BrcodePayment;

$payments = StarkBank\BrcodePayment::create([
    new StarkBank\BrcodePayment([
        "brcode" => "00020101021226890014br.gov.bcb.pix2567brcode-h.sandbox.starkinfra.com/v2/ace289aac1ce453b9ca64fb12ec525855204000053039865802BR5925Stark Bank S.A. - Institu6009Sao Paulo62070503***63044DDF",
        "taxId" => "012.345.678-90",
        "description" => "this will be fast",
        "scheduled" => "2021-01-13",
        "tags" => ["pix", "qrcode"],
        "rules" => [
            new StarkBank\BrcodePayment\Rule(["key" => "resendingLimit", "value" => 5])
        ]
    ])
]);

foreach($payments as $payment){
    print_r($payment);
}
  

Java

import com.starkbank.*;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

List<BrcodePayment> payments = new ArrayList<>();

List<BrcodePayment.Rule> rules = new ArrayList<>();
rules.add(new BrcodePayment.Rule("resendingLimit", 5));

HashMap<String, Object> data = new HashMap<>();
data.put("brcode", "00020101021226890014br.gov.bcb.pix2567brcode-h.sandbox.starkinfra.com/v2/ace289aac1ce453b9ca64fb12ec525855204000053039865802BR5925Stark Bank S.A. - Institu6009Sao Paulo62070503***63044DDF");
data.put("taxId", "012.345.678-90");
data.put("scheduled", "2021-01-13");
data.put("description", "this will be fast");
data.put("tags", new String[]{"pix", "qrcode"});
data.put("rules", rules);
payments.add(new BrcodePayment(data));

payments = BrcodePayment.create(payments);

for (BrcodePayment payment : payments){
    System.out.println(payment);
}
  

Ruby

require('starkbank')

payments = StarkBank::BrcodePayment.create(
    [
        StarkBank::BrcodePayment.new(
            brcode: "00020101021226890014br.gov.bcb.pix2567brcode-h.sandbox.starkinfra.com/v2/ace289aac1ce453b9ca64fb12ec525855204000053039865802BR5925Stark Bank S.A. - Institu6009Sao Paulo62070503***63044DDF",
            tax_id: '012.345.678-90',
            scheduled: '2021-01-13',
            description: 'this will be fast',
            tags: %w[pix qrcode],
            rules: [
                StarkBank::BrcodePayment::Rule.new(key: 'resendingLimit', value: 5)
            ]
        )
    ]
)
    
payments.each do |payment|
    puts payment
end
  

Elixir

payments = StarkBank.BrcodePayment.create!(
    [
        %StarkBank.BrcodePayment{
            brcode: "00020101021226890014br.gov.bcb.pix2567brcode-h.sandbox.starkinfra.com/v2/ace289aac1ce453b9ca64fb12ec525855204000053039865802BR5925Stark Bank S.A. - Institu6009Sao Paulo62070503***63044DDF",
            tax_id: "012.345.678-90",
            scheduled: "2021-01-13"
            description: "this will be fast",
            tags: ["pix", "qrcode"],
            rules: [
                %StarkBank.BrcodePayment.Rule{
                    key: "resendingLimit",
                    value: 5
                }
            ]
        }
    ]
) |> IO.inspect
  

C#

using System;
using System.Collections.Generic;

List<StarkBank.BrcodePayment> payments = StarkBank.BrcodePayment.Create(
    new List<StarkBank.BrcodePayment> {
        new StarkBank.BrcodePayment(
            brcode: "00020101021226890014br.gov.bcb.pix2567brcode-h.sandbox.starkinfra.com/v2/ace289aac1ce453b9ca64fb12ec525855204000053039865802BR5925Stark Bank S.A. - Institu6009Sao Paulo62070503***63044DDF",
            taxID: "012.345.678-90",
            scheduled: new DateTime(2021, 1, 13),
            description: "this will be fast",
            tags: new List<string> { "pix", "qrcode" },
            rules: new List<StarkBank.BrcodePayment.Rule> {
                new StarkBank.BrcodePayment.Rule(key: "resendingLimit", value: 5)
            }
        )
    }
);

foreach (StarkBank.BrcodePayment payment in payments)
{
    Console.WriteLine(payment);
}
  

Go

package main

import (
    "fmt"
    "github.com/starkbank/sdk-go/starkbank/brcodepayment"
)

func main() {

    scheduled := time.Date(2021, 01, 13, 0, 0, 0, 0, time.UTC)

    payments, err := brcodepayment.Create(
        []brcodepayment.BrcodePayment{
            {
                Brcode:      "00020101021226890014br.gov.bcb.pix2567brcode-h.sandbox.starkinfra.com/v2/ace289aac1ce453b9ca64fb12ec525855204000053039865802BR5925Stark Bank S.A. - Institu6009Sao Paulo62070503***63044DDF",
                TaxId:       "012.345.678-90",
                Scheduled:   &scheduled,
                Description: "this will be fast",
                Tags:        []string{"pix", "qrcode"},
                Rules:       []rule.Rule{{Key: "resendingLimit", Value: 5}},
            },
        }, nil)
    if err.Errors != nil {
        for _, e := range err.Errors {
            fmt.Printf("code: %s, message: %s", e.Code, e.Message)
        }
    }

    for _, payment := range payments {
        fmt.Printf("%+v", payment)
    }
}
  

Clojure

(def payments (starkbank.brcode-payment/create
[{
    :brcode "00020101021226890014br.gov.bcb.pix2567brcode-h.sandbox.starkinfra.com/v2/ace289aac1ce453b9ca64fb12ec525855204000053039865802BR5925Stark Bank S.A. - Institu6009Sao Paulo62070503***63044DDF"
    :tax-id "012.345.678-90"
    :scheduled "2021-01-13T20:32:02.218000+00:00"
    :description "this will be fast"
    :tags ["pix" "qrcode"]
}]))

(doseq [payment payments]
    (println payment))
  

Curl

curl --location --request POST '{{baseUrl}}/v2/brcode-payment' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}' 
--header 'Content-Type: application/json' 
--data-raw '{
    "payments": [
        {
            "brcode": "00020101021226890014br.gov.bcb.pix2567brcode-h.sandbox.starkinfra.com/v2/ace289aac1ce453b9ca64fb12ec525855204000053039865802BR5925Stark Bank S.A. - Institu6009Sao Paulo62070503***63044DDF",
            "taxId": "012.345.678-90",
            "scheduled": "2021-01-13",
            "description": "BR Code Test 1",
            "tags": ["pix", "qrcode"]
            "rules": [
                {
                    "key": "resendingLimit",
                    "value": 5
                }
            ]
        }
    ]
}'
  
RESPONSE

Python

BrcodePayment(
    amount=0,
    brcode=00020101021226890014br.gov.bcb.pix2567brcode-h.sandbox.starkinfra.com/v2/ace289aac1ce453b9ca64fb12ec525855204000053039865802BR5925Stark Bank S.A. - Institu6009Sao Paulo62070503***63044DDF,
    created=2021-01-03 18:36:18.574799,
    description=this will be fast,
    fee=0,
    id=5717797661310976,
    name=None,
    rules=[
        Rule(
            key=resendingLimit,
            value=5
        )
    ],
    scheduled=2021-01-13 10:00:00,
    status=creating,
    tags=['pix', 'qrcode'],
    tax_id=***.345.678-**,
    transaction_ids=[],
    type=dynamic,
    updated=2021-01-03 18:36:18.574815
)
  

Javascript

BrcodePayment {
    id: '5717797661310976',
    brcode: '00020101021226890014br.gov.bcb.pix2567brcode-h.sandbox.starkinfra.com/v2/ace289aac1ce453b9ca64fb12ec525855204000053039865802BR5925Stark Bank S.A. - Institu6009Sao Paulo62070503***63044DDF',
    taxId: '***.345.678-**',
    name: null,
    description: 'this will be fast',
    amount: 0,
    scheduled: '2021-01-13T10:00:00+00:00',
    tags: [ 'pix', 'qrcode' ],
    rules: [ 
        { 
            key: 'resendingLimit', 
            value: 5 
        } 
    ],
    status: 'creating',
    type: 'dynamic',
    fee: 0,
    updated: '2021-01-03T18:36:23.200972+00:00',
    created: '2021-01-03T18:36:23.200957+00:00',
    transactionIds: []
}
  

PHP

StarkBank\BrcodePayment Object
(
    [id] => 5717797661310976
    [brcode] => 00020101021226890014br.gov.bcb.pix2567brcode-h.sandbox.starkinfra.com/v2/ace289aac1ce453b9ca64fb12ec525855204000053039865802BR5925Stark Bank S.A. - Institu6009Sao Paulo62070503***63044DDF
    [taxId] => ***.345.678-**
    [description] => this will be fast
    [amount] => 0
    [scheduled] => DateTime Object
        (
            [date] => 2021-01-13 10:00:00.000000
            [timezone_type] => 1
            [timezone] => +00:00
        )

    [name] => 
    [tags] => Array
        (
            [0] => pix
            [1] => qrcode
        )

    [rules] => Array
        (
            [0] => StarkBank\BrcodePayment\Rule Object
                (
                    [key] => resendingLimit
                    [value] => 5
                )

        )

    [status] => creating
    [type] => dynamic
    [transactionIds] => Array
        (
        )

    [fee] => 0
    [updated] => DateTime Object
        (
            [date] => 2021-01-03 18:36:18.739116
            [timezone_type] => 1
            [timezone] => +00:00
        )

    [created] => DateTime Object
        (
            [date] => 2021-01-03 18:36:18.739116
            [timezone_type] => 1
            [timezone] => +00:00
        )

)
  

Java

BrcodePayment({
    "brcode": "00020101021226890014br.gov.bcb.pix2567brcode-h.sandbox.starkinfra.com/v2/ace289aac1ce453b9ca64fb12ec525855204000053039865802BR5925Stark Bank S.A. - Institu6009Sao Paulo62070503***63044DDF",
    "taxId": "***.345.678-**",
    "description": "this will be fast",
    "amount": 0,
    "scheduled": "2021-01-13T10:00:00+00:00",
    "tags": [
        "pix",
        "qrcode"
    ],
    "rules": [
        {
            "key": "resendingLimit",
            "value": 5
        }
    ],
    "status": "creating",
    "name": "",
    "type": "dynamic",
    "transactionIds": [],
    "fee": 0,
    "updated": "2021-01-03T18:36:18.142541+00:00",
    "created": "2021-01-03T18:36:18.142526+00:00",
    "id": "5717797661310976"
})
  

Ruby

brcodepayment(
    id: 5717797661310976,
    brcode: 00020101021226890014br.gov.bcb.pix2567brcode-h.sandbox.starkinfra.com/v2/ace289aac1ce453b9ca64fb12ec525855204000053039865802BR5925Stark Bank S.A. - Institu6009Sao Paulo62070503***63044DDF,
    tax_id: ***.345.678-**,
    description: this will be fast,
    amount: 0,
    scheduled: 2021-01-13T10:00:00+00:00,
    tags: ["pix", "qrcode"],
    rules: [
        rule(
            key: resendingLimit,
            value: 5
        )
    ],
    name: ,
    status: creating,
    type: dynamic,
    transaction_ids: [],
    fee: 0,
    updated: 2021-01-03T18:36:18+00:00,
    created: 2021-01-03T18:36:18+00:00
)
  

Elixir

%StarkBank.BrcodePayment{
    amount: 0,
    brcode: 00020101021226890014br.gov.bcb.pix2567brcode-h.sandbox.starkinfra.com/v2/ace289aac1ce453b9ca64fb12ec525855204000053039865802BR5925Stark Bank S.A. - Institu6009Sao Paulo62070503***63044DDF,
    created: ~U[2021-01-03 18:36:00.235426Z],
    description: "this will be fast",
    fee: 0,
    id: "5717797661310976",
    name: "",
    scheduled: ~U[2021-01-13 10:00:00.000000Z],
    rules: [
        %StarkBank.BrcodePayment.Rules{
            key: "resendingLimit",
            value: 5
        }
    ]
    status: "creating",
    tags: ["pix", "qrcode"],
    transaction_ids: [],
    tax_id: "***.345.678-**",
    type: "dynamic",
    updated: ~U[2021-01-03 18:36:00.235440Z]
}
  

C#

BrcodePayment(
    Brcode: 00020101021226890014br.gov.bcb.pix2567brcode-h.sandbox.starkinfra.com/v2/ace289aac1ce453b9ca64fb12ec525855204000053039865802BR5925Stark Bank S.A. - Institu6009Sao Paulo62070503***63044DDF,
    Tags: { pix, qrcode },
    Scheduled: 13/01/2021 10:00:00,
    Name: null,
    TaxID: ***.345.678-**,
    Amount: 0,
    Rules: Rule(
        Key: resendingLimit,
        Value: 5
    )
    Status: creating,
    Type: dynamic,
    Description: this will be fast,
    ID: 5717797661310976
    Fee: 0,
    Created: 03/01/2021 18:36:00,
    Updated: 03/01/2021 18:36:00,
    TransactionIds: {  },
)
  

Go

{
    Id:5717797661310976 
    Brcode:00020101021226890014br.gov.bcb.pix2567brcode-h.sandbox.starkinfra.com/v2/ace289aac1ce453b9ca64fb12ec525855204000053039865802BR5925Stark Bank S.A. - Institu6009Sao Paulo62070503***63044DDF 
    TaxId:***.345.678-**
    Description:this will be fast 
    Amount:0 
    Scheduled:2021-01-13 10:00:00.000000 +0000 +0000 
    Rules:[
        {
            Key:resendingLimit 
            Value:5
        }
    ]
    Tags:[pix qrcode] 
    Name: 
    Status:creating 
    Type:dynamic 
    TransactionIds:[] 
    Fee:0 
    Updated:2021-01-03 18:36:00.796544 +0000 +0000 
    Created:2021-01-03 18:36:00.796529 +0000 +0000
}
  

Clojure

{
    :description this will be fast,
    :name ,
    :amount 0,
    :fee 0,
    :tags [pix, qrcode],
    :transaction-ids [],
    :updated 2021-01-03T18:36:00.892863+00:00,
    :tax-id ***.345.678-**,
    :type dynamic,
    :created 2021-01-03T18:36:00.892848+00:00,
    :status creating,
    :id 5717797661310976,
    :scheduled 2021-01-12T10:00:00.000000+00:00,
    :brcode 00020101021226890014br.gov.bcb.pix2567brcode-h.sandbox.starkinfra.com/v2/ace289aac1ce453b9ca64fb12ec525855204000053039865802BR5925Stark Bank S.A. - Institu6009Sao Paulo62070503***63044DDF
}
  

Curl

{
    "message": "Payment(s) successfully created",
    "payments": [
        {
            "amount": 0,
            "brcode": "00020101021226890014br.gov.bcb.pix2567brcode-h.sandbox.starkinfra.com/v2/ace289aac1ce453b9ca64fb12ec525855204000053039865802BR5925Stark Bank S.A. - Institu6009Sao Paulo62070503***63044DDF",
            "created": "2021-01-03T18:36:00.369014+00:00",
            "description": "this will be fast",
            "fee": 0,
            "id": "5717797661310976",
            "name": null,
            "rules": [
                {
                    "key": "resendingLimit",
                    "value": 5
                }
            ],
            "scheduled": "2021-01-13T10:00:00.000000+00:00",
            "status": "creating",
            "tags": ["pix", "qrcode"],
            "taxId": "***.345.678-**",
            "transactionIds": [],
            "type": "dynamic",
            "updated": "2021-01-03T18:36:00.369028+00:00"
        }
    ]
}
  

List Brcode Payments

Get a list of non-deleted brcodes in chunks of at most 100. If you need smaller chunks, use the limit parameter.

Parameters

after OPTIONAL

Filter entities created after this date.

before OPTIONAL

Filter entities created before this date.

cursor OPTIONAL

String used to get the next batch of results. Our SDKs handle this for you.

fields OPTIONAL

List of strings to filter response JSON keys. Not available in the SDKs.

ids OPTIONAL

List of strings to get specific entities by ids.

limit OPTIONAL

Number of results per cursor. Max = 100.

status OPTIONAL

Filter brcode payments by the specified status.

tags OPTIONAL

Filter entities that contain the specified tags.

ENDPOINT
GET /v2/brcode-payment
REQUEST

Python

import starkbank

payments = starkbank.brcodepayment.query(
    after="2021-01-01",
    before="2021-01-30"
)

for payment in payments:
    print(payment)
  

Javascript

const starkbank = require('starkbank');

(async() => {
    let payments = await starkbank.brcodePayment.query({
        after: '2021-01-01',
        before: '2021-01-30'
    });

    for await (let payment of payments) {
        console.log(payment);
    }
})();
  

PHP

use StarkBank\BrcodePayment;

$payments = BrcodePayment::query([
    "after" => "2021-01-01",
    "before" => "2021-01-30"
]);

foreach($payments as $payment){
    print_r($payment);
}
  

Java

import com.starkbank.*;
import com.starkbank.utils.Generator;
import java.util.HashMap;


HashMap<String, Object> params = new HashMap<>();
params.put("after", "2021-01-01");
params.put("before", "2021-01-30");
Generator<BrcodePayment> payments = BrcodePayment.query(params);

for (BrcodePayment payment : payments){
    System.out.println(payment);
}
  

Ruby

require('starkbank')

payments = StarkBank::BrcodePayment.query(
    after: "2021-01-01",
    before: "2021-01-30"
)
    
payments.each do |payment|
    puts payment
end
  

Elixir

payments = StarkBank.BrcodePayment.query!(
    after: "2021-01-01",
    before: "2021-01-30"
) |> Enum.take(10) |> IO.inspect
  

C#

using System;
using System.Collections.Generic;

IEnumerable<StarkBank.BrcodePayment> payments = StarkBank.BrcodePayment.Query(
    after: new DateTime(2021, 1, 1),
    before: new DateTime(2021, 1, 30)
);

foreach (StarkBank.BrcodePayment payment in payments)
{
    Console.WriteLine(payment);
}
  

Go

package main

import (
    "fmt"
    "time"
    "github.com/starkbank/sdk-go/starkbank/brcodepayment"
)

func main() {

    var params = map[string]interface{}{}
    params["after"] = time.Date(2021, 1, 1, 0, 0, 0, 0, time.UTC)
    params["before"] = time.Date(2021, 1, 30, 0, 0, 0, 0, time.UTC)
    
    payments, errorChannel := brcodepayment.Query(params, nil)

    loop:
    for {
        select {
        case err := <-errorChannel:
            if err.Errors != nil {
                for _, e := range err.Errors {
                    fmt.Printf("code: %s, message: %s", e.Code, e.Message)
                }
            }
        case payment, ok := <-payments:
            if !ok {
                break loop
            }
            fmt.Printf("%+v", payment)
        }
    }
}
  

Clojure

(def payments (starkbank.brcode-payment/query {:after "2021-01-01", :before "2021-01-30"}))

(doseq [payment payments]
    (println payment))
  

Curl

curl --location --request GET '{{baseUrl}}/v2/brcode-payment?after=2021-01-01&before=2021-01-30' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}'
  
RESPONSE

Python

BrcodePayment(
    amount=0,
    brcode=00020101021226890014br.gov.bcb.pix2567brcode-h.sandbox.starkinfra.com/v2/ace289aac1ce453b9ca64fb12ec525855204000053039865802BR5925Stark Bank S.A. - Institu6009Sao Paulo62070503***63044DDF,
    created=2021-01-03 18:36:18.574799,
    description=this will be fast,
    fee=0,
    id=5717797661310976,
    name=None,
    rules=[
        Rule(
            key=resendingLimit,
            value=5
        )
    ],
    scheduled=2021-01-13 10:00:00,
    status=creating,
    tags=['pix', 'qrcode'],
    tax_id=***.345.678-**,
    transaction_ids=[],
    type=dynamic,
    updated=2021-01-03 18:36:18.574815
)
  

Javascript

BrcodePayment {
    id: '5717797661310976',
    brcode: '00020101021226890014br.gov.bcb.pix2567brcode-h.sandbox.starkinfra.com/v2/ace289aac1ce453b9ca64fb12ec525855204000053039865802BR5925Stark Bank S.A. - Institu6009Sao Paulo62070503***63044DDF',
    taxId: '***.345.678-**',
    name: null,
    description: 'this will be fast',
    amount: 0,
    scheduled: '2021-01-13T10:00:00+00:00',
    tags: [ 'pix', 'qrcode' ],
    rules: [ 
        { 
            key: 'resendingLimit', 
            value: 5 
        } 
    ],
    status: 'creating',
    type: 'dynamic',
    fee: 0,
    updated: '2021-01-03T18:36:23.200972+00:00',
    created: '2021-01-03T18:36:23.200957+00:00',
    transactionIds: []
}
  

PHP

StarkBank\BrcodePayment Object
(
    [id] => 5717797661310976
    [brcode] => 00020101021226890014br.gov.bcb.pix2567brcode-h.sandbox.starkinfra.com/v2/ace289aac1ce453b9ca64fb12ec525855204000053039865802BR5925Stark Bank S.A. - Institu6009Sao Paulo62070503***63044DDF
    [taxId] => ***.345.678-**
    [description] => this will be fast
    [amount] => 0
    [scheduled] => DateTime Object
        (
            [date] => 2021-01-13 10:00:00.000000
            [timezone_type] => 1
            [timezone] => +00:00
        )

    [name] => 
    [tags] => Array
        (
            [0] => pix
            [1] => qrcode
        )

    [rules] => Array
        (
            [0] => StarkBank\BrcodePayment\Rule Object
                (
                    [key] => resendingLimit
                    [value] => 5
                )

        )

    [status] => creating
    [type] => dynamic
    [transactionIds] => Array
        (
        )

    [fee] => 0
    [updated] => DateTime Object
        (
            [date] => 2021-01-03 18:36:18.739116
            [timezone_type] => 1
            [timezone] => +00:00
        )

    [created] => DateTime Object
        (
            [date] => 2021-01-03 18:36:18.739116
            [timezone_type] => 1
            [timezone] => +00:00
        )

)
  

Java

BrcodePayment({
    "brcode": "00020101021226890014br.gov.bcb.pix2567brcode-h.sandbox.starkinfra.com/v2/ace289aac1ce453b9ca64fb12ec525855204000053039865802BR5925Stark Bank S.A. - Institu6009Sao Paulo62070503***63044DDF",
    "taxId": "***.345.678-**",
    "description": "this will be fast",
    "amount": 0,
    "scheduled": "2021-01-13T10:00:00+00:00",
    "tags": [
        "pix",
        "qrcode"
    ],
    "rules": [
        {
            "key": "resendingLimit",
            "value": 5
        }
    ],
    "status": "creating",
    "name": "",
    "type": "dynamic",
    "transactionIds": [],
    "fee": 0,
    "updated": "2021-01-03T18:36:18.142541+00:00",
    "created": "2021-01-03T18:36:18.142526+00:00",
    "id": "5717797661310976"
})
  

Ruby

brcodepayment(
    id: 5717797661310976,
    brcode: 00020101021226890014br.gov.bcb.pix2567brcode-h.sandbox.starkinfra.com/v2/ace289aac1ce453b9ca64fb12ec525855204000053039865802BR5925Stark Bank S.A. - Institu6009Sao Paulo62070503***63044DDF,
    tax_id: ***.345.678-**,
    description: this will be fast,
    amount: 0,
    scheduled: 2021-01-13T10:00:00+00:00,
    tags: ["pix", "qrcode"],
    rules: [
        rule(
            key: resendingLimit,
            value: 5
        )
    ],
    name: ,
    status: creating,
    type: dynamic,
    transaction_ids: [],
    fee: 0,
    updated: 2021-01-03T18:36:18+00:00,
    created: 2021-01-03T18:36:18+00:00
)
  

Elixir

%StarkBank.BrcodePayment{
    amount: 0,
    brcode: 00020101021226890014br.gov.bcb.pix2567brcode-h.sandbox.starkinfra.com/v2/ace289aac1ce453b9ca64fb12ec525855204000053039865802BR5925Stark Bank S.A. - Institu6009Sao Paulo62070503***63044DDF,
    created: ~U[2021-01-03 18:36:00.235426Z],
    description: "this will be fast",
    fee: 0,
    id: "5717797661310976",
    name: "",
    scheduled: ~U[2021-01-13 10:00:00.000000Z],
    rules: [
        %StarkBank.BrcodePayment.Rules{
            key: "resendingLimit",
            value: 5
        }
    ]
    status: "creating",
    tags: ["pix", "qrcode"],
    transaction_ids: [],
    tax_id: "***.345.678-**",
    type: "dynamic",
    updated: ~U[2021-01-03 18:36:00.235440Z]
}
  

C#

BrcodePayment(
    Brcode: 00020101021226890014br.gov.bcb.pix2567brcode-h.sandbox.starkinfra.com/v2/ace289aac1ce453b9ca64fb12ec525855204000053039865802BR5925Stark Bank S.A. - Institu6009Sao Paulo62070503***63044DDF,
    Tags: { pix, qrcode },
    Scheduled: 13/01/2021 10:00:00,
    Name: null,
    TaxID: ***.345.678-**,
    Amount: 0,
    Rules: Rule(
        Key: resendingLimit,
        Value: 5
    )
    Status: creating,
    Type: dynamic,
    Description: this will be fast,
    ID: 5717797661310976,
    Fee: 0,
    Created: 03/01/2021 18:36:00,
    Updated: 03/01/2021 18:36:00,
    TransactionIds: {  },
)
  

Go

{
    Id:5717797661310976 
    Brcode:00020101021226890014br.gov.bcb.pix2567brcode-h.sandbox.starkinfra.com/v2/ace289aac1ce453b9ca64fb12ec525855204000053039865802BR5925Stark Bank S.A. - Institu6009Sao Paulo62070503***63044DDF 
    TaxId:***.345.678-**
    Description:this will be fast 
    Amount:0 
    Scheduled:2021-01-13 10:00:00.000000 +0000 +0000 
    Rules:[
        {
            Key:resendingLimit 
            Value:5
        }
    ]
    Tags:[pix qrcode] 
    Name: 
    Status:creating 
    Type:dynamic 
    TransactionIds:[] 
    Fee:0 
    Updated:2021-01-03 18:36:00.796544 +0000 +0000 
    Created:2021-01-03 18:36:00.796529 +0000 +0000
}
  

Clojure

{
    :description this will be fast,
    :name ,
    :amount 0,
    :fee 0,
    :tags [pix, qrcode],
    :transaction-ids [],
    :updated 2021-01-03T18:36:00.892863+00:00,
    :tax-id ***.345.678-**,
    :type dynamic,
    :created 2021-01-03T18:36:00.892848+00:00,
    :status creating,
    :id 5717797661310976,
    :scheduled 2021-01-12T10:00:00.000000+00:00,
    :brcode 00020101021226890014br.gov.bcb.pix2567brcode-h.sandbox.starkinfra.com/v2/ace289aac1ce453b9ca64fb12ec525855204000053039865802BR5925Stark Bank S.A. - Institu6009Sao Paulo62070503***63044DDF
}
  

Curl

{
    "cursor": null,
    "payments": [
        {
            "amount": 0,
            "brcode": "00020101021226890014br.gov.bcb.pix2567brcode-h.sandbox.starkinfra.com/v2/ace289aac1ce453b9ca64fb12ec525855204000053039865802BR5925Stark Bank S.A. - Institu6009Sao Paulo62070503***63044DDF",
            "created": "2021-01-03T18:36:00.369014+00:00",
            "description": "this will be fast",
            "fee": 0,
            "id": "5717797661310976",
            "name": null,
            "rules": [
                {
                    "key": "resendingLimit",
                    "value": 5
                }
            ],
            "scheduled": "2021-01-13T10:00:00.000000+00:00",
            "status": "creating",
            "tags": ["pix", "qrcode"],
            "taxId": "***.345.678-**",
            "transactionIds": [],
            "type": "dynamic",
            "updated": "2021-01-03T18:36:00.369028+00:00"
        }
    ]
}
  

Get a Brcode Payment

Get a single brcode by its id.

Parameters

id REQUIRED

Id of the brcode entity.

fields OPTIONAL

List of strings to filter response JSON keys. Not available in the SDKs.

ENDPOINT
GET /v2/brcode-payment/:id
REQUEST

Python

import starkbank

payment = starkbank.brcodepayment.get("5717797661310976")

print(payment)
  

Javascript

const starkbank = require('starkbank');

(async() => {
    let payment = await starkbank.brcodePayment.get('5717797661310976')

    console.log(payment);
})();
  

PHP

use StarkBank\BrcodePayment;

$payment = BrcodePayment::get("5717797661310976");

print_r($payment);
  

Java

import com.starkbank.*;

BrcodePayment payment = BrcodePayment.get("5717797661310976");

System.out.println(payment);
  

Ruby

require('starkbank')

payment = StarkBank::BrcodePayment.get('5717797661310976')

puts payment
  

Elixir

payment = StarkBank.BrcodePayment.get!("5717797661310976")

|> IO.inspect
  

C#

using System;

StarkBank.BrcodePayment payment = StarkBank.BrcodePayment.Get("5717797661310976");

Console.WriteLine(payment);
  

Go

package main

import (
    "fmt"
    "github.com/starkbank/sdk-go/starkbank/brcodepayment"
)

func main() {

    payment, err := brcodepayment.Get("5717797661310976", nil)
    if err.Errors != nil {
        for _, e := range err.Errors {
            fmt.Printf("code: %s, message: %s", e.Code, e.Message)
        }
    }

    fmt.Printf("%+v", payment)
}
  

Clojure

(def payment (starkbank.brcode-payment/get "5717797661310976"))

(println payment)
  

Curl

curl --location --request GET '{{baseUrl}}/v2/brcode-payment/5717797661310976' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}'
  
RESPONSE

Python

BrcodePayment(
    amount=0,
    brcode=00020101021226890014br.gov.bcb.pix2567brcode-h.sandbox.starkinfra.com/v2/ace289aac1ce453b9ca64fb12ec525855204000053039865802BR5925Stark Bank S.A. - Institu6009Sao Paulo62070503***63044DDF,
    created=2021-01-03 18:36:18.574799,
    description=this will be fast,
    fee=0,
    id=5717797661310976,
    name=None,
    rules=[
        Rule(
            key=resendingLimit,
            value=5
        )
    ],
    scheduled=2021-01-13 10:00:00,
    status=creating,
    tags=['pix', 'qrcode'],
    tax_id=***.345.678-**,
    transaction_ids=[],
    type=dynamic,
    updated=2021-01-03 18:36:18.574815
)
  

Javascript

BrcodePayment {
    id: '5717797661310976',
    brcode: '00020101021226890014br.gov.bcb.pix2567brcode-h.sandbox.starkinfra.com/v2/ace289aac1ce453b9ca64fb12ec525855204000053039865802BR5925Stark Bank S.A. - Institu6009Sao Paulo62070503***63044DDF',
    taxId: '***.345.678-**',
    name: null,
    description: 'this will be fast',
    amount: 0,
    scheduled: '2021-01-13T10:00:00+00:00',
    tags: [ 'pix', 'qrcode' ],
    rules: [ 
        { 
            key: 'resendingLimit', 
            value: 5 
        } 
    ],
    status: 'creating',
    type: 'dynamic',
    fee: 0,
    updated: '2021-01-03T18:36:23.200972+00:00',
    created: '2021-01-03T18:36:23.200957+00:00',
    transactionIds: []
}
  

PHP

StarkBank\BrcodePayment Object
(
    [id] => 5717797661310976
    [brcode] => 00020101021226890014br.gov.bcb.pix2567brcode-h.sandbox.starkinfra.com/v2/ace289aac1ce453b9ca64fb12ec525855204000053039865802BR5925Stark Bank S.A. - Institu6009Sao Paulo62070503***63044DDF
    [taxId] => ***.345.678-**
    [description] => this will be fast
    [amount] => 0
    [scheduled] => DateTime Object
        (
            [date] => 2021-01-13 10:00:00.000000
            [timezone_type] => 1
            [timezone] => +00:00
        )

    [name] => 
    [tags] => Array
        (
            [0] => pix
            [1] => qrcode
        )

    [rules] => Array
        (
            [0] => StarkBank\BrcodePayment\Rule Object
                (
                    [key] => resendingLimit
                    [value] => 5
                )

        )

    [status] => creating
    [type] => dynamic
    [transactionIds] => Array
        (
        )

    [fee] => 0
    [updated] => DateTime Object
        (
            [date] => 2021-01-03 18:36:18.739116
            [timezone_type] => 1
            [timezone] => +00:00
        )

    [created] => DateTime Object
        (
            [date] => 2021-01-03 18:36:18.739116
            [timezone_type] => 1
            [timezone] => +00:00
        )

)
  

Java

BrcodePayment({
    "brcode": "00020101021226890014br.gov.bcb.pix2567brcode-h.sandbox.starkinfra.com/v2/ace289aac1ce453b9ca64fb12ec525855204000053039865802BR5925Stark Bank S.A. - Institu6009Sao Paulo62070503***63044DDF",
    "taxId": "***.345.678-**",
    "description": "this will be fast",
    "amount": 0,
    "scheduled": "2021-01-13T10:00:00+00:00",
    "tags": [
        "pix",
        "qrcode"
    ],
    "rules": [
        {
            "key": "resendingLimit",
            "value": 5
        }
    ],
    "status": "creating",
    "name": "",
    "type": "dynamic",
    "transactionIds": [],
    "fee": 0,
    "updated": "2021-01-03T18:36:18.142541+00:00",
    "created": "2021-01-03T18:36:18.142526+00:00",
    "id": "5717797661310976"
})
  

Ruby

brcodepayment(
    id: 5717797661310976,
    brcode: 00020101021226890014br.gov.bcb.pix2567brcode-h.sandbox.starkinfra.com/v2/ace289aac1ce453b9ca64fb12ec525855204000053039865802BR5925Stark Bank S.A. - Institu6009Sao Paulo62070503***63044DDF,
    tax_id: ***.345.678-**,
    description: this will be fast,
    amount: 0,
    scheduled: 2021-01-13T10:00:00+00:00,
    tags: ["pix", "qrcode"],
    rules: [
        rule(
            key: resendingLimit,
            value: 5
        )
    ],
    name: ,
    status: creating,
    type: dynamic,
    transaction_ids: [],
    fee: 0,
    updated: 2021-01-03T18:36:18+00:00,
    created: 2021-01-03T18:36:18+00:00
)
  

Elixir

%StarkBank.BrcodePayment{
    amount: 0,
    brcode: 00020101021226890014br.gov.bcb.pix2567brcode-h.sandbox.starkinfra.com/v2/ace289aac1ce453b9ca64fb12ec525855204000053039865802BR5925Stark Bank S.A. - Institu6009Sao Paulo62070503***63044DDF,
    created: ~U[2021-01-03 18:36:00.235426Z],
    description: "this will be fast",
    fee: 0,
    id: "5717797661310976",
    name: "",
    scheduled: ~U[2021-01-13 10:00:00.000000Z],
    rules: [
        %StarkBank.BrcodePayment.Rules{
            key: "resendingLimit",
            value: 5
        }
    ]
    status: "creating",
    tags: ["pix", "qrcode"],
    transaction_ids: [],
    tax_id: "***.345.678-**",
    type: "dynamic",
    updated: ~U[2021-01-03 18:36:00.235440Z]
}
  

C#

BrcodePayment(
    Brcode: 00020101021226890014br.gov.bcb.pix2567brcode-h.sandbox.starkinfra.com/v2/ace289aac1ce453b9ca64fb12ec525855204000053039865802BR5925Stark Bank S.A. - Institu6009Sao Paulo62070503***63044DDF,
    Tags: { pix, qrcode },
    Scheduled: 13/01/2021 10:00:00,
    Name: null,
    TaxID: ***.345.678-**,
    Amount: 0,
    Rules: Rule(
        Key: resendingLimit,
        Value: 5
    )
    Status: creating,
    Type: dynamic,
    Description: this will be fast,
    ID: 5717797661310976
    Fee: 0,
    Created: 03/01/2021 18:36:00,
    Updated: 03/01/2021 18:36:00,
    TransactionIds: {  },
)
  

Go

{
    Id:5717797661310976 
    Brcode:00020101021226890014br.gov.bcb.pix2567brcode-h.sandbox.starkinfra.com/v2/ace289aac1ce453b9ca64fb12ec525855204000053039865802BR5925Stark Bank S.A. - Institu6009Sao Paulo62070503***63044DDF 
    TaxId:***.345.678-**
    Description:this will be fast 
    Amount:0 
    Scheduled:2021-01-13 10:00:00.000000 +0000 +0000 
    Rules:[
        {
            Key:resendingLimit 
            Value:5
        }
    ]
    Tags:[pix qrcode] 
    Name: 
    Status:creating 
    Type:dynamic 
    TransactionIds:[] 
    Fee:0 
    Updated:2021-01-03 18:36:00.796544 +0000 +0000 
    Created:2021-01-03 18:36:00.796529 +0000 +0000
}
  

Clojure

{
    :description this will be fast,
    :name ,
    :amount 0,
    :fee 0,
    :tags [pix, qrcode],
    :transaction-ids [],
    :updated 2021-01-03T18:36:00.892863+00:00,
    :tax-id ***.345.678-**,
    :type dynamic,
    :created 2021-01-03T18:36:00.892848+00:00,
    :status creating,
    :id 5717797661310976,
    :scheduled 2021-01-12T10:00:00.000000+00:00,
    :brcode 00020101021226890014br.gov.bcb.pix2567brcode-h.sandbox.starkinfra.com/v2/ace289aac1ce453b9ca64fb12ec525855204000053039865802BR5925Stark Bank S.A. - Institu6009Sao Paulo62070503***63044DDF
}
  

Curl

{
    "payment": {
        "amount": 0,
        "brcode": "00020101021226890014br.gov.bcb.pix2567brcode-h.sandbox.starkinfra.com/v2/ace289aac1ce453b9ca64fb12ec525855204000053039865802BR5925Stark Bank S.A. - Institu6009Sao Paulo62070503***63044DDF",
        "created": "2021-01-03T18:36:00.369014+00:00",
        "description": "this will be fast",
        "fee": 0,
        "id": "5717797661310976",
        "name": null,
        "rules": [
            {
                "key": "resendingLimit",
                "value": 5
            }
        ],
        "scheduled": "2021-01-13T10:00:00.000000+00:00",
        "status": "creating",
        "tags": ["pix", "qrcode"],
        "taxId": "***.345.678-**",
        "transactionIds": [],
        "type": "dynamic",
        "updated": "2021-01-03T18:36:00.369028+00:00"
    }
}
  

Update a Brcode Payment

Update a single brcode payment, if it hasn't been paid yet.

Parameters

id REQUIRED

Id of the brcode payment entity.

status OPTIONAL

This can be used to cancel the payment by passing "canceled" as the status patch.

ENDPOINT
PATCH /v2/brcode-payment/:id
REQUEST

Python

import starkbank

payment = starkbank.brcodepayment.update("5717797661310976", status="canceled")

print(payment)
  

Javascript

const starkbank = require('starkbank');

(async() => {
    let payment = await starkbank.brcodePayment.update('5717797661310976', {status: 'canceled'});
    console.log(payment);
})();
  

PHP

use StarkBank\BrcodePayment;

$payment = BrcodePayment::update(
    "5717797661310976",
    [
        "status" => "canceled"
    ]
);

print_r($payment);
  

Java

import com.starkbank.*;

HashMap<String, Object> patchData = new HashMap<>();
patchData.put("status", "canceled");

BrcodePayment payment = BrcodePayment.update("5717797661310976", patchData);

System.out.println(payment);
  

Ruby

require('starkbank')

payment = StarkBank::BrcodePayment.update('5717797661310976', status: 'canceled')

puts payment
  

Elixir

payment = StarkBank.BrcodePayment.update!(
    "5717797661310976", 
    status: "canceled"
    )
|> IO.inspect
  

C#

StarkBank.BrcodePayment payment = StarkBank.BrcodePayment.Update(
    "5717797661310976",
    status: "canceled"
);

Console.WriteLine(payment);
  

Go

package main

import (
    "fmt"
    "github.com/starkbank/sdk-go/starkbank/invoice"
)

func main() {

    var patchData = map[string]interface{}{}
    patchData["status"] = "canceled"

    payment, err := brcodePayment.Update("5717797661310976", patchData, nil)
    if err.Errors != nil {
        for _, e := range err.Errors {
            fmt.Printf("code: %s, message: %s", e.Code, e.Message)
        }
    }

    fmt.Printf("%+v", payment)
}
  

Clojure

(def payment (starkbank.brcode-payment/update "5717797661310976" {:status "canceled"}))

(println payment)
  

Curl

curl --location --request PATCH '{{baseUrl}}/v2/brcode-payment/5717797661310976' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}' 
--header 'Content-Type: application/json' 
--data-raw '{
    "status": "canceled",
}'
  
RESPONSE

Python

BrcodePayment(
    amount=0,
    brcode=00020101021226890014br.gov.bcb.pix2567brcode-h.sandbox.starkinfra.com/v2/ace289aac1ce453b9ca64fb12ec525855204000053039865802BR5925Stark Bank S.A. - Institu6009Sao Paulo62070503***63044DDF,
    created=2021-01-03 18:36:18.574799,
    description=this will be fast,
    fee=0,
    id=5717797661310976,
    name=None,
    rules=[
        Rule(
            key=resendingLimit,
            value=5
        )
    ],
    scheduled=2021-01-13 10:00:00,
    status=canceled,
    tags=['pix', 'qrcode'],
    tax_id=***.345.678-**,
    transaction_ids=[],
    type=dynamic,
    updated=2021-01-03 18:36:18.574815
)
  

Javascript

BrcodePayment {
    id: '5717797661310976',
    brcode: '00020101021226890014br.gov.bcb.pix2567brcode-h.sandbox.starkinfra.com/v2/ace289aac1ce453b9ca64fb12ec525855204000053039865802BR5925Stark Bank S.A. - Institu6009Sao Paulo62070503***63044DDF',
    taxId: '***.345.678-**',
    name: null,
    description: 'this will be fast',
    amount: 0,
    scheduled: '2021-01-13T10:00:00+00:00',
    tags: [ 'pix', 'qrcode' ],
    rules: [ 
        { 
            key: 'resendingLimit', 
            value: 5 
        } 
    ],
    status: 'canceled',
    type: 'dynamic',
    fee: 0,
    updated: '2021-01-03T18:36:23.200972+00:00',
    created: '2021-01-03T18:36:23.200957+00:00',
    transactionIds: []
}
  

PHP

StarkBank\BrcodePayment Object
(
    [id] => 5717797661310976
    [brcode] => 00020101021226890014br.gov.bcb.pix2567brcode-h.sandbox.starkinfra.com/v2/ace289aac1ce453b9ca64fb12ec525855204000053039865802BR5925Stark Bank S.A. - Institu6009Sao Paulo62070503***63044DDF
    [taxId] => ***.345.678-**
    [description] => this will be fast
    [amount] => 0
    [scheduled] => DateTime Object
        (
            [date] => 2021-01-13 10:00:00.000000
            [timezone_type] => 1
            [timezone] => +00:00
        )

    [name] => 
    [tags] => Array
        (
            [0] => pix
            [1] => qrcode
        )

    [rules] => Array
        (
            [0] => StarkBank\BrcodePayment\Rule Object
                (
                    [key] => resendingLimit
                    [value] => 5
                )

        )

    [status] => canceled
    [type] => dynamic
    [transactionIds] => Array
        (
        )

    [fee] => 0
    [updated] => DateTime Object
        (
            [date] => 2021-01-03 18:36:18.739116
            [timezone_type] => 1
            [timezone] => +00:00
        )

    [created] => DateTime Object
        (
            [date] => 2021-01-03 18:36:18.739116
            [timezone_type] => 1
            [timezone] => +00:00
        )

)
  

Java

BrcodePayment({
    "brcode": "00020101021226890014br.gov.bcb.pix2567brcode-h.sandbox.starkinfra.com/v2/ace289aac1ce453b9ca64fb12ec525855204000053039865802BR5925Stark Bank S.A. - Institu6009Sao Paulo62070503***63044DDF",
    "taxId": "***.345.678-**",
    "description": "this will be fast",
    "amount": 0,
    "scheduled": "2021-01-13T10:00:00+00:00",
    "tags": [
        "pix",
        "qrcode"
    ],
    "rules": [
        {
            "key": "resendingLimit",
            "value": 5
        }
    ],
    "status": "canceled",
    "name": "",
    "type": "dynamic",
    "transactionIds": [],
    "fee": 0,
    "updated": "2021-01-03T18:36:18.142541+00:00",
    "created": "2021-01-03T18:36:18.142526+00:00",
    "id": "5717797661310976"
})
  

Ruby

brcodepayment(
    id: 5717797661310976,
    brcode: 00020101021226890014br.gov.bcb.pix2567brcode-h.sandbox.starkinfra.com/v2/ace289aac1ce453b9ca64fb12ec525855204000053039865802BR5925Stark Bank S.A. - Institu6009Sao Paulo62070503***63044DDF,
    tax_id: ***.345.678-**,
    description: this will be fast,
    amount: 0,
    scheduled: 2021-01-13T10:00:00+00:00,
    tags: ["pix", "qrcode"],
    rules: [
        rule(
            key: resendingLimit,
            value: 5
        )
    ],
    name: ,
    status: canceled,
    type: dynamic,
    transaction_ids: [],
    fee: 0,
    updated: 2021-01-03T18:36:18+00:00,
    created: 2021-01-03T18:36:18+00:00
)
  

Elixir

%StarkBank.BrcodePayment{
    amount: 0,
    brcode: 00020101021226890014br.gov.bcb.pix2567brcode-h.sandbox.starkinfra.com/v2/ace289aac1ce453b9ca64fb12ec525855204000053039865802BR5925Stark Bank S.A. - Institu6009Sao Paulo62070503***63044DDF,
    created: ~U[2021-01-03 18:36:00.235426Z],
    description: "this will be fast",
    fee: 0,
    id: "5717797661310976",
    name: "",
    scheduled: ~U[2021-01-13 10:00:00.000000Z],
    rules: [
        %StarkBank.BrcodePayment.Rules{
            key: "resendingLimit",
            value: 5
        }
    ]
    status: "canceled",
    tags: ["pix", "qrcode"],
    transaction_ids: [],
    tax_id: "***.345.678-**",
    type: "dynamic",
    updated: ~U[2021-01-03 18:36:00.235440Z]
}
  

C#

BrcodePayment(
    Brcode: 00020101021226890014br.gov.bcb.pix2567brcode-h.sandbox.starkinfra.com/v2/ace289aac1ce453b9ca64fb12ec525855204000053039865802BR5925Stark Bank S.A. - Institu6009Sao Paulo62070503***63044DDF,
    Tags: { pix, qrcode },
    Scheduled: 13/01/2021 10:00:00,
    Name: null,
    TaxID: ***.345.678-**,
    Amount: 0,
    Rules: Rule(
        Key: resendingLimit,
        Value: 5
    )
    Status: canceled,
    Type: dynamic,
    Description: this will be fast,
    ID: 5717797661310976
    Fee: 0,
    Created: 03/01/2021 18:36:00,
    Updated: 03/01/2021 18:36:00,
    TransactionIds: {  }
)
  

Go

{
    Id:5717797661310976 
    Brcode:00020101021226890014br.gov.bcb.pix2567brcode-h.sandbox.starkinfra.com/v2/ace289aac1ce453b9ca64fb12ec525855204000053039865802BR5925Stark Bank S.A. - Institu6009Sao Paulo62070503***63044DDF 
    TaxId:***.345.678-**
    Description:this will be fast 
    Amount:0 
    Scheduled:2021-01-13 10:00:00.000000 +0000 +0000 
    Rules:[
        {
            Key:resendingLimit 
            Value:5
        }
    ]
    Tags:[pix qrcode] 
    Name: 
    Status:canceled 
    Type:dynamic 
    TransactionIds:[] 
    Fee:0 
    Updated:2021-01-03 18:36:00.796544 +0000 +0000 
    Created:2021-01-03 18:36:00.796529 +0000 +0000
}
  

Clojure

{
    :description this will be fast,
    :name ,
    :amount 0,
    :fee 0,
    :tags [pix, qrcode],
    :transaction-ids [],
    :updated 2021-01-03T18:36:00.892863+00:00,
    :tax-id ***.345.678-**,
    :type dynamic,
    :created 2021-01-03T18:36:00.892848+00:00,
    :status canceled,
    :id 5717797661310976,
    :scheduled 2021-01-12T10:00:00.000000+00:00,
    :brcode 00020101021226890014br.gov.bcb.pix2567brcode-h.sandbox.starkinfra.com/v2/ace289aac1ce453b9ca64fb12ec525855204000053039865802BR5925Stark Bank S.A. - Institu6009Sao Paulo62070503***63044DDF
}
  

Curl

{
    "message": "Payment successfully patched",
    "invoice": {
        "amount": 0,
        "brcode": "00020101021226890014br.gov.bcb.pix2567brcode-h.sandbox.starkinfra.com/v2/ace289aac1ce453b9ca64fb12ec525855204000053039865802BR5925Stark Bank S.A. - Institu6009Sao Paulo62070503***63044DDF",
        "created": "2021-01-03T18:36:00.369014+00:00",
        "description": "this will be fast",
        "fee": 0,
        "id": "5717797661310976",
        "name": null,
        "rules": [
            {
                "key": "resendingLimit",
                "value": 5
            }
        ],
        "scheduled": "2021-01-13T10:00:00.000000+00:00",
        "status": "canceled",
        "tags": ["pix", "qrcode"],
        "taxId": "***.345.678-**",
        "transactionIds": [],
        "type": "dynamic",
        "updated": "2021-01-03T18:36:00.369028+00:00"
    }
}
  

Get a Brcode Payment PDF

Get a brcode payment PDF receipt. You can only get a receipt for payments whose status are either success, processing or created.

Parameters

id REQUIRED

Id of the brcode payment entity

ENDPOINT
GET /v2/brcode-payment/:id/pdf
REQUEST

Python

import starkbank

pdf = starkbank.brcodepayment.pdf("5717797661310976")

with open("brcode-payment.pdf", "wb") as file:
    file.write(pdf)
  

Javascript

const starkbank = require('starkbank');
const fs = require('fs').promises;

(async() => {
    let pdf = await starkbank.brcodePayment.pdf('5717797661310976');
    await fs.writeFile('brcode-payment.pdf', pdf);
})();
  

PHP

$pdf = StarkBank\BrcodePayment::pdf("5717797661310976");

$fp = fopen('brcode-payment.pdf', 'w');
fwrite($fp, $pdf);
fclose($fp);
  

Java

import java.io.File;
import java.io.InputStream;
import java.nio.file.StandardCopyOption;
import com.starkbank.*;

InputStream pdf = BrcodePayment.pdf("5717797661310976");

java.nio.file.Files.copy(
    pdf,
    new File("brcode-payment.pdf").toPath(),
    StandardCopyOption.REPLACE_EXISTING
);
  

Ruby

require('starkbank')

pdf = StarkBank::BrcodePayment.pdf('5717797661310976')

File.open('brcode-payment.pdf', 'w') { |file| file.write(pdf) }
  

Elixir

pdf = StarkBank.BrcodePayment.pdf!("5717797661310976")

file = File.open!("brcode-payment.pdf", [:write])
IO.binwrite(file, pdf)
File.close(file)
  

C#

byte[] pdf = StarkBank.BrcodePayment.Pdf("5717797661310976");

System.IO.File.WriteAllBytes("brcode-payment.pdf", pdf);
  

Go

package main

import (
    "fmt"
    "github.com/starkbank/sdk-go/starkbank/brcodepayment"
)

func main() {

    pdf, err := brcodepayment.Pdf("5717797661310976", nil)
    if err.Errors != nil {
        for _, e := range err.Errors {
            fmt.Printf("code: %s, message: %s", e.Code, e.Message)
        }
    }

    errFile := ioutil.WriteFile("brcodepayment.pdf", pdf, 0666)
    if errFile != nil {
        fmt.Print(errFile)
    }
}
  

Clojure

(def file-name "brcode-payment.pdf")
(io/make-parents file-name)
(io/copy (starkbank.brcode-payment/pdf "5717797661310976") (io/file file-name))
  

Curl

curl --location --request GET '{{baseUrl}}/v2/brcode-payment/5717797661310976/pdf' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}'
  

List Brcode Payment Logs

Get a paged list of all brcode payment logs. A log tracks a change in the payment entity according to its life cycle.

Parameters

after OPTIONAL

Filter entities created after this date.

before OPTIONAL

Filter entities created before this date.

cursor OPTIONAL

String used to get the next batch of results. Our SDKs handle this for you.

fields OPTIONAL

List of strings to filter response JSON keys. Not available in the SDKs.

limit OPTIONAL

Number of results per cursor. Max = 100.

paymentIds OPTIONAL

Array of payment ids linked to the desired logs.

types OPTIONAL

Filters logs by log types.

ENDPOINT
GET /v2/brcode-payment/log
REQUEST

Python

import starkbank

logs = starkbank.brcodepayment.log.query(
    after="2021-01-01",
    before="2021-01-30",
    payment_ids=["5717797661310976"]
)

for log in logs:
    print(log)
  

Javascript

const starkbank = require('starkbank');

(async() => {
    let logs = await starkbank.brcodePayment.log.query({
        after: '2021-01-01',
        before: '2021-01-30',
        paymentIds: ['5717797661310976']
    });

    for await (let log of logs) {
        console.log(log);
    }
})();
  

PHP

use StarkBank\BrcodePayment;

$logs = BrcodePayment\Log::query([
    "after" => "2021-01-01",
    "before" => "2021-01-30",
    "paymentIds" => ["5717797661310976"]
]);

foreach($logs as $log){
    print_r($log);
}
  

Java

import com.starkbank.*;
import com.starkbank.utils.Generator;
import java.util.HashMap;

HashMap<String, Object> params = new HashMap<>();
params.put("after", "2021-01-01");
params.put("before", "2021-01-30");
params.put("paymentIds", "5717797661310976");
Generator<BrcodePayment.Log> logs = BrcodePayment.Log.query(params);

for (BrcodePayment.Log log : logs){
    System.out.println(log);
}
  

Ruby

require('starkbank')

logs = StarkBank::BrcodePayment::Log.query(
  after: "2021-01-01",
  before: "2021-01-30",
  payment_ids: %w[5717797661310976]
)

logs.each do |log|
  puts log
end
  

Elixir

logs = StarkBank.BrcodePayment.Log.query!(
    after: "2021-01-01",
    before: "2021-01-30",
    payment_ids: ["5717797661310976"]
)

for log <- logs do
    log |> IO.inspect
end
  

C#

using System;
using System.Collections.Generic;

IEnumerable<StarkBank.BrcodePayment.Log> logs = StarkBank.BrcodePayment.Log.Query(
    after: new DateTime(2021, 1, 1),
    before: new DateTime(2021, 1, 30),
    paymentIds: new List<string> { "5717797661310976" }
);

foreach (StarkBank.BrcodePayment.Log log in logs)
{
    Console.WriteLine(log);
}
  

Go

package main

import (
    "fmt"
    "time"
    "github.com/starkbank/sdk-go/starkbank/brcodepayment/log"
)

func main() {

    var params = map[string]interface{}{}
    params["after"] = time.Date(2021, 1, 1, 0, 0, 0, 0, time.UTC)
    params["before"] = time.Date(2021, 1, 30, 0, 0, 0, 0, time.UTC)
    
    logs, errorChannel := log.Query(params, nil)

    loop:
    for {
        select {
        case err := <-errorChannel:
            if err.Errors != nil {
                for _, e := range err.Errors {
                    fmt.Printf("code: %s, message: %s", e.Code, e.Message)
                }
            }
        case log, ok := <-logs:
            if !ok {
                break loop
            }
            fmt.Printf("%+v", log)
        }
    }
}
  

Clojure

(def logs (starkbank.brcode-payment.log/query {:after "2021-01-01" :before "2021-01-30"}))

(doseq [log logs]
    (println log))
  

Curl

curl --location --request GET '{{baseUrl}}/v2/brcode-payment/log?paymentIds=5717797661310976&after=2021-01-01&before=2021-01-30' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}'
  
RESPONSE

Python

Log(
    created=2021-01-03 18:36:18.966033,
    errors=[],
    id=5172860540682240,
    payment=BrcodePayment(
        amount=0,
        brcode=00020101021226890014br.gov.bcb.pix2567brcode-h.sandbox.starkinfra.com/v2/ace289aac1ce453b9ca64fb12ec525855204000053039865802BR5925Stark Bank S.A. - Institu6009Sao Paulo62070503***63044DDF,
        created=2021-01-03 18:36:18.574799,
        description=this will be fast,
        fee=0,
        id=5717797661310976,
        name=None,
        rules=[
            Rule(
                key=resendingLimit,
                value=5
            )
        ],
        scheduled=2021-01-13 10:00:00,
        status=canceled,
        tags=['pix', 'qrcode'],
        tax_id=***.345.678-**,
        transaction_ids=[],
        type=dynamic,
        updated=2021-01-03 18:36:18.574815
    ),
    type=failed
)
  

Javascript

Log {
    id: '5172860540682240',
    created: '2021-01-03T18:36:18.124698+00:00',
    type: 'failed',
    errors: [  ],
    payment: {
        id: '5717797661310976',
        brcode: '00020101021226890014br.gov.bcb.pix2567brcode-h.sandbox.starkinfra.com/v2/ace289aac1ce453b9ca64fb12ec525855204000053039865802BR5925Stark Bank S.A. - Institu6009Sao Paulo62070503***63044DDF',
        taxId: '***.345.678-**',
        name: null,
        description: 'this will be fast',
        amount: 0,
        scheduled: '2021-01-13T10:00:00+00:00',
        tags: [ 'pix', 'qrcode' ],
        rules: [ 
            { 
                key: 'resendingLimit', 
                value: 5 
            } 
        ],
        status: 'canceled',
        type: 'dynamic',
        fee: 0,
        updated: '2021-01-03T18:36:23.200972+00:00',
        created: '2021-01-03T18:36:23.200957+00:00',
        transactionIds: []
    }
}
  

PHP

StarkBank\BrcodePayment\Log Object
(
    [id] => 5172860540682240
    [created] => DateTime Object
        (
            [date] => 2021-01-03 18:36:18.167983
            [timezone_type] => 1
            [timezone] => +00:00
        )

    [type] => failed
    [errors] => Array
        (
        )

    [payment] => StarkBank\BrcodePayment Object
        (
            [id] => 5717797661310976
            [brcode] => 00020101021226890014br.gov.bcb.pix2567brcode-h.sandbox.starkinfra.com/v2/ace289aac1ce453b9ca64fb12ec525855204000053039865802BR5925Stark Bank S.A. - Institu6009Sao Paulo62070503***63044DDF
            [taxId] => ***.345.678-**
            [description] => this will be fast
            [amount] => 0
            [scheduled] => DateTime Object
                (
                    [date] => 2021-01-13 10:00:00.000000
                    [timezone_type] => 1
                    [timezone] => +00:00
                )
                                
            [name] => 
            [tags] => Array
                (
                    [0] => pix
                    [1] => qrcode
                )
                                
            [rules] => Array
                (
                    [0] => StarkBank\BrcodePayment\Rule Object
                        (
                            [key] => resendingLimit
                            [value] => 5
                        )
                                
                )
                                
            [status] => canceled
            [type] => dynamic
            [transactionIds] => Array
                (
                )
                                
            [fee] => 0
            [updated] => DateTime Object
                (
                    [date] => 2021-01-03 18:36:18.739116
                    [timezone_type] => 1
                    [timezone] => +00:00
                )
                                
            [created] => DateTime Object
                (
                    [date] => 2021-01-03 18:36:18.739116
                    [timezone_type] => 1
                    [timezone] => +00:00
                )

        )

)
  

Java

Log({
    "created": "2021-01-03T18:36:18.481078+00:00",
    "type": "failed",
    "errors": [],
    "payment": {
        "brcode": "00020101021226890014br.gov.bcb.pix2567brcode-h.sandbox.starkinfra.com/v2/ace289aac1ce453b9ca64fb12ec525855204000053039865802BR5925Stark Bank S.A. - Institu6009Sao Paulo62070503***63044DDF",
        "taxId": "***.345.678-**",
        "description": "this will be fast",
        "amount": 0,
        "scheduled": "2021-01-13T10:00:00+00:00",
        "tags": [
            "pix",
            "qrcode"
        ],
        "rules": [
            {
                "key": "resendingLimit",
                "value": 5
            }
        ],
        "status": "canceled",
        "name": "",
        "type": "dynamic",
        "transactionIds": [],
        "fee": 0,
        "updated": "2021-01-03T18:36:18.142541+00:00",
        "created": "2021-01-03T18:36:18.142526+00:00",
        "id": "5717797661310976"
    },
    "id": "5172860540682240"
})
  

Ruby

log(
    id: 5172860540682240,
    type: failed,
    errors: [],
    payment: brcodepayment(
        id: 5717797661310976,
        brcode: 00020101021226890014br.gov.bcb.pix2567brcode-h.sandbox.starkinfra.com/v2/ace289aac1ce453b9ca64fb12ec525855204000053039865802BR5925Stark Bank S.A. - Institu6009Sao Paulo62070503***63044DDF,
        tax_id: ***.345.678-**,
        description: this will be fast,
        amount: 0,
        scheduled: 2021-01-13T10:00:00+00:00,
        tags: ["pix", "qrcode"],
        rules: [
            rule(
                key: resendingLimit,
                value: 5
            )
        ],
        name: ,
        status: canceled,
        type: dynamic,
        transaction_ids: [],
        fee: 0,
        updated: 2021-01-03T18:36:18+00:00,
        created: 2021-01-03T18:36:18+00:00
    ),
    created: 2021-01-03T18:36:18+00:00
)
  

Elixir

%StarkBank.BrcodePayment.Log{
    created: ~U[2021-01-03 18:36:18.742789Z],
    errors: [],
    id: "5172860540682240",
    payment: %StarkBank.BrcodePayment{
        amount: 0,
        brcode: 00020101021226890014br.gov.bcb.pix2567brcode-h.sandbox.starkinfra.com/v2/ace289aac1ce453b9ca64fb12ec525855204000053039865802BR5925Stark Bank S.A. - Institu6009Sao Paulo62070503***63044DDF,
        created: ~U[2021-01-03 18:36:00.235426Z],
        description: "this will be fast",
        fee: 0,
        id: "5717797661310976",
        name: "",
        scheduled: ~U[2021-01-13 10:00:00.000000Z],
        rules: [
            %StarkBank.BrcodePayment.Rules{
                key: "resendingLimit",
                value: 5
            }
        ]
        status: "canceled",
        tags: ["pix", "qrcode"],
        transaction_ids: [],
        tax_id: "***.345.678-**",
        type: "dynamic",
        updated: ~U[2021-01-03 18:36:00.235440Z]
    },
    type: "failed"
}
  

C#

Log(
    Created: 03/01/2020 18:36:18,
    Type: failed,
    Errors: {  },
    Payment: BrcodePayment(
        Brcode: 00020101021226890014br.gov.bcb.pix2567brcode-h.sandbox.starkinfra.com/v2/ace289aac1ce453b9ca64fb12ec525855204000053039865802BR5925Stark Bank S.A. - Institu6009Sao Paulo62070503***63044DDF,
        Tags: { pix, qrcode },
        Scheduled: 13/01/2021 10:00:00,
        Name: null,
        TaxID: ***.345.678-**,
        Amount: 0,
        Rules: Rule(
            Key: resendingLimit,
            Value: 5
        )
        Status: canceled,
        Type: dynamic,
        Description: this will be fast,
        ID: 5717797661310976
        Fee: 0,
        Created: 03/01/2021 18:36:00,
        Updated: 03/01/2021 18:36:00,
        TransactionIds: {  }
    ),
    ID: 5172860540682240
)
  

Go

{
    Id:5172860540682240 
    Payment:{
        Id:5717797661310976 
        Brcode:00020101021226890014br.gov.bcb.pix2567brcode-h.sandbox.starkinfra.com/v2/ace289aac1ce453b9ca64fb12ec525855204000053039865802BR5925Stark Bank S.A. - Institu6009Sao Paulo62070503***63044DDF 
        TaxId:***.345.678-**
        Description:this will be fast 
        Amount:0 
        Scheduled:2021-01-13 10:00:00.000000 +0000 +0000 
        Rules:[
            {
                Key:resendingLimit 
                Value:5
            }
        ]
        Tags:[pix qrcode] 
        Name: 
        Status:canceled 
        Type:dynamic 
        TransactionIds:[] 
        Fee:0 
        Updated:2021-01-03 18:36:00.796544 +0000 +0000 
        Created:2021-01-03 18:36:00.796529 +0000 +0000
    } 
    Errors:[] 
    Type:failed 
    Created:2021-01-03 18:36:18.883935 +0000 +0000
}
  

Clojure

{
    :id 5172860540682240,
    :created 2021-01-03T18:36:18.092065+00:00,
    :errors [This payment is not payable anymore],
    :type failed,
    :payment {
        :description this will be fast,
        :name ,
        :amount 0,
        :fee 0,
        :tags [pix, qrcode],
        :transaction-ids [],
        :updated 2021-01-03T18:36:00.892863+00:00,
        :tax-id ***.345.678-**,
        :type dynamic,
        :created 2021-01-03T18:36:00.892848+00:00,
        :status canceled,
        :id 5717797661310976,
        :scheduled 2021-01-12T10:00:00.000000+00:00,
        :brcode 00020101021226890014br.gov.bcb.pix2567brcode-h.sandbox.starkinfra.com/v2/ace289aac1ce453b9ca64fb12ec525855204000053039865802BR5925Stark Bank S.A. - Institu6009Sao Paulo62070503***63044DDF
    }
}
  

Curl

{
    "cursor": null,
    "logs": [
        {
            "payment": {
                "amount": 0,
                "brcode": "00020101021226890014br.gov.bcb.pix2567brcode-h.sandbox.starkinfra.com/v2/ace289aac1ce453b9ca64fb12ec525855204000053039865802BR5925Stark Bank S.A. - Institu6009Sao Paulo62070503***63044DDF",
                "created": "2021-01-03T18:36:00.369014+00:00",
                "description": "this will be fast",
                "fee": 0,
                "id": "5717797661310976",
                "name": null,
                "rules": [
                    {
                        "key": "resendingLimit",
                        "value": 5
                    }
                ],
                "scheduled": "2021-01-13T10:00:00.000000+00:00",
                "status": "canceled",
                "tags": ["pix", "qrcode"],
                "taxId": "***.345.678-**",
                "transactionIds": [],
                "type": "dynamic",
                "updated": "2021-01-03T18:36:00.369028+00:00"
            },
            "errors": [],
            "type": "failed",
            "id": "5172860540682240",
            "created": "2021-01-03T18:36:18.369868+00:00"
        }
    ]
}
  

Get a Brcode Payment Log

Get a single brcode payment log by its id.

Parameters

id REQUIRED

Id of the log entity

fields OPTIONAL

List of strings to filter response JSON keys. Not available in the SDKs.

ENDPOINT
GET /v2/brcode-payment/log/:id
REQUEST

Python

import starkbank

log = starkbank.brcodepayment.log.get("5172860540682240")

print(log)
  

Javascript

const starkbank = require('starkbank');

(async() => {
    let log = await starkbank.brcodePayment.log.get('5172860540682240');
    console.log(log);
})();
  

PHP

use StarkBank\BrcodePayment;

$log = BrcodePayment\Log::get("5172860540682240");

print_r($log);
  

Java

import com.starkbank.*;

BrcodePayment.Log log = BrcodePayment.Log.get("5172860540682240");

System.out.println(log);
  

Ruby

require('starkbank')

log = StarkBank::BrcodePayment::Log.get('5172860540682240')

puts log
  

Elixir

log = StarkBank.BrcodePayment.Log.get!("5172860540682240")

log |> IO.inspect
  

C#

using System;

StarkBank.BrcodePayment.Log log = StarkBank.BrcodePayment.Log.Get("5172860540682240");

Console.WriteLine(log);
  

Go

package main

import (
    "fmt"
    "github.com/starkbank/sdk-go/starkbank/brcodepayment/log"
)

func main() {

    log, err := log.Get("5172860540682240", nil)
    if err.Errors != nil {
        for _, e := range err.Errors {
            fmt.Printf("code: %s, message: %s", e.Code, e.Message)
        }
    }

    fmt.Printf("%+v", log)
}
  

Clojure

(def log (starkbank.brcode-payment.log/get "5172860540682240"))

(println log)
  

Curl

curl --location --request GET '{{baseUrl}}/v2/brcode-payment/log/5172860540682240' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}'
  
RESPONSE

Python

Log(
    created=2021-01-03 18:36:18.966033,
    errors=[],
    id=5172860540682240,
    payment=BrcodePayment(
        amount=0,
        brcode=00020101021226890014br.gov.bcb.pix2567brcode-h.sandbox.starkinfra.com/v2/ace289aac1ce453b9ca64fb12ec525855204000053039865802BR5925Stark Bank S.A. - Institu6009Sao Paulo62070503***63044DDF,
        created=2021-01-03 18:36:18.574799,
        description=this will be fast,
        fee=0,
        id=5717797661310976,
        name=None,
        rules=[
            Rule(
                key=resendingLimit,
                value=5
            )
        ],
        scheduled=2021-01-13 10:00:00,
        status=canceled,
        tags=['pix', 'qrcode'],
        tax_id=***.345.678-**,
        transaction_ids=[],
        type=dynamic,
        updated=2021-01-03 18:36:18.574815
    ),
    type=failed
)
  

Javascript

Log {
    id: '5172860540682240',
    created: '2021-01-03T18:36:18.124698+00:00',
    type: 'failed',
    errors: [  ],
    payment: {
        id: '5717797661310976',
        brcode: '00020101021226890014br.gov.bcb.pix2567brcode-h.sandbox.starkinfra.com/v2/ace289aac1ce453b9ca64fb12ec525855204000053039865802BR5925Stark Bank S.A. - Institu6009Sao Paulo62070503***63044DDF',
        taxId: '***.345.678-**',
        name: null,
        description: 'this will be fast',
        amount: 0,
        scheduled: '2021-01-13T10:00:00+00:00',
        tags: [ 'pix', 'qrcode' ],
        rules: [ 
            { 
                key: 'resendingLimit', 
                value: 5 
            } 
        ],
        status: 'canceled',
        type: 'dynamic',
        fee: 0,
        updated: '2021-01-03T18:36:23.200972+00:00',
        created: '2021-01-03T18:36:23.200957+00:00',
        transactionIds: []
    }
}
  

PHP

StarkBank\BrcodePayment\Log Object
(
    [id] => 5172860540682240
    [created] => DateTime Object
        (
            [date] => 2021-01-03 18:36:18.167983
            [timezone_type] => 1
            [timezone] => +00:00
        )

    [type] => failed
    [errors] => Array
        (
        )

    [payment] => StarkBank\BrcodePayment Object
        (
            [id] => 5717797661310976
            [brcode] => 00020101021226890014br.gov.bcb.pix2567brcode-h.sandbox.starkinfra.com/v2/ace289aac1ce453b9ca64fb12ec525855204000053039865802BR5925Stark Bank S.A. - Institu6009Sao Paulo62070503***63044DDF
            [taxId] => ***.345.678-**
            [description] => this will be fast
            [amount] => 0
            [scheduled] => DateTime Object
                (
                    [date] => 2021-01-13 10:00:00.000000
                    [timezone_type] => 1
                    [timezone] => +00:00
                )
                                
            [name] => 
            [tags] => Array
                (
                    [0] => pix
                    [1] => qrcode
                )
                                
            [rules] => Array
                (
                    [0] => StarkBank\BrcodePayment\Rule Object
                        (
                            [key] => resendingLimit
                            [value] => 5
                        )
                                
                )
                                
            [status] => canceled
            [type] => dynamic
            [transactionIds] => Array
                (
                )
                                
            [fee] => 0
            [updated] => DateTime Object
                (
                    [date] => 2021-01-03 18:36:18.739116
                    [timezone_type] => 1
                    [timezone] => +00:00
                )
                                
            [created] => DateTime Object
                (
                    [date] => 2021-01-03 18:36:18.739116
                    [timezone_type] => 1
                    [timezone] => +00:00
                )

        )

)
  

Java

Log({
    "created": "2021-01-03T18:36:18.481078+00:00",
    "type": "failed",
    "errors": [],
    "payment": {
        "brcode": "00020101021226890014br.gov.bcb.pix2567brcode-h.sandbox.starkinfra.com/v2/ace289aac1ce453b9ca64fb12ec525855204000053039865802BR5925Stark Bank S.A. - Institu6009Sao Paulo62070503***63044DDF",
        "taxId": "***.345.678-**",
        "description": "this will be fast",
        "amount": 0,
        "scheduled": "2021-01-13T10:00:00+00:00",
        "tags": [
            "pix",
            "qrcode"
        ],
        "rules": [
            {
                "key": "resendingLimit",
                "value": 5
            }
        ],
        "status": "canceled",
        "name": "",
        "type": "dynamic",
        "transactionIds": [],
        "fee": 0,
        "updated": "2021-01-03T18:36:18.142541+00:00",
        "created": "2021-01-03T18:36:18.142526+00:00",
        "id": "5717797661310976"
    },
    "id": "5172860540682240"
})
  

Ruby

log(
    id: 5172860540682240,
    type: failed,
    errors: [],
    payment: brcodepayment(
        id: 5717797661310976,
        brcode: 00020101021226890014br.gov.bcb.pix2567brcode-h.sandbox.starkinfra.com/v2/ace289aac1ce453b9ca64fb12ec525855204000053039865802BR5925Stark Bank S.A. - Institu6009Sao Paulo62070503***63044DDF,
        tax_id: ***.345.678-**,
        description: this will be fast,
        amount: 0,
        scheduled: 2021-01-13T10:00:00+00:00,
        tags: ["pix", "qrcode"],
        rules: [
            rule(
                key: resendingLimit,
                value: 5
            )
        ],
        name: ,
        status: canceled,
        type: dynamic,
        transaction_ids: [],
        fee: 0,
        updated: 2021-01-03T18:36:18+00:00,
        created: 2021-01-03T18:36:18+00:00
    ),
    created: 2021-01-03T18:36:18+00:00
)
  

Elixir

%StarkBank.BrcodePayment.Log{
    created: ~U[2021-01-03 18:36:18.742789Z],
    errors: [],
    id: "5172860540682240",
    payment: %StarkBank.BrcodePayment{
        amount: 0,
        brcode: 00020101021226890014br.gov.bcb.pix2567brcode-h.sandbox.starkinfra.com/v2/ace289aac1ce453b9ca64fb12ec525855204000053039865802BR5925Stark Bank S.A. - Institu6009Sao Paulo62070503***63044DDF,
        created: ~U[2021-01-03 18:36:00.235426Z],
        description: "this will be fast",
        fee: 0,
        id: "5717797661310976",
        name: "",
        scheduled: ~U[2021-01-13 10:00:00.000000Z],
        rules: [
            %StarkBank.BrcodePayment.Rules{
                key: "resendingLimit",
                value: 5
            }
        ]
        status: "canceled",
        tags: ["pix", "qrcode"],
        transaction_ids: [],
        tax_id: "***.345.678-**",
        type: "dynamic",
        updated: ~U[2021-01-03 18:36:00.235440Z]
    },
    type: "failed"
}
  

C#

Log(
    Created: 03/01/2020 18:36:18,
    Type: failed,
    Errors: {  },
    Payment: BrcodePayment(
        Brcode: 00020101021226890014br.gov.bcb.pix2567brcode-h.sandbox.starkinfra.com/v2/ace289aac1ce453b9ca64fb12ec525855204000053039865802BR5925Stark Bank S.A. - Institu6009Sao Paulo62070503***63044DDF,
        Tags: { pix, qrcode },
        Scheduled: 13/01/2021 10:00:00,
        Name: null,
        TaxID: ***.345.678-**,
        Amount: 0,
        Rules: Rule(
            Key: resendingLimit,
            Value: 5
        )
        Status: canceled,
        Type: dynamic,
        Description: this will be fast,
        ID: 5717797661310976,
        Fee: 0,
        Created: 03/01/2021 18:36:00,
        Updated: 03/01/2021 18:36:00,
        TransactionIds: {  }
    ),
    ID: 5172860540682240
)
  

Go

{
    Id:5172860540682240 
    Payment:{
        Id:5717797661310976 
        Brcode:00020101021226890014br.gov.bcb.pix2567brcode-h.sandbox.starkinfra.com/v2/ace289aac1ce453b9ca64fb12ec525855204000053039865802BR5925Stark Bank S.A. - Institu6009Sao Paulo62070503***63044DDF 
        TaxId:***.345.678-**
        Description:this will be fast 
        Amount:0 
        Scheduled:2021-01-13 10:00:00.000000 +0000 +0000 
        Rules:[
            {
                Key:resendingLimit 
                Value:5
            }
        ]
        Tags:[pix qrcode] 
        Name: 
        Status:canceled 
        Type:dynamic 
        TransactionIds:[] 
        Fee:0 
        Updated:2021-01-03 18:36:00.796544 +0000 +0000 
        Created:2021-01-03 18:36:00.796529 +0000 +0000
    } 
    Errors:[] 
    Type:failed 
    Created:2021-01-03 18:36:18.883935 +0000 +0000
}
  

Clojure

{
    :id 5172860540682240,
    :created 2021-01-03T18:36:18.092065+00:00,
    :errors [This payment is not payable anymore],
    :type failed,
    :payment {
        :description this will be fast,
        :name ,
        :amount 0,
        :fee 0,
        :tags [pix, qrcode],
        :transaction-ids [],
        :updated 2021-01-03T18:36:00.892863+00:00,
        :tax-id ***.345.678-**,
        :type dynamic,
        :created 2021-01-03T18:36:00.892848+00:00,
        :status canceled,
        :id 5717797661310976,
        :scheduled 2021-01-12T10:00:00.000000+00:00,
        :brcode 00020101021226890014br.gov.bcb.pix2567brcode-h.sandbox.starkinfra.com/v2/ace289aac1ce453b9ca64fb12ec525855204000053039865802BR5925Stark Bank S.A. - Institu6009Sao Paulo62070503***63044DDF
    }
}
  

Curl

{
    "cursor": null,
    "logs": [
        {
            "payment": {
                "amount": 0,
                "brcode": "00020101021226890014br.gov.bcb.pix2567brcode-h.sandbox.starkinfra.com/v2/ace289aac1ce453b9ca64fb12ec525855204000053039865802BR5925Stark Bank S.A. - Institu6009Sao Paulo62070503***63044DDF",
                "created": "2021-01-03T18:36:00.369014+00:00",
                "description": "this will be fast",
                "fee": 0,
                "id": "5717797661310976",
                "name": null,
                "rules": [
                    {
                        "key": "resendingLimit",
                        "value": 5
                    }
                ],
                "scheduled": "2021-01-13T10:00:00.000000+00:00",
                "status": "canceled",
                "tags": ["pix", "qrcode"],
                "taxId": "***.345.678-**",
                "transactionIds": [],
                "type": "dynamic",
                "updated": "2021-01-03T18:36:00.369028+00:00"
            },
            "errors": [],
            "type": "failed",
            "id": "5172860540682240",
            "created": "2021-01-03T18:36:18.369868+00:00"
        }
    ]
}
  

Payment Status

Each payment has a status that can change over time according to its life cycle: payment-status

Payment Log

Every time we modify a boleto payment, we create a log. Logs are pretty useful for understanding the life cycle of each payment and the changes that happened to it. Here is the possible event flow: payment-log

The Boleto Payment object

Attributes

id STRING

Unique id for the boleto payment.

amount INTEGER

Payment amount in cents.

barCode STRING

Bar code number that describes the payment.

created STRING

Creation datetime. Example: "2020-04-23T23:00:00.000000+00:00".

description STRING

Text displayed in the bank statement.

fee INTEGER

Fee charged in cents.

line STRING

Number sequence that describes the payment.

scheduled STRING

Scheduled payment date. Example: "2020-04-23".

status STRING

Current payment status. Options: "created", "processing", "confirmed", "success", "failed", "canceled".

tags LIST OF STRINGS

Tags associated with the boleto payment.

taxId STRING

Receiver CPF or CNPJ.

transactionIds LIST OF STRINGS

Ledger transaction IDs linked to the payment.

Create Boleto Payments

Use this route to pay registered boletos generated at Stark Bank or at other financial institutions using the available balance in your Stark Bank account.

Parameters

description REQUIRED

Text to be displayed in your statement. Min length = 10.

taxId REQUIRED

Receiver CPF (11 digits formatted or unformatted) or CNPJ (14 digits formatted or unformatted). Example: 012.345.678-90.

amount OPTIONAL

Amount to be paid. If none is informed, the current boleto value will be used. Example: 23456 (= R$ 234.56)

barCode CONDITIONALLY REQUIRED

Bar code number that describes the payment. Either "line" or "barCode" parameters are required. If both are sent, they must match.

line CONDITIONALLY REQUIRED

Number sequence that describes the payment. Either "line" or "barCode" parameters are required. If both are sent, they must match.

scheduled OPTIONAL

Schedule the payment for a specific date. Default value is the current day.

tags OPTIONAL

Array of strings to tag the entity for future queries. All tags will be converted to lowercase.

ENDPOINT
POST /v2/boleto-payment
REQUEST

Python

import starkbank

payments = starkbank.boletopayment.create([
    starkbank.BoletoPayment(
        line="34191.09107 05447.947309 71544.640008 8 84660000011631",
        tax_id="38.435.677/0001-25",
        tags=["little girl", "no one"],
        description="Payment for killing white walkers",
        scheduled="2020-04-25"
    )
])

for payment in payments:
    print(payment)
  

Javascript

const starkbank = require('starkbank');

(async() => {
    let payments = await starkbank.boletoPayment.create([
        {
            taxId: '38.435.677/0001-25',
            description: 'Payment for killing white walkers',
            scheduled: '2020-04-25',
            line: '34191.09107 05447.947309 71544.640008 8 84660000011631',
            tags: ['little girl', 'no one'],
        }
    ])

    for (let payment of payments) {
        console.log(payment);
    }
})();
  

PHP

$payments = StarkBank\BoletoPayment::create([
    new StarkBank\BoletoPayment([
        "line" => "34191.09107 05447.947309 71544.640008 8 84660000011631",
        "taxId" => "38.435.677/0001-25",
        "scheduled" => "2020-04-25",
        "description" => "Payment for killing white walkers",
        "tags" => ["little girl", "no one"],
    ])
]);

foreach($payments as $payment){
    print_r($payment);
}
  

Java

import com.starkbank.*;

List<BoletoPayment> payments = new ArrayList<>();
HashMap<String, Object> data = new HashMap<>();
data.put("line", "34191.09107 05447.947309 71544.640008 8 84660000011631");
data.put("taxId", "38.435.677/0001-25");
data.put("scheduled", "2020-04-25");
data.put("description", "Payment for killing white walkers");
data.put("tags", new String[]{"little girl", "no one"});
payments.add(new BoletoPayment(data));

payments = BoletoPayment.create(payments);

for (BoletoPayment payment : payments){
    System.out.println(payment);
}
  

Ruby

require('starkbank')

payments = StarkBank::BoletoPayment.create(
    [
        StarkBank::BoletoPayment.new(
            line: '34191.09107 05447.947309 71544.640008 8 84660000011631',
            tax_id: '38.435.677/0001-25',
            scheduled: '2020-04-25',
            description: 'Payment for killing white walkers',
            tags: ['little girl', 'no one']
        )
    ]
)

payments.each do |payment|
    puts payment
end
  

Elixir

payments = StarkBank.BoletoPayment.create!([
    %StarkBank.BoletoPayment{
        line: "34191.09107 05447.947309 71444.640008 8 84660000011631",
        tax_id: "38.435.677/0001-25",
        scheduled: "2020-04-25",
        description: "Payment for killing white walkers",
        tags: ["little girl", "no one"]
    }
])

for payment <- payments do
    payment |> IO.inspect
end
  

C#

using System;
using System.Collections.Generic;

List<StarkBank.BoletoPayment> payments = StarkBank.BoletoPayment.Create(
    new List<StarkBank.BoletoPayment>() {
        new BoletoPayment(
            line: "34191.09107 05447.947309 71444.640008 8 84660000011631",
            scheduled: DateTime.Today.Date.AddDays(1),
            description: "Payment for killing white walkers",
            taxID: "38.435.677/0001-25",
            tags: new List<string> { "little girl", "no one" }
        )
    }
);

foreach(StarkBank.BoletoPayment payment in payments)
{
    Console.WriteLine(payment);
}
  

Go

package main

import (
    "fmt"
    "github.com/starkbank/sdk-go/starkbank/boletopayment"
)

func main() {

    payments, err := boletopayment.Create(
        []boletopayment.boletopayment{
            {
                TaxId:       "38.435.677/0001-25",
                Description: "Payment for killing white walkers",
                Line:        "34191.09107 05447.947309 71544.640008 8 84660000011631",
                Tags:        []string{"little girl", "no one"},
                Scheduled:   "2020-04-25",
            },
        }, nil)

    if err.Errors != nil {
        for _, e := range err.Errors {
            fmt.Printf("code: %s, message: %s", e.Code, e.Message)
        }
    }

    for _, payment := range payments {
        fmt.Printf("%+v", payment)
    }
}
  

Clojure

(def payments
  (starkbank.boleto-payment/create
    [
      {
        :line "34191.09107 05447.947309 71544.640008 8 84660000011631"
        :tax-id "38.435.677/0001-25"
        :scheduled "2020-04-25"
        :description "Payment for killing white walkers"
        :tags ["little girl" "no one"]
      }
    ]))
(dorun (map println payments))
  

Curl

curl --location --request POST '{{baseUrl}}/v2/boleto-payment' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}' 
--header 'Content-Type: application/json' 
--data-raw '{
    "payments": [
        {
            "line": "34191.09107 05447.947309 71544.640008 8 84660000011631",
            "taxId": "38.435.677/0001-25",
            "tags": ["little girl", "no one"],
            "description": "Payment for killing white walkers",
            "scheduled": "2020-04-25"
        },
    ]
}'
  
RESPONSE

Python

BoletoPayment(
    amount=11631,
    bar_code=34198846600000116311091005447947307154464000,
    created=2020-04-24 17:58:32.007153,
    description=Payment for killing white walkers,
    fee=0,
    id=6693962735681536,
    line=34191.09107 05447.947309 71544.640008 8 84660000011631,
    scheduled=2020-04-25 15:00:00,
    status=created,
    tags=['little girl', 'no one'],
    transaction_ids=[],
    tax_id=38.435.677/0001-25
)
  

Javascript

BoletoPayment {
    id: '6693962735681536',
    taxId: '38.435.677/0001-25',
    description: 'Payment for killing white walkers',
    line: '34191.09107 05447.947309 71544.640008 8 84660000011631',
    barCode: '34198846600000116311091005447947307154464000',
    scheduled: '2020-04-25T15:00:00+00:00',
    tags: [ 'little girl', 'no one' ],
    transactionIds: [],
    status: 'created',
    amount: 11631,
    fee: 0,
    created: '2020-04-24T01:33:40.611174+00:00'
}
  

PHP

StarkBank\BoletoPayment Object
(
    [id] => 6693962735681536
    [line] => 34191.09107 05447.947309 71544.640008 8 84660000011631
    [taxId] => 38.435.677/0001-25
    [barCode] => 34198846600000116311091005447947307154464000
    [description] => Payment for killing white walkers
    [tags] => Array
        (
            [0] => little girl
            [1] => no one
        )

    [transactionIds] => Array
        (
        )

    [scheduled] => DateTime Object
        (
            [date] => 2020-04-25T15:00:00+00:00
            [timezone_type] => 1
            [timezone] => +00:00
        )

    [status] => created
    [amount] => 11631
    [fee] => 0
    [created] => DateTime Object
        (
            [date] => 2020-04-24 18:35:37.166061
            [timezone_type] => 1
            [timezone] => +00:00
        )

)
  

Java

BoletoPayment({
    "id": "6693962735681536",
    "taxId": "38.435.677/0001-25",
    "description": "Payment for killing white walkers",
    "line": "34191.09107 05447.947309 71544.640008 8 84660000011631",
    "barCode": "34198846600000116311091005447947307154464000",
    "scheduled": "2020-04-25T15:00:00+00:00",
    "tags": ["little girl", "no one"],
    "transactionIds": [],
    "status": "created",
    "amount": 11631,
    "fee": 0,
    "created": "2020-04-24T00:57:48+00:00"
})
  

Ruby

boletopayment(
    id: 6693962735681536,
    tax_id: 38.435.677/0001-25,
    description: Payment for killing white walkers,
    line: 34191.09107 05447.947309 71544.640008 8 84660000011631,
    bar_code: 34198846600000116311091005447947307154464000,
    scheduled: 2020-04-25T15:00:00+00:00,
    tags: ["little girl", "no one"],
    transaction_ids: [],
    status: created,
    amount: 11631,
    fee: 0,
    created: 2020-04-24T00:57:48+00:00
)
  

Elixir

%StarkBank.BoletoPayment{
    amount: 11631,
    bar_code: "34198846600000116311091005447947307154464000",
    created: ~U[2020-04-24 17:29:22.713657Z],
    description: "Payment for killing white walkers",
    fee: 0,
    id: "6693962735681536",
    line: "34191.09107 05447.947309 71544.640008 8 84660000011631",
    scheduled: ~U[2020-04-25 15:00:00Z],
    status: "created",
    tags: ["little girl", "no one"],
    transaction_ids: [],
    tax_id: "38.435.677/0001-25"
}
  

C#

BoletoPayment(
    Amount: 11631,
    Description: Payment for killing white walkers,
    TaxID: 38.435.677/0001-25,
    Line: 34191.09107 05447.947309 71544.640008 8 84660000011631,
    BarCode: 34198846600000116311091005447947307154464000,
    Scheduled: 04/25/2020 15:00:00,
    Tags: { little girl, no one },
    TransactionIds: {  },
    Status: created,
    Fee: 0,
    Created: 04/24/2020 13:39:28,
    ID: 6693962735681536
)
  

Go

{
    Id:6693962735681536
    Line:34191.09107 05447.947309 71544.640008 8 84660000011631
    BarCode:34198846600000116311091005447947307154464000
    TaxId:38.435.677/0001-25
    Description:Payment for killing white walkers
    Amount:11631
    Scheduled:2020-04-25 15:00:00.00000 +0000 +0000
    Tags:[little girl no one]
    TransactionIds:[]
    Status:created
    Fee:0,
    Created:2020-04-24 15:32:37.718634 +0000 +0000
}
  

Clojure

{:description "Payment for killing white walkers",
 :fee 0,
 :tags ["little girl" "no one"],
 :tax-id "38.435.677/0001-25",
 :created "2020-04-24T19:27:53.013692+00:00",
 :line "34191.09107 05447.947309 71544.640008 8 84660000011631",
 :status "created",
 :id "6693962735681536",
 :scheduled "2020-04-25T15:00:00.000000+00:00",
 :bar-code "34198846600000116311091005447947307154464000"}
  

Curl

{
    "message": "Boleto Payment(s) successfully created",
    "payments": [
        {
            "id": "6693962735681536",
            "status": "created",
            "amount": 11631,
            "fee": 0,
            "description": "Payment for killing white walkers",
            "tags": ["little girl", "no one"],
            "transactionIds": [],
            "created": "2020-04-24T01:37:21.146576+00:00",
            "scheduled": "2020-04-25T15:00:00+00:00",
            "taxId": "38.435.677/0001-25",
            "barCode": "34198846600000116311091005447947307154464000",
            "line": "34191.09107 05447.947309 71544.640008 8 84660000011631",
        }
    ]
}
  

List Boleto Payments

Get a list of non-deleted boleto payments in chunks of at most 100. If you need smaller chunks, use the limit parameter.

Parameters

after OPTIONAL

Filter entities created after this date.

before OPTIONAL

Filter entities created before this date.

cursor OPTIONAL

String used to get the next batch of results. Our SDKs handle this for you.

fields OPTIONAL

List of strings to filter response JSON keys. Not available in the SDKs.

ids OPTIONAL

List of strings to get specific entities by ids.

limit OPTIONAL

Number of results per cursor. Max = 100.

status OPTIONAL

Filter boleto payments by the specified status.

tags OPTIONAL

Filter entities that contain the specified tags.

ENDPOINT
GET /v2/boleto-payment
REQUEST

Python

import starkbank

payments = starkbank.boletopayment.query(
    after="2020-04-01",
    before="2020-04-30"
)

for payment in payments:
    print(payment)
  

Javascript

const starkbank = require('starkbank');

(async() => {
    let payments = await starkbank.boletoPayment.query({
        after: '2020-04-01',
        before: '2020-04-30',
    });

    for await (let payment of payments) {
        console.log(payment);
    }
})();
  

PHP

$payments = StarkBank\BoletoPayment::query([
    "after" => "2020-04-01",
    "before" => "2020-04-30"
]);

foreach($payments as $payment){
    print_r($payment);
}
  

Java

import com.starkbank.*;
import com.starkbank.utils.Generator;
import java.util.HashMap;

HashMap<String, Object> params = new HashMap<>();
params.put("after", "2020-04-01");
params.put("before", "2020-04-30");
Generator<BoletoPayment> payments = BoletoPayment.query(params);

for (BoletoPayment payment : payments){
    System.out.println(payment);
}
  

Ruby

require('starkbank')

payments = StarkBank::BoletoPayment.query(
    after: '2020-04-01',
    before: '2020-04-30'
)

payments.each do |payment|
    puts payment
end
  

Elixir

payments = StarkBank.BoletoPayment.query!(
  after: "2020-04-01",
  before: "2020-04-30"
)

for payment <- payments do
  payment |> IO.inspect
end
  

C#

using System;
using System.Collections.Generic;

IEnumerable<StarkBank.BoletoPayment> payments = StarkBank.BoletoPayment.Query(
    after: new DateTime(2020, 4, 1),
    before: new DateTime(2020, 4, 30)
);

foreach (StarkBank.BoletoPayment payment in payments) {
    Console.WriteLine(payment);
}
  

Go

package main

import (
    "fmt"
    "time"
    "github.com/starkbank/sdk-go/starkbank/boletopayment"
)

func main() {

    var params = map[string]interface{}{}
    params["after"] = time.Date(2020, 4, 1, 0, 0, 0, 0, time.UTC)
    params["before"] = time.Date(2020, 4, 30, 0, 0, 0, 0, time.UTC)

    payments, errorChannel := boletopayment.Query(params, nil)

    loop:
    for {
        select {
        case err := <-errorChannel:
            if err.Errors != nil {
                for _, e := range err.Errors {
                    fmt.Printf("code: %s, message: %s", e.Code, e.Message)
                }
            }
        case payment, ok := <-payments:
            if !ok {
                break loop
            }
            fmt.Printf("%+v", payment)
        }
    }
}
  

Clojure

(def payments
  (starkbank.boleto-payment/query
    {
      :after "2020-04-01"
      :before "2020-04-30"
    }))
(dorun (map println payments))
  

Curl

curl --location --request GET '{{baseUrl}}/v2/boleto-payment?after=2020-01-01&before=2020-01-30' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}'
  
RESPONSE

Python

BoletoPayment(
    amount=11631,
    bar_code=34198846600000116311091005447947307154464000,
    created=2020-04-24 17:58:32.007153,
    description=Payment for killing white walkers,
    fee=0,
    id=6693962735681536,
    line=34191.09107 05447.947309 71544.640008 8 84660000011631,
    scheduled=2020-04-25 15:00:00,
    status=created,
    tags=['little girl', 'no one'],
    transaction_ids=[],
    tax_id=38.435.677/0001-25
)
  

Javascript

BoletoPayment {
    id: '6693962735681536',
    taxId: '38.435.677/0001-25',
    description: 'Payment for killing white walkers',
    line: '34191.09107 05447.947309 71544.640008 8 84660000011631',
    barCode: '34198846600000116311091005447947307154464000',
    scheduled: '2020-04-25T15:00:00+00:00',
    tags: [ 'little girl', 'no one' ],
    transactionIds: [],
    status: 'created',
    amount: 11631,
    fee: 0,
    created: '2020-04-24T01:33:40.611174+00:00'
}
  

PHP

StarkBank\BoletoPayment Object
(
    [id] => 6693962735681536
    [line] => 34191.09107 05447.947309 71544.640008 8 84660000011631
    [taxId] => 38.435.677/0001-25
    [barCode] => 34198846600000116311091005447947307154464000
    [description] => Payment for killing white walkers
    [tags] => Array
        (
            [0] => little girl
            [1] => no one
        )

    [transactionIds] => Array
        (
        )

    [scheduled] => DateTime Object
        (
            [date] => 2020-04-25T15:00:00+00:00
            [timezone_type] => 1
            [timezone] => +00:00
        )

    [status] => created
    [amount] => 11631
    [fee] => 0
    [created] => DateTime Object
        (
            [date] => 2020-04-24 18:35:37.166061
            [timezone_type] => 1
            [timezone] => +00:00
        )

)
  

Java

BoletoPayment({
    "id": "6693962735681536",
    "taxId": "38.435.677/0001-25",
    "description": "Payment for killing white walkers",
    "line": "34191.09107 05447.947309 71544.640008 8 84660000011631",
    "barCode": "34198846600000116311091005447947307154464000",
    "scheduled": "2020-04-25T15:00:00+00:00",
    "tags": ["little girl", "no one"],
    "transactionIds": [],
    "status": "created",
    "amount": 11631,
    "fee": 0,
    "created": "2020-04-24T00:57:48+00:00"
})
  

Ruby

boletopayment(
    id: 6693962735681536,
    tax_id: 38.435.677/0001-25,
    description: Payment for killing white walkers,
    line: 34191.09107 05447.947309 71544.640008 8 84660000011631,
    bar_code: 34198846600000116311091005447947307154464000,
    scheduled: 2020-04-25T15:00:00+00:00,
    tags: ["little girl", "no one"],
    transaction_ids: [],
    status: created,
    amount: 11631,
    fee: 0,
    created: 2020-04-24T00:57:48+00:00
)
  

Elixir

%StarkBank.BoletoPayment{
    amount: 11631,
    bar_code: "34198846600000116311091005447947307154464000",
    created: ~U[2020-04-24 17:29:22.713657Z],
    description: "Payment for killing white walkers",
    fee: 0,
    id: "6693962735681536",
    line: "34191.09107 05447.947309 71544.640008 8 84660000011631",
    scheduled: ~U[2020-04-25 15:00:00Z],
    status: "created",
    tags: ["little girl", "no one"],
    transaction_ids: [],
    tax_id: "38.435.677/0001-25"
}
  

C#

BoletoPayment(
    Amount: 11631,
    Description: Payment for killing white walkers,
    TaxID: 38.435.677/0001-25,
    Line: 34191.09107 05447.947309 71544.640008 8 84660000011631,
    BarCode: 34198846600000116311091005447947307154464000,
    Scheduled: 04/25/2020 15:00:00,
    Tags: { little girl, no one },
    TransactionIds: {  },
    Status: created,
    Fee: 0,
    Created: 04/24/2020 13:39:28,
    ID: 6693962735681536
)
  

Go

{
    Id:6693962735681536
    Line:34191.09107 05447.947309 71544.640008 8 84660000011631
    BarCode:34198846600000116311091005447947307154464000
    TaxId:38.435.677/0001-25
    Description:Payment for killing white walkers
    Amount:11631
    Scheduled:2020-04-25 15:00:00.00000 +0000 +0000
    Tags:[little girl no one]
    TransactionIds:[]
    Status:created
    Fee:0,
    Created:2020-04-24 15:32:37.718634 +0000 +0000
}
  

Clojure

{:description "Payment for killing white walkers",
 :fee 0,
 :tags ["little girl" "no one"],
 :tax-id "38.435.677/0001-25",
 :created "2020-04-24T19:27:53.013692+00:00",
 :line "34191.09107 05447.947309 71544.640008 8 84660000011631",
 :status "created",
 :id "6693962735681536",
 :scheduled "2020-04-25T15:00:00.000000+00:00",
 :bar-code "34198846600000116311091005447947307154464000"}
  

Curl

{
    "cursor": null,
    "payments": [
        {
            "id": "6693962735681536",
            "status": "created",
            "amount": 11631,
            "fee": 0,
            "description": "Payment for killing white walkers",
            "tags": ["little girl", "no one"],
            "transactionIds": [],
            "created": "2020-04-24T01:37:21.146576+00:00",
            "scheduled": "2020-04-25T15:00:00+00:00",
            "taxId": "38.435.677/0001-25",
            "barCode": "34198846600000116311091005447947307154464000",
            "line": "34191.09107 05447.947309 71544.640008 8 84660000011631",
        }
    ]
}
  

Get a Boleto Payment

Get a single boleto payment by its id.

Parameters

id REQUIRED

Id of the boleto payment entity.

fields OPTIONAL

List of strings to filter response JSON keys. Not available in the SDKs.

ENDPOINT
GET /v2/boleto-payment/:id
REQUEST

Python

import starkbank

payment = starkbank.boletopayment.get("6693962735681536")

print(payment)
  

Javascript

const starkbank = require('starkbank');

(async() => {
    let payment = await starkbank.boletoPayment.get('6693962735681536');
    console.log(payment);
})();
  

PHP

$payment = StarkBank\BoletoPayment::get("6693962735681536");

print_r($payment);
  

Java

import com.starkbank.*;

BoletoPayment payment = BoletoPayment.get("6693962735681536");

System.out.println(payment);
  

Ruby

require('starkbank')

payment = StarkBank::BoletoPayment.get('6693962735681536')

puts payment
  

Elixir

payment = StarkBank.BoletoPayment.get!("6693962735681536")

payment |> IO.inspect
  

C#

using System;

StarkBank.BoletoPayment payment = StarkBank.BoletoPayment.Get("6693962735681536");

Console.WriteLine(payment);
  

Go

package main

import (
    "fmt"
    "github.com/starkbank/sdk-go/starkbank/boletopayment"
)

func main() {

    payment, err := boletopayment.Get("6693962735681536", nil)
    if err.Errors != nil {
        for _, e := range err.Errors {
            fmt.Printf("code: %s, message: %s", e.Code, e.Message)
        }
    }

    fmt.Printf("%+v", payment)
}
  

Clojure

(def payment (starkbank.boleto-payment/get "6693962735681536"))
(println payment)
  

Curl

curl --location --request GET '{{baseUrl}}/v2/boleto-payment/6693962735681536' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}'
  
RESPONSE

Python

BoletoPayment(
    amount=11631,
    bar_code=34198846600000116311091005447947307154464000,
    created=2020-04-24 17:58:32.007153,
    description=Payment for killing white walkers,
    fee=0,
    id=6693962735681536,
    line=34191.09107 05447.947309 71544.640008 8 84660000011631,
    scheduled=2020-04-25 15:00:00,
    status=created,
    tags=['little girl', 'no one'],
    transaction_ids=[],
    tax_id=38.435.677/0001-25
)
  

Javascript

BoletoPayment {
    id: '6693962735681536',
    taxId: '38.435.677/0001-25',
    description: 'Payment for killing white walkers',
    line: '34191.09107 05447.947309 71544.640008 8 84660000011631',
    barCode: '34198846600000116311091005447947307154464000',
    scheduled: '2020-04-25T15:00:00+00:00',
    tags: [ 'little girl', 'no one' ],
    transactionIds: [],
    status: 'created',
    amount: 11631,
    fee: 0,
    created: '2020-04-24T01:33:40.611174+00:00'
}
  

PHP

StarkBank\BoletoPayment Object
(
    [id] => 6693962735681536
    [line] => 34191.09107 05447.947309 71544.640008 8 84660000011631
    [taxId] => 38.435.677/0001-25
    [barCode] => 34198846600000116311091005447947307154464000
    [description] => Payment for killing white walkers
    [tags] => Array
        (
            [0] => little girl
            [1] => no one
        )

    [transactionIds] => Array
        (
        )

    [scheduled] => DateTime Object
        (
            [date] => 2020-04-25T15:00:00+00:00
            [timezone_type] => 1
            [timezone] => +00:00
        )

    [status] => created
    [amount] => 11631
    [fee] => 0
    [created] => DateTime Object
        (
            [date] => 2020-04-24 18:35:37.166061
            [timezone_type] => 1
            [timezone] => +00:00
        )

)
  

Java

BoletoPayment({
    "id": "6693962735681536",
    "taxId": "38.435.677/0001-25",
    "description": "Payment for killing white walkers",
    "line": "34191.09107 05447.947309 71544.640008 8 84660000011631",
    "barCode": "34198846600000116311091005447947307154464000",
    "scheduled": "2020-04-25T15:00:00+00:00",
    "tags": ["little girl", "no one"],
    "transactionIds": [],
    "status": "created",
    "amount": 11631,
    "fee": 0,
    "created": "2020-04-24T00:57:48+00:00"
})
  

Ruby

boletopayment(
    id: 6693962735681536,
    tax_id: 38.435.677/0001-25,
    description: Payment for killing white walkers,
    line: 34191.09107 05447.947309 71544.640008 8 84660000011631,
    bar_code: 34198846600000116311091005447947307154464000,
    scheduled: 2020-04-25T15:00:00+00:00,
    tags: ["little girl", "no one"],
    transaction_ids: [],
    status: created,
    amount: 11631,
    fee: 0,
    created: 2020-04-24T00:57:48+00:00
)
  

Elixir

%StarkBank.BoletoPayment{
    amount: 11631,
    bar_code: "34198846600000116311091005447947307154464000",
    created: ~U[2020-04-24 17:29:22.713657Z],
    description: "Payment for killing white walkers",
    fee: 0,
    id: "6693962735681536",
    line: "34191.09107 05447.947309 71544.640008 8 84660000011631",
    scheduled: ~U[2020-04-25 15:00:00Z],
    status: "created",
    tags: ["little girl", "no one"],
    transaction_ids: [],
    tax_id: "38.435.677/0001-25"
}
  

C#

BoletoPayment(
    Amount: 11631,
    Description: Payment for killing white walkers,
    TaxID: 38.435.677/0001-25,
    Line: 34191.09107 05447.947309 71544.640008 8 84660000011631,
    BarCode: 34198846600000116311091005447947307154464000,
    Scheduled: 04/25/2020 15:00:00,
    Tags: { little girl, no one },
    TransactionIds: {  },
    Status: created,
    Fee: 0,
    Created: 04/24/2020 13:39:28,
    ID: 6693962735681536
)
  

Go

{
    Id:6693962735681536
    Line:34191.09107 05447.947309 71544.640008 8 84660000011631
    BarCode:34198846600000116311091005447947307154464000
    TaxId:38.435.677/0001-25
    Description:Payment for killing white walkers
    Amount:11631
    Scheduled:2020-04-25 15:00:00.00000 +0000 +0000
    Tags:[little girl no one]
    TransactionIds:[]
    Status:created
    Fee:0,
    Created:2020-04-24 15:32:37.718634 +0000 +0000
}
  

Clojure

{:description "Payment for killing white walkers",
 :fee 0,
 :tags ["little girl" "no one"],
 :tax-id "38.435.677/0001-25",
 :created "2020-04-24T19:27:53.013692+00:00",
 :line "34191.09107 05447.947309 71544.640008 8 84660000011631",
 :status "created",
 :id "6693962735681536",
 :scheduled "2020-04-25T15:00:00.000000+00:00",
 :bar-code "34198846600000116311091005447947307154464000"}
  

Curl

{
    "payment": {
        "id": "6693962735681536",
        "status": "created",
        "amount": 11631,
        "fee": 0,
        "description": "Payment for killing white walkers",
        "tags": ["little girl", "no one"],
        "transactionIds": [],
        "created": "2020-04-24T01:37:21.146576+00:00",
        "scheduled": "2020-04-25T15:00:00+00:00",
        "taxId": "38.435.677/0001-25",
        "barCode": "34198846600000116311091005447947307154464000",
        "line": "34191.09107 05447.947309 71544.640008 8 84660000011631",
    }
}
  

Delete a Boleto Payment

Cancel a scheduled boleto payment. You can only cancel boleto payments before they start being processed.

NOTE: Payments that have already been processed can be deleted, but not cancelled.

Parameters

id REQUIRED

Id of the boleto payment entity.

ENDPOINT
DELETE /v2/boleto-payment/:id
REQUEST

Python

import starkbank

payment = starkbank.boletopayment.delete("6693962735681536")

print(payment)
  

Javascript

const starkbank = require('starkbank');

(async() => {
    let payment = await starkbank.boletoPayment.delete('6693962735681536');
    console.log(payment);
})();
  

PHP

$payment = StarkBank\BoletoPayment::delete("6693962735681536");

print_r($payment);
  

Java

import com.starkbank.*;

BoletoPayment payment = BoletoPayment.delete("6693962735681536");

System.out.println(payment);
  

Ruby

require('starkbank')

payment = StarkBank::BoletoPayment.delete('6693962735681536')

puts payment
  

Elixir

payment = StarkBank.BoletoPayment.delete!("6693962735681536")

payment |> IO.inspect
  

C#

using System;

StarkBank.BoletoPayment payment = StarkBank.BoletoPayment.Delete("6693962735681536");

Console.WriteLine(payment);
  

Go

package main

import (
    "fmt"
    "github.com/starkbank/sdk-go/starkbank/boletopayment"
)

func main() {

    payment, err := boletopayment.Delete("6693962735681536", nil)
    if err.Errors != nil {
        for _, e := range err.Errors {
            fmt.Printf("code: %s, message: %s", e.Code, e.Message)
        }
    }

    fmt.Printf("%+v", payment)
}
  

Clojure

(def payment (starkbank.boleto-payment/delete "6693962735681536"))
(println payment)
  

Curl

curl --location --request DELETE '{{baseUrl}}/v2/boleto-payment/6693962735681536' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}'
  
RESPONSE

Python

BoletoPayment(
    amount=11631,
    bar_code=34198846600000116311091005447947307154464000,
    created=2020-04-24 17:58:32.007153,
    description=Payment for killing white walkers,
    fee=0,
    id=6693962735681536,
    line=34191.09107 05447.947309 71544.640008 8 84660000011631,
    scheduled=2020-04-25 15:00:00,
    status=canceled,
    tags=['little girl', 'no one'],
    transaction_ids=[],
    tax_id=38.435.677/0001-25
)
  

Javascript

BoletoPayment {
    id: '6693962735681536',
    taxId: '38.435.677/0001-25',
    description: 'Payment for killing white walkers',
    line: '34191.09107 05447.947309 71544.640008 8 84660000011631',
    barCode: '34198846600000116311091005447947307154464000',
    scheduled: '2020-04-25T15:00:00+00:00',
    tags: [ 'little girl', 'no one' ],
    transactionIds: [],
    status: 'canceled',
    amount: 11631,
    fee: 0,
    created: '2020-04-24T01:33:40.611174+00:00'
}
  

PHP

StarkBank\BoletoPayment Object
(
    [id] => 6693962735681536
    [line] => 34191.09107 05447.947309 71544.640008 8 84660000011631
    [taxId] => 38.435.677/0001-25
    [barCode] => 34198846600000116311091005447947307154464000
    [description] => Payment for killing white walkers
    [tags] => Array
        (
            [0] => little girl
            [1] => no one
        )

    [transactionIds] => Array
        (
        )

    [scheduled] => DateTime Object
        (
            [date] => 2020-04-25T15:00:00+00:00
            [timezone_type] => 1
            [timezone] => +00:00
        )

    [status] => canceled
    [amount] => 11631
    [fee] => 0
    [created] => DateTime Object
        (
            [date] => 2020-04-24 18:35:37.166061
            [timezone_type] => 1
            [timezone] => +00:00
        )

)
  

Java

BoletoPayment({
    "id": "6693962735681536",
    "taxId": "38.435.677/0001-25",
    "description": "Payment for killing white walkers",
    "line": "34191.09107 05447.947309 71544.640008 8 84660000011631",
    "barCode": "34198846600000116311091005447947307154464000",
    "scheduled": "2020-04-25T15:00:00+00:00",
    "tags": ["little girl", "no one"],
    "transactionIds": [],
    "status": "canceled",
    "amount": 11631,
    "fee": 0,
    "created": "2020-04-24T00:57:48+00:00"
})
  

Ruby

boletopayment(
    id: 6693962735681536,
    tax_id: 38.435.677/0001-25,
    description: Payment for killing white walkers,
    line: 34191.09107 05447.947309 71544.640008 8 84660000011631,
    bar_code: 34198846600000116311091005447947307154464000,
    scheduled: 2020-04-25T15:00:00+00:00,
    tags: ["little girl", "no one"],
    transaction_ids: [],
    status: canceled,
    amount: 11631,
    fee: 0,
    created: 2020-04-24T00:57:48+00:00
)
  

Elixir

%StarkBank.BoletoPayment{
    amount: 11631,
    bar_code: "34198846600000116311091005447947307154464000",
    created: ~U[2020-04-24 17:29:22.713657Z],
    description: "Payment for killing white walkers",
    fee: 0,
    id: "6693962735681536",
    line: "34191.09107 05447.947309 71544.640008 8 84660000011631",
    scheduled: ~U[2020-04-25 15:00:00Z],
    status: "canceled",
    tags: ["little girl", "no one"],
    transaction_ids: [],
    tax_id: "38.435.677/0001-25"
}
  

C#

BoletoPayment(
    Amount: 11631,
    Description: Payment for killing white walkers,
    TaxID: 38.435.677/0001-25,
    Line: 34191.09107 05447.947309 71544.640008 8 84660000011631,
    BarCode: 34198846600000116311091005447947307154464000,
    Scheduled: 04/25/2020 15:00:00,
    Tags: { little girl, no one },
    TransactionIds: {  },
    Status: canceled,
    Fee: 0,
    Created: 04/24/2020 13:39:28,
    ID: 6693962735681536
)
  

Go

{
    Id:6693962735681536
    Line:34191.09107 05447.947309 71544.640008 8 84660000011631
    BarCode:34198846600000116311091005447947307154464000
    TaxId:38.435.677/0001-25
    Description:Payment for killing white walkers
    Amount:11631
    Scheduled:2020-04-25 15:00:00.00000 +0000 +0000
    Tags:[little girl no one]
    TransactionIds:[]
    Status:canceled
    Fee:0,
    Created:2020-04-24 15:32:37.718634 +0000 +0000
}
  

Clojure

{:description "Payment for killing white walkers",
 :fee 0,
 :tags ["little girl" "no one"],
 :tax-id "38.435.677/0001-25",
 :created "2020-04-24T19:27:53.013692+00:00",
 :line "34191.09107 05447.947309 71544.640008 8 84660000011631",
 :status "canceled",
 :id "6693962735681536",
 :scheduled "2020-04-25T15:00:00.000000+00:00",
 :bar-code "34198846600000116311091005447947307154464000"}
  

Curl

{
    "message": "Boleto Payment successfully deleted",
    "payment": {
        "id": "6693962735681536",
        "status": "canceled",
        "amount": 11631,
        "fee": 0,
        "description": "Payment for killing white walkers",
        "tags": ["little girl", "no one"],
        "transactionIds": [],
        "created": "2020-04-24T01:37:21.146576+00:00",
        "scheduled": "2020-04-25T15:00:00+00:00",
        "taxId": "38.435.677/0001-25",
        "barCode": "34198846600000116311091005447947307154464000",
        "line": "34191.09107 05447.947309 71544.640008 8 84660000011631",
    }
}
  

Get a Boleto Payment PDF

Get a boleto payment PDF receipt. You can only get a receipt for payments whose status are either success, processing or created.

Parameters

id REQUIRED

Id of the boleto payment entity

ENDPOINT
GET /v2/boleto-payment/:id/pdf
REQUEST

Python

import starkbank

pdf = starkbank.boletopayment.pdf("6693962735681536")

with open("boleto-payment.pdf", "wb") as file:
    file.write(pdf)
  

Javascript

const starkbank = require('starkbank');
const fs = require('fs').promises;

(async() => {
    let pdf = await starkbank.boletoPayment.pdf('6693962735681536');
    await fs.writeFile('boleto-payment.pdf', pdf);
})();
  

PHP

$pdf = StarkBank\BoletoPayment::pdf("6693962735681536");

$fp = fopen('boleto-payment.pdf', 'w');
fwrite($fp, $pdf);
fclose($fp);
  

Java

import java.io.File;
import java.io.InputStream;
import java.nio.file.StandardCopyOption;
import com.starkbank.*;

InputStream pdf = BoletoPayment.pdf("6693962735681536");

java.nio.file.Files.copy(
    pdf,
    new File("boleto-payment.pdf").toPath(),
    StandardCopyOption.REPLACE_EXISTING
);
  

Ruby

require('starkbank')

pdf = StarkBank::BoletoPayment.pdf('6693962735681536')

File.open('boleto-payment.pdf', 'w') { |file| file.write(pdf) }
  

Elixir

pdf = StarkBank.BoletoPayment.pdf!("6693962735681536")

file = File.open!("boleto-payment.pdf", [:write])
IO.binwrite(file, pdf)
File.close(file)
  

C#

byte[] pdf = StarkBank.BoletoPayment.Pdf("6693962735681536");

System.IO.File.WriteAllBytes("boleto-payment.pdf", pdf);
  

Go

package main

import (
    "fmt"
    "github.com/starkbank/sdk-go/starkbank/boletopayment"
)

func main() {

    pdf, err := boletopayment.Pdf("6693962735681536", nil)
    if err.Errors != nil {
        for _, e := range err.Errors {
            fmt.Printf("code: %s, message: %s", e.Code, e.Message)
        }
    }

    errFile := ioutil.WriteFile("boletopayment.pdf", pdf, 0666)
    if errFile != nil {
        fmt.Print(errFile)
    }
}
  

Clojure

(clojure.java.io/copy
  (starkbank.boleto-payment/pdf "6693962735681536")
  (clojure.java.io/file "boleto-payment.pdf"))
  

Curl

curl --location --request GET '{{baseUrl}}/v2/boleto-payment/6693962735681536/pdf' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}'
  

List Boleto Payment Logs

Get a paged list of all boleto payment logs. A log tracks a change in the payment entity according to its life cycle.

Parameters

after OPTIONAL

Filter entities created after this date.

before OPTIONAL

Filter entities created before this date.

cursor OPTIONAL

String used to get the next batch of results. Our SDKs handle this for you.

fields OPTIONAL

List of strings to filter response JSON keys. Not available in the SDKs.

limit OPTIONAL

Number of results per cursor. Max = 100.

paymentIds OPTIONAL

Array of payment ids linked to the desired logs.

types OPTIONAL

Filters logs by log types.

ENDPOINT
GET /v2/boleto-payment/log
REQUEST

Python

import starkbank

logs = starkbank.boletopayment.log.query(
    payment_ids=["6693962735681536"]
)

for log in logs:
    print(log)
  

Javascript

const starkbank = require('starkbank');

(async() => {
    let logs = await starkbank.boletoPayment.log.query({
        paymentIds: ['6693962735681536'],
    });

    for await (let log of logs) {
        console.log(log);
    }
})();
  

PHP

$logs = StarkBank\BoletoPayment\Log::query([
    "paymentIds" => ["6693962735681536"]
]);

foreach($logs as $log){
    print_r($log);
}
  

Java

import com.starkbank.*;
import com.starkbank.utils.Generator;
import java.util.HashMap;

HashMap<String, Object> params = new HashMap<>();
params.put("paymentIds", "6693962735681536");
Generator<BoletoPayment.Log> logs = BoletoPayment.Log.query(params);

for (BoletoPayment.Log log : logs){
    System.out.println(log);
}
  

Ruby

require('starkbank')

logs = StarkBank::BoletoPayment::Log.query(
    payment_ids: ['6693962735681536']
)

logs.each do |log|
    puts log
end
  

Elixir

logs = StarkBank.BoletoPayment.Log.query!(
    payment_ids: ["6693962735681536"]
)

for log <- logs do
    log |> IO.inspect
end
  

C#

using System;
using System.Collections.Generic;

IEnumerable<StarkBank.BoletoPayment.Log> logs = StarkBank.BoletoPayment.Log.Query(
    paymentIds: new List<string> { "6260312504270848" }
);

foreach(StarkBank.BoletoPayment.Log log in logs)
{
    Console.WriteLine(log);
}
  

Go

package main

import (
    "fmt"
    "github.com/starkbank/sdk-go/starkbank/boletopayment/log"
)

func main() {

    var params = map[string]interface{}{}
    params["paymentIds"] = []string{"6693962735681536"}

    logs, errorChannel := log.Query(params, nil)

    loop:
    for {
        select {
        case err := <-errorChannel:
            if err.Errors != nil {
                for _, e := range err.Errors {
                    fmt.Printf("code: %s, message: %s", e.Code, e.Message)
                }
            }
        case log, ok := <-logs:
            if !ok {
                break loop
            }
            fmt.Printf("%+v", log)
        }
    }
}
  

Clojure

(def logs
  (starkbank.boleto-payment.log/query
    {
    :payment-ids ["6693962735681536"]
    }))
(dorun (map println logs))
  

Curl

curl --location --request GET '{{baseUrl}}/v2/boleto-payment/log?paymentIds=6693962735681536' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}'
  
RESPONSE

Python

Log(
    id=5260913007394816,
    created=2020-04-24 17:58:32.075347,
    errors=[],
    type=created,
    payment=BoletoPayment(
        amount=11631,
        bar_code=34198846600000116311091005447947307154464000,
        created=2020-04-24 17:58:32.007153,
        description=Payment for killing white walkers,
        fee=0,
        id=6693962735681536,
        line=34191.09107 05447.947309 71544.640008 8 84660000011631,
        scheduled=2020-04-25 15:00:00,
        status=created,
        tags=['little girl', 'no one'],
        transaction_ids=[],
        tax_id=38.435.677/0001-25
    )
)
  

Javascript

Log {
    id: '5260913007394816',
    created: '2020-04-24T01:37:06.423525+00:00',
    type: 'created',
    errors: [],
    payment: {
        id: '6693962735681536',
        taxId: '38.435.677/0001-25',
        description: 'Payment for killing white walkers',
        line: '34191.09107 05447.947309 71544.640008 8 84660000011631',
        barCode: '34198846600000116311091005447947307154464000',
        scheduled: '2020-04-25T15:00:00+00:00',
        tags: [ 'little girl', 'no one' ],
        transactionIds: [],
        status: 'created',
        amount: 11631,
        fee: 0,
        created: '2020-04-24T01:33:40.611174+00:00'
    }
}
  

PHP

StarkBank\BoletoPayment\Log Object
(
    [id] => 5260913007394816
    [created] => DateTime Object
        (
            [date] => 2020-04-24 18:35:37.252968
            [timezone_type] => 1
            [timezone] => +00:00
        )

    [type] => created
    [errors] => Array
        (
        )

    [payment] => StarkBank\BoletoPayment Object
        (
            [id] => 6693962735681536
            [line] => 34191.09107 05447.947309 71544.640008 8 84660000011631
            [taxId] => 38.435.677/0001-25
            [barCode] => 34198846600000116311091005447947307154464000
            [description] => Payment for killing white walkers
            [tags] => Array
                (
                    [0] => little girl
                    [1] => no one
                )

            [transactionIds] => Array
                (
                )

            [scheduled] => DateTime Object
                (
                    [date] => 2020-04-25T15:00:00+00:00
                    [timezone_type] => 1
                    [timezone] => +00:00
                )

            [status] => created
            [amount] => 11631
            [fee] => 0
            [created] => DateTime Object
                (
                    [date] => 2020-04-24 18:35:37.166061
                    [timezone_type] => 1
                    [timezone] => +00:00
                )
        )
)
  

Java

Log({
    "id": "5260913007394816",
    "created": "2020-04-24T00:57:48+00:00",
    "type": "created",
    "errors": [],
    "payment": {
        "id": "6693962735681536",
        "taxId": "38.435.677/0001-25",
        "description": "Payment for killing white walkers",
        "line": "34191.09107 05447.947309 71544.640008 8 84660000011631",
        "barCode": "34198846600000116311091005447947307154464000",
        "scheduled": "2020-04-25T15:00:00+00:00",
        "tags": ["little girl", "no one"],
        "transactionIds": [],
        "status": "created",
        "amount": 11631,
        "fee": 0,
        "created": "2020-04-24T00:57:48+00:00"
    }
})
  

Ruby

log(
    id: 5260913007394816,
    created: 2020-04-24T00:57:48+00:00,
    type: created,
    errors: [],
    payment: boletopayment(
        id: 6693962735681536,
        tax_id: 38.435.677/0001-25,
        description: Payment for killing white walkers,
        line: 34191.09107 05447.947309 71544.640008 8 84660000011631,
        bar_code: 34198846600000116311091005447947307154464000,
        scheduled: 2020-04-25T15:00:00+00:00,
        tags: ["little girl", "no one"],
        transaction_ids: [],
        status: created,
        amount: 11631,
        fee: 0,
        created: 2020-04-24T00:57:48+00:00
    )
)
  

Elixir

%StarkBank.BoletoPayment.Log{
    id: "5260913007394816",
    created: ~U[2020-04-24 17:29:22.831884Z],
    errors: [],
    type: "created",
    payment: %starkbank.boletopayment{
        amount: 11631,
        bar_code: "34198846600000116311091005447947307154464000",
        created: ~U[2020-04-24 17:29:22.713657Z],
        description: "Payment for killing white walkers",
        fee: 0,
        id: "6693962735681536",
        line: "34191.09107 05447.947309 71544.640008 8 84660000011631",
        scheduled: ~U[2020-04-25 15:00:00Z],
        status: "created",
        tags: ["little girl", "no one"],
        transaction_ids: [],
        tax_id: "38.435.677/0001-25"
    }
}
  

C#

Log(
    ID: 5260913007394816,
    Created: 24/04/2020 12:41:52,
    Type: created,
    Errors: {  },
    Payment: BoletoPayment(
        Amount: 11631,
        Description: Payment for killing white walkers,
        TaxID: 38.435.677/0001-25,
        Line: 34191.09107 05447.947309 71544.640008 8 84660000011631,
        BarCode: 34198846600000116311091005447947307154464000,
        Scheduled: 04/25/2020 15:00:00,
        Tags: { little girl, no one },
        TransactionIds: {  },
        Status: created,
        Fee: 0,
        Created: 04/24/2020 13:39:28,
        ID: 6693962735681536
    )
)
  

Go

{
    Id:5260913007394816
    Payment:{
        Id:6693962735681536
        Line:34191.09107 05447.947309 71544.640008 8 84660000011631
        BarCode:34198846600000116311091005447947307154464000
        TaxId:38.435.677/0001-25
        Description:Payment for killing white walkers
        Amount:11631
        Scheduled:2020-04-25 15:00:00.00000 +0000 +0000
        Tags:[little girl no one]
        TransactionIds:[]
        Status:created
        Fee:0,
        Created:2020-04-24 15:32:37.718634 +0000 +0000
    }
    Errors:[]
    Type:crated
    Created:2020-04-24 15:00:33.60648 +0000 +0000
}
  

Clojure

{:id "5260913007394816",
 :created "2020-04-24T19:27:53.750606+00:00",
 :errors [],
 :type "created",
 :payment
 {:description "Payment for killing white walkers",
  :fee 0,
  :tags ["little girl" "no one"],
  :tax-id "38.435.677/0001-25",
  :created "2020-04-24T19:27:53.013692+00:00",
  :line "34191.09107 05447.947309 71544.640008 8 84660000011631",
  :status "created",
  :id "6693962735681536",
  :scheduled "2020-04-25T15:00:00.000000+00:00",
  :bar-code "34198846600000116311091005447947307154464000"}}
  

Curl

{
    "cursor": null,
    "logs": [
        {
            "id": "5260913007394816",
            "created": "2020-04-24T23:00:08.338233+00:00",
            "errors": [],
            "type": "created",
            "payment": {
                "id": "6693962735681536",
                "status": "created",
                "amount": 11631,
                "fee": 0,
                "description": "Payment for killing white walkers",
                "tags": ["little girl", "no one"],
                "transactionIds": [],
                "created": "2020-04-24T01:37:21.146576+00:00",
                "scheduled": "2020-04-25T15:00:00+00:00",
                "taxId": "38.435.677/0001-25",
                "barCode": "34198846600000116311091005447947307154464000",
                "line": "34191.09107 05447.947309 71544.640008 8 84660000011631",
            }
        }
    ]
}
  

Get a Boleto Payment Log

Get a single boleto payment log by its id.

Parameters

id REQUIRED

Id of the log entity

fields OPTIONAL

List of strings to filter response JSON keys. Not available in the SDKs.

ENDPOINT
GET /v2/boleto-payment/log/:id
REQUEST

Python

import starkbank

log = starkbank.boletopayment.log.get("5260913007394816")

print(log)
  

Javascript

const starkbank = require('starkbank');

(async() => {
    let log = await starkbank.boletoPayment.log.get('5260913007394816');
    console.log(log);
})();
  

PHP

$log = StarkBank\BoletoPayment\Log::get("5260913007394816");

print_r($log);
  

Java

import com.starkbank.*;

BoletoPayment.Log log = BoletoPayment.Log.get("5260913007394816");

System.out.println(log);
  

Ruby

require('starkbank')

log = StarkBank::BoletoPayment::Log.get('5260913007394816')

puts log
  

Elixir

log = StarkBank.BoletoPayment.Log.get!("5260913007394816")

log |> IO.inspect
  

C#

using System;

StarkBank.BoletoPayment.Log log = StarkBank.BoletoPayment.Log.Get("5260913007394816");

Console.WriteLine(log);
  

Go

package main

import (
    "fmt"
    "github.com/starkbank/sdk-go/starkbank/boletopayment/log"
)

func main() {

    log, err := log.Get("5260913007394816", nil)
    if err.Errors != nil {
        for _, e := range err.Errors {
            fmt.Printf("code: %s, message: %s", e.Code, e.Message)
        }
    }

    fmt.Printf("%+v", log)
}
  

Clojure

(def log (starkbank.boleto-payment.log/get "5260913007394816"))
(println log)
  

Curl

curl --location --request GET '{{baseUrl}}/v2/boleto-payment/log/5260913007394816' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}'
  
RESPONSE

Python

Log(
    id=5260913007394816,
    created=2020-04-24 17:58:32.075347,
    errors=[],
    type=created,
    payment=BoletoPayment(
        amount=11631,
        bar_code=34198846600000116311091005447947307154464000,
        created=2020-04-24 17:58:32.007153,
        description=Payment for killing white walkers,
        fee=0,
        id=6693962735681536,
        line=34191.09107 05447.947309 71544.640008 8 84660000011631,
        scheduled=2020-04-25 15:00:00,
        status=created,
        tags=['little girl', 'no one'],
        transaction_ids=[],
        tax_id=38.435.677/0001-25
    )
)
  

Javascript

Log {
    id: '5260913007394816',
    created: '2020-04-24T01:37:06.423525+00:00',
    type: 'created',
    errors: [],
    payment: {
        id: '6693962735681536',
        taxId: '38.435.677/0001-25',
        description: 'Payment for killing white walkers',
        line: '34191.09107 05447.947309 71544.640008 8 84660000011631',
        barCode: '34198846600000116311091005447947307154464000',
        scheduled: '2020-04-25T15:00:00+00:00',
        tags: [ 'little girl', 'no one' ],
        transactionIds: [],
        status: 'created',
        amount: 11631,
        fee: 0,
        created: '2020-04-24T01:33:40.611174+00:00'
    }
}
  

PHP

StarkBank\BoletoPayment\Log Object
(
    [id] => 5260913007394816
    [created] => DateTime Object
        (
            [date] => 2020-04-24 18:35:37.252968
            [timezone_type] => 1
            [timezone] => +00:00
        )

    [type] => created
    [errors] => Array
        (
        )

    [payment] => StarkBank\BoletoPayment Object
        (
            [id] => 6693962735681536
            [line] => 34191.09107 05447.947309 71544.640008 8 84660000011631
            [taxId] => 38.435.677/0001-25
            [barCode] => 34198846600000116311091005447947307154464000
            [description] => Payment for killing white walkers
            [tags] => Array
                (
                    [0] => little girl
                    [1] => no one
                )

            [transactionIds] => Array
                (
                )

            [scheduled] => DateTime Object
                (
                    [date] => 2020-04-25T15:00:00+00:00
                    [timezone_type] => 1
                    [timezone] => +00:00
                )

            [status] => created
            [amount] => 11631
            [fee] => 0
            [created] => DateTime Object
                (
                    [date] => 2020-04-24 18:35:37.166061
                    [timezone_type] => 1
                    [timezone] => +00:00
                )

        )

)
  

Java

Log({
    "id": "5260913007394816",
    "created": "2020-04-24T00:57:48+00:00",
    "type": "created",
    "errors": [],
    "payment": {
        "id": "6693962735681536",
        "taxId": "38.435.677/0001-25",
        "description": "Payment for killing white walkers",
        "line": "34191.09107 05447.947309 71544.640008 8 84660000011631",
        "barCode": "34198846600000116311091005447947307154464000",
        "scheduled": "2020-04-25T15:00:00+00:00",
        "tags": ["little girl", "no one"],
        "transactionIds": [],
        "status": "created",
        "amount": 11631,
        "fee": 0,
        "created": "2020-04-24T00:57:48+00:00"
    }
})
  

Ruby

log(
    id: 5260913007394816,
    created: 2020-04-24T00:57:48+00:00,
    type: created,
    errors: [],
    payment: boletopayment(
        id: 6693962735681536,
        tax_id: 38.435.677/0001-25,
        description: Payment for killing white walkers,
        line: 34191.09107 05447.947309 71544.640008 8 84660000011631,
        bar_code: 34198846600000116311091005447947307154464000,
        scheduled: 2020-04-25T15:00:00+00:00,
        tags: ["little girl", "no one"],
        transaction_ids: [],
        status: created,
        amount: 11631,
        fee: 0,
        created: 2020-04-24T00:57:48+00:00
    )
)
  

Elixir

%StarkBank.BoletoPayment.Log{
    id: "5260913007394816",
    created: ~U[2020-04-24 17:29:22.831884Z],
    errors: [],
    type: "created",
    payment: %starkbank.boletopayment{
        amount: 11631,
        bar_code: "34198846600000116311091005447947307154464000",
        created: ~U[2020-04-24 17:29:22.713657Z],
        description: "Payment for killing white walkers",
        fee: 0,
        id: "6693962735681536",
        line: "34191.09107 05447.947309 71544.640008 8 84660000011631",
        scheduled: ~U[2020-04-25 15:00:00Z],
        status: "created",
        tags: ["little girl", "no one"],
        transaction_ids: [],
        tax_id: "38.435.677/0001-25"
    }
}
  

C#

Log(
    ID: 5260913007394816,
    Created: 24/04/2020 12:41:52,
    Type: created,
    Errors: {  },
    Payment: BoletoPayment(
        Amount: 11631,
        Description: Payment for killing white walkers,
        TaxID: 38.435.677/0001-25,
        Line: 34191.09107 05447.947309 71544.640008 8 84660000011631,
        BarCode: 34198846600000116311091005447947307154464000,
        Scheduled: 04/25/2020 15:00:00,
        Tags: { little girl, no one },
        TransactionIds: {  },
        Status: created,
        Fee: 0,
        Created: 04/24/2020 13:39:28,
        ID: 6693962735681536
    )
)
  

Go

{
    Id:5260913007394816
    Payment:{
        Id:6693962735681536
        Line:34191.09107 05447.947309 71544.640008 8 84660000011631
        BarCode:34198846600000116311091005447947307154464000
        TaxId:38.435.677/0001-25
        Description:Payment for killing white walkers
        Amount:11631
        Scheduled:2020-04-25 15:00:00.00000 +0000 +0000
        Tags:[little girl no one]
        TransactionIds:[]
        Status:created
        Fee:0,
        Created:2020-04-24 15:32:37.718634 +0000 +0000
    }
    Errors:[]
    Type:crated
    Created:2020-04-24 15:00:33.60648 +0000 +0000
}
  

Clojure

{:id "5260913007394816",
 :created "2020-04-24T19:27:53.750606+00:00",
 :errors [],
 :type "created",
 :payment
 {:description "Payment for killing white walkers",
  :fee 0,
  :tags ["little girl" "no one"],
  :tax-id "38.435.677/0001-25",
  :created "2020-04-24T19:27:53.013692+00:00",
  :line "34191.09107 05447.947309 71544.640008 8 84660000011631",
  :status "created",
  :id "6693962735681536",
  :scheduled "2020-04-25T15:00:00.000000+00:00",
  :bar-code "34198846600000116311091005447947307154464000"}}
  

Curl

{
    "log": {
        "id": "5260913007394816",
        "created": "2020-04-24T23:00:08.338233+00:00",
        "errors": [],
        "type": "created",
        "payment": {
            "id": "6693962735681536",
            "status": "created",
            "amount": 11631,
            "fee": 0,
            "description": "Payment for killing white walkers",
            "tags": ["little girl", "no one"],
            "transactionIds": [],
            "created": "2020-04-24T01:37:21.146576+00:00",
            "scheduled": "2020-04-25T15:00:00+00:00",
            "taxId": "38.435.677/0001-25",
            "barCode": "34198846600000116311091005447947307154464000",
            "line": "34191.09107 05447.947309 71544.640008 8 84660000011631",
        }
    }
}
  

Payment Status

Each payment has a status that can change over time according to its life cycle: payment-status

Payment Log

Every time we modify a utility payment, we create a log. Logs are pretty useful for understanding the life cycle of each payment and the changes that happened to it. Here is the possible event flow: payment-log

The Utility Payment object

Attributes

id STRING

Unique id for the utility payment.

amount INTEGER

Payment amount in cents.

barCode STRING

Bar code number that describes the payment.

created STRING

Creation datetime. Example: "2020-04-23T23:00:00.000000+00:00".

description STRING

Text displayed in the bank statement.

fee INTEGER

Fee charged in cents.

line STRING

Number sequence that describes the payment.

scheduled STRING

Scheduled payment date. Example: "2020-04-23".

status STRING

Current payment status. Options: "created", "processing", "confirmed", "success", "failed", "canceled".

tags LIST OF STRINGS

Tags associated with the utility payment.

transactionIds LIST OF STRINGS

Ledger transaction IDs linked to the payment.

type STRING

Type of the utility payment.

updated STRING

Last update datetime. Example: "2020-04-23T23:00:00.000000+00:00".

Create Utility Payments

Use this route to pay utility bills using the available balance in your Stark Bank account.

Parameters

description REQUIRED

Text to be displayed in your statement. Min length = 10.

barCode CONDITIONALLY REQUIRED

Bar code number that describes the payment. Either "line" or "barCode" parameters are required. If both are sent, they must match.

line CONDITIONALLY REQUIRED

Number sequence that describes the payment. Either "line" or "barCode" parameters are required. If both are sent, they must match.

scheduled OPTIONAL

Schedule the payment for a specific date. Default value is the current day.

tags OPTIONAL

Array of strings to tag the entity for future queries. All tags will be converted to lowercase.

ENDPOINT
POST /v2/utility-payment
REQUEST

Python

import starkbank

payments = starkbank.utilitypayment.create([
    starkbank.UtilityPayment(
        line="83640000001 1 08740138007 0 61053026111 0 08067159411 9",
        tags=["Energy", "Winterfell"],
        description="Electricity for the Long Night",
        scheduled="2020-04-25"
    )
])

for payment in payments:
    print(payment)
  

Javascript

const starkbank = require('starkbank');

(async() => {
    let payments = await starkbank.utilityPayment.create([
        {
            line: '83640000001 1 07850138007 0 61053026111 0 08067159411 9',
            scheduled: '2020-04-25',
            description: 'Electricity for the Long Night',
            tags: ['Energy', 'Winterfell'],
        }
    ]);

    for await (let payment of payments) {
        console.log(payment);
    }
})();
  

PHP

$payments = StarkBank\UtilityPayment::create([
    new StarkBank\UtilityPayment([
        "line" => "83640000001 1 07540138007 0 61053026111 0 08067159411 9",
        "scheduled" => "2020-04-25",
        "description" => "Electricity for the Long Night",
        "tags" => ["Energy", "Winterfell"],
    ])
]);

foreach($payments as $payment){
    print_r($payment);
}
  

Java

import com.starkbank.*;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

List<UtilityPayment> payments = new ArrayList<>();
HashMap<String, Object> data = new HashMap<>();
data.put("line", "83640000001 1 07540138007 0 61053026111 0 08067159411 9");
data.put("scheduled", "2020-04-25");
data.put("description", "Electricity for the Long Night");
data.put("tags", new String[]{"Energy", "Winterfell"});
payments.add(new UtilityPayment(data));

payments = UtilityPayment.create(payments);

for (UtilityPayment payment : payments){
    System.out.println(payment);
}
  

Ruby

require('starkbank')

payments = StarkBank::UtilityPayment.create(
    [
        StarkBank::UtilityPayment.new(
            line: '83640000001 1 07540138007 0 61053026111 0 08067159411 9',
            scheduled: '2020-04-25',
            description: 'Electricity for the Long Night',
            tags: %w[Energy Winterfell]
        )
    ]
)

payments.each do |payment|
    puts payment
end
  

Elixir

payments = StarkBank.UtilityPayment.create!([
    %StarkBank.UtilityPayment{
        line: "83640000001 1 07540138007 0 61053026111 0 08067159411 9",
        description: "Electricity for the Long Night",
        tags: ["Energy", "Winterfell"],
        scheduled: "2020-04-25"
    }
])

for payment <- payments do
    payment |> IO.inspect
end
  

C#

using System;
using System.Collections.Generic;

List<StarkBank.UtilityPayment> payments = StarkBank.UtilityPayment.Create(
    new List<StarkBank.UtilityPayment> {
        new StarkBank.UtilityPayment(
            line: "83640000001 1 07540138007 0 61053026111 0 08067159411 9",
            description: "Electricity for the Long Night",
            tags: new List<string> { "Energy", "Winterfell" },
            scheduled: new DateTime(2020, 4, 25)
        )
    }
);

foreach(StarkBank.UtilityPayment payment in payments)
{
    Console.WriteLine(payment);
}
  

Go

package main

import (
    "fmt"
    "github.com/starkbank/sdk-go/starkbank/utilitypayment"
)

func main() {

    scheduled := time.Date(2020, 04, 25, 0, 0, 0, 0, time.UTC)

    payments, err := utilitypayment.Create(
        []utilitypayment.Utilitypayment{
            {
                Line:        "83640000001 1 07540138007 0 61053026111 0 08067159411 9",
                Description: "Electricity for the Long Night",
                Scheduled:   &scheduled,
                Tags:        []string{"Energy", "Winterfell"},
            },
        }, nil)
    if err.Errors != nil {
        for _, e := range err.Errors {
            fmt.Printf("code: %s, message: %s", e.Code, e.Message)
        }
    }

    for _, payment := range payments {
        fmt.Printf("%+v", payment)
    }
}
  

Clojure

(def payments
  (starkbank.utility-payment/create
    [
      {
        :line "83640000001 1 07540138007 0 61053026111 0 08067159411 9"
        :description "Electricity for the Long Night"
        :tags ["Energy" "Winterfell"]
        :scheduled "2020-04-25"
      }
    ]))
(dorun (map println payments))
  

Curl

curl --location --request POST '{{baseUrl}}/v2/utility-payment' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}' 
--header 'Content-Type: application/json' 
--data-raw '{
    "payments": [
        {
            "line": "83640000001 1 07540138007 0 61053026111 0 08067159411 9",
            "tags": ["Energy", "Winterfell"],
            "description": "Electricity for the Long Night",
            "scheduled": "2020-04-25"
        }
    ]
}'
  
RESPONSE

Python

UtilityPayment(
    amount=10874,
    bar_code=83640000001087401380076105302611108067159411,
    created=2020-04-24 18:03:18.662638,
    description=Electricity for the Long Night,
    fee=0,
    id=5949004768608256,
    line=83640000001 1 08740138007 0 61053026111 0 08067159411 9,
    scheduled=2020-04-25 15:00:00,
    status=created,
    tags=['energy', 'winterfell'],
    transaction_ids=[],
    type=utility,
    updated=2020-04-24 18:03:18.662638,
)
  

Javascript

UtilityPayment {
    id: '5949004768608256',
    barCode: '83640000001078501380076105302611108067159411',
    line: '83640000001 1 07850138007 0 61053026111 0 08067159411 9',
    description: 'Electricity for the Long Night',
    scheduled: '2020-04-25T15:00:00+00:00',
    tags: [ 'energy', 'winterfell' ],
    transactionIds: [ ],
    amount: 10874,
    status: 'created',
    type: 'utility',
    created: '2020-04-24T01:43:13.038706+00:00',
    fee: 0,
    updated: '2020-04-24T01:43:13.038706+00:00',
}
  

PHP

StarkBank\UtilityPayment Object
(
    [id] => 5949004768608256
    [line] => 83640000001 1 07540138007 0 61053026111 0 08067159411 9
    [barCode] => 83640000001075401380076105302611108067159411
    [description] => Electricity for the Long Night
    [tags] => Array
        (
            [0] => energy
            [1] => winterfell
        )

    [transactionIds] => Array
        (
        )

    [scheduled] => DateTime Object
        (
            [date] => 2020-04-25T15:00:00+00:00
            [timezone_type] => 1
            [timezone] => +00:00
        )

    [status] => created
    [type] => utility
    [amount] => 10874
    [fee] => 0
    [created] => DateTime Object
        (
            [date] => 2020-04-24 19:04:46.594557
            [timezone_type] => 1
            [timezone] => +00:00
        )
    [updated] => DateTime Object
        (
            [date] => 2020-04-24 19:04:46.594557
            [timezone_type] => 1
            [timezone] => +00:00
        )

)
  

Java

UtilityPayment({
    "id": "5949004768608256",
    "description": "Electricity for the Long Night",
    "line": "83640000001 1 07540138007 0 61053026111 0 08067159411 9",
    "barCode": "83640000001075401380076105302611108067159411",
    "tags": ["energy", "winterfell"],
    "transactionIds": [],
    "scheduled": "2020-04-20T15:00:00+00:00",
    "amount": 10874,
    "fee": 0,
    "status": "created",
    "type": "utility",
    "created": "2020-04-13T13:05:53+00:00",
    "updated": "2020-04-13T13:05:53+00:00"
})
  

Ruby

utilitypayment(
    id: 5949004768608256,
    description: Electricity for the Long Night,
    line: 83640000001 1 07540138007 0 61053026111 0 08067159411 9,
    bar_code: 83640000001075401380076105302611108067159411,
    tags: ["energy", "winterfell"],
    transaction_ids: [],
    scheduled: 2020-04-20T15:00:00+00:00,
    amount: -10874,
    fee: 0,
    status: created,
    type: utility,
    created: 2020-04-24T13:05:53+00:00,
    updated: 2020-04-24T13:05:53+00:00
)
  

Elixir

%StarkBank.UtilityPayment{
    amount: 10874,
    bar_code: "83640000001075401380076105302611108067159411",
    created: ~U[2020-04-24 18:20:15.232053Z],
    description: "Electricity for the Long Night",
    fee: 0,
    id: "5949004768608256",
    line: "83640000001 1 07540138007 0 61053026111 0 08067159411 9",
    scheduled: ~U[2020-04-25 15:00:00Z],
    status: "created",
    type: "utility",
    tags: ["energy", "winterfell"],
    transaction_ids: [],
    updated: ~U[2020-04-24 18:20:15.232053Z],
}
  

C#

UtilityPayment(
    Amount: 10874,
    Description: electricity payment,
    Line: 83640000001 1 07540138007 0 61053026111 0 08067159411 9,
    BarCode: 83640000001075401380076105302611108067159411,
    Scheduled: 04/25/2020 12:00:00,
    Tags: { energy winterfell },
    TransactionIds: {  },
    Status: created,
    Fee: 0,
    Type: utility,
    Created: 04/24/2020 17:46:39,
    ID: 5949004768608256,
    Updated: 04/24/2020 17:46:39,
)
  

Go

{
    Id:5949004768608256 
    Line:83640000001 1 07540138007 0 61053026111 0 08067159411 9 
    BarCode:83640000001075401380076105302611108067159411 
    Description:Electricity for the Long Night 
    Scheduled:2020-04-25 15:00:00.000000 +0000 +0000 
    Tags:[energy winterfell] 
    TransactionIds:[] 
    Status:created 
    Type:utility 
    Amount:10874 
    Fee:0 
    TransactionIds:[5733517593935872 6057392487792640] 
    Created:2020-04-24 13:05:53.00000 +0000 +0000
    Updated:2020-04-24 13:05:53.00000 +0000 +0000
}
  

Clojure

{:description "Electricity for the Long Night",
 :amount 10874,
 :fee 0,
 :tags ["energy" "winterfell"],
 :created "2020-04-24T19:04:46.594557+00:00",
 :line "83640000001 1 07540138007 0 61053026111 0 08067159411 9",
 :status "created",
 :id "5949004768608256",
 :scheduled "2020-04-25T15:00:00+00:00",
 :bar-code "83640000001075401380076105302611108067159411",
 :updated "2020-04-24T19:04:46.594557+00:00"}
  

Curl

{
    "message": "Utility Payment(s) successfully created",
    "payments": [
        {
            "id": "5949004768608256",
            "status": "created",
            "fee": 0,
            "amount": 10874,
            "description": "Electricity for the Long Night",
            "scheduled": "2020-04-25T15:22:24.957735+00:00",
            "created": "2020-04-24T15:22:25.096450+00:00",
            "barCode": "83640000001075401380076105302611108067159411",
            "line": "83640000001 1 07540138007 0 61053026111 0 08067159411 9",
            "tags": ["Energy", "Winterfell"],
            "transactionIds": [],
            "status": "created",
            "type": "utility",
            "updated": "2020-04-24T15:22:25.096450+00:00",
        }
    ]
}
  

List Utility Payments

Get a list of non-deleted utility payments in chunks of at most 100. If you need smaller chunks, use the limit parameter.

Parameters

after OPTIONAL

Filter entities created after this date.

before OPTIONAL

Filter entities created before this date.

cursor OPTIONAL

String used to get the next batch of results. Our SDKs handle this for you.

fields OPTIONAL

List of strings to filter response JSON keys. Not available in the SDKs.

ids OPTIONAL

List of strings to get specific entities by ids.

limit OPTIONAL

Number of results per cursor. Max = 100.

status OPTIONAL

Filter utility payments by the specified status.

tags OPTIONAL

Filter entities that contain the specified tags.

ENDPOINT
GET /v2/utility-payment
REQUEST

Python

import starkbank

payments = starkbank.utilitypayment.query(
    after="2020-04-01",
    before="2020-04-30"
)

for payment in payments:
    print(payment)
  

Javascript

const starkbank = require('starkbank');

(async() => {
    let payments = await starkbank.utilityPayment.query({
        after: '2020-04-01',
        before: '2020-04-30'
    });

    for await (let payment of payments) {
        console.log(payment);
    }
})();
  

PHP

$payments = StarkBank\UtilityPayment::query([
    "after" => "2020-04-01",
    "before" => "2020-04-30"
]);

foreach($payments as $payment){
    print_r($payment);
}
  

Java

import com.starkbank.*;
import com.starkbank.utils.Generator;
import java.util.HashMap;

HashMap<String, Object> params = new HashMap<>();
params.put("after", "2020-04-01");
params.put("before", "2020-04-30");
Generator<UtilityPayment> payments = UtilityPayment.query(params);

for (UtilityPayment payment : payments){
    System.out.println(payment);
}
  

Ruby

require('starkbank')

payments = StarkBank::UtilityPayment.query(
    after: '2020-04-01',
    before: '2020-04-30'
)

payments.each do |payment|
    puts payment
end
  

Elixir

payments = StarkBank.UtilityPayment.query!(
    after: "2020-04-01",
    before: "2020-04-30"
)

for payment <- payments do
    payment |> IO.inspect
end
  

C#

using System;
using System.Collections.Generic;

IEnumerable<StarkBank.UtilityPayment> payments = StarkBank.UtilityPayment.Query(
    after: new DateTime(2020, 4, 1),
    before: new DateTime(2020, 4, 30)
);

foreach(StarkBank.UtilityPayment payment in payments)
{
    Console.WriteLine(payment);
}
  

Go

package main

import (
    "fmt"
    "time"
    "github.com/starkbank/sdk-go/starkbank/utilitypayment"
)

func main() {

    var params = map[string]interface{}{}
    params["after"] = time.Date(2020, 4, 1, 0, 0, 0, 0, time.UTC)
    params["before"] = time.Date(2020, 4, 30, 0, 0, 0, 0, time.UTC)
    
    payments, errorChannel := utilitypayment.Query(params, nil)

    loop:
    for {
        select {
        case err := <-errorChannel:
            if err.Errors != nil {
                for _, e := range err.Errors {
                    fmt.Printf("code: %s, message: %s", e.Code, e.Message)
                }
            }
        case payment, ok := <-payments:
            if !ok {
                break loop
            }
            fmt.Printf("%+v", payment)
        }
    }
}
  

Clojure

(def payments
  (starkbank.utility-payment/query
    {
      :after "2020-04-01"
      :before "2020-04-30"
    }))
(dorun (map println payments))
  

Curl

curl --location --request GET '{{baseUrl}}/v2/utility-payment?after=2020-01-01&before=2020-01-30' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}'
  
RESPONSE

Python

UtilityPayment(
    amount=10874,
    bar_code=83640000001087401380076105302611108067159411,
    created=2020-04-24 18:03:18.662638,
    description=Electricity for the Long Night,
    fee=0,
    id=5949004768608256,
    line=83640000001 1 08740138007 0 61053026111 0 08067159411 9,
    scheduled=2020-04-25 15:00:00,
    status=created,
    tags=['energy', 'winterfell'],
    transaction_ids=[],
    type=utility,
    updated=2020-04-24 18:03:18.662638,
)
  

Javascript

UtilityPayment {
    id: '5949004768608256',
    barCode: '83640000001078501380076105302611108067159411',
    line: '83640000001 1 07850138007 0 61053026111 0 08067159411 9',
    description: 'Electricity for the Long Night',
    scheduled: '2020-04-25T15:00:00+00:00',
    tags: [ 'energy', 'winterfell' ],
    transactionIds: [ ],
    amount: 10874,
    status: 'created',
    type: 'utility',
    created: '2020-04-24T01:43:13.038706+00:00',
    fee: 0,
    updated: '2020-04-24T01:43:13.038706+00:00',
}
  

PHP

StarkBank\UtilityPayment Object
(
    [id] => 5949004768608256
    [line] => 83640000001 1 07540138007 0 61053026111 0 08067159411 9
    [barCode] => 83640000001075401380076105302611108067159411
    [description] => Electricity for the Long Night
    [tags] => Array
        (
            [0] => energy
            [1] => winterfell
        )

    [transactionIds] => Array
        (
        )

    [scheduled] => DateTime Object
        (
            [date] => 2020-04-25T15:00:00+00:00
            [timezone_type] => 1
            [timezone] => +00:00
        )

    [status] => created
    [type] => utility
    [amount] => 10874
    [fee] => 0
    [created] => DateTime Object
        (
            [date] => 2020-04-24 19:04:46.594557
            [timezone_type] => 1
            [timezone] => +00:00
        )
    [updated] => DateTime Object
        (
            [date] => 2020-04-24 19:04:46.594557
            [timezone_type] => 1
            [timezone] => +00:00
        )

)
  

Java

UtilityPayment({
    "id": "5949004768608256",
    "description": "Electricity for the Long Night",
    "line": "83640000001 1 07540138007 0 61053026111 0 08067159411 9",
    "barCode": "83640000001075401380076105302611108067159411",
    "tags": ["energy", "winterfell"],
    "transactionIds": [],
    "scheduled": "2020-04-20T15:00:00+00:00",
    "amount": 10874,
    "fee": 0,
    "amount": 10874,
    "type": "utility",
    "created": "2020-04-13T13:05:53+00:00",
    "updated": "2020-04-13T13:05:53+00:00"
})
  

Ruby

utilitypayment(
    id: 5949004768608256,
    description: Electricity for the Long Night,
    line: 83640000001 1 07540138007 0 61053026111 0 08067159411 9,
    bar_code: 83640000001075401380076105302611108067159411,
    tags: ["energy", "winterfell"],
    transaction_ids: [],
    scheduled: 2020-04-20T15:00:00+00:00,
    amount: 10874,
    fee: 0,
    status: created,
    type: utility,
    created: 2020-04-24T13:05:53+00:00,
    updated: 2020-04-24T13:05:53+00:00
)
  

Elixir

%StarkBank.UtilityPayment{
    amount: 10874,
    bar_code: "83640000001075401380076105302611108067159411",
    created: ~U[2020-04-24 18:20:15.232053Z],
    description: "Electricity for the Long Night",
    fee: 0,
    id: "5949004768608256",
    line: "83640000001 1 07540138007 0 61053026111 0 08067159411 9",
    scheduled: ~U[2020-04-25 15:00:00Z],
    status: "created",
    type: "utility",
    tags: ["energy", "winterfell"],
    transaction_ids: [],
    updated: ~U[2020-04-24 18:20:15.232053Z],
}
  

C#

UtilityPayment(
    Amount: 10874,
    Description: electricity payment,
    Line: 83640000001 1 07540138007 0 61053026111 0 08067159411 9,
    BarCode: 83640000001075401380076105302611108067159411,
    Scheduled: 04/25/2020 12:00:00,
    Tags: { energy winterfell },
    TransactionIds: {  },
    Status: created,
    Fee: 0,
    Type: utility,
    Created: 04/24/2020 17:46:39,
    ID: 5949004768608256,
    Updated: 04/24/2020 17:46:39,
)
  

Go

{
    Id:5949004768608256 
    Line:83640000001 1 07540138007 0 61053026111 0 08067159411 9 
    BarCode:83640000001075401380076105302611108067159411 
    Description:Electricity for the Long Night 
    Scheduled:2020-04-25 15:00:00.000000 +0000 +0000 
    Tags:[energy winterfell] 
    TransactionIds:[] 
    Status:created 
    Type:utility 
    Amount:10874 
    Fee:0 
    TransactionIds:[5733517593935872 6057392487792640] 
    Created:2020-04-24 13:05:53.00000 +0000 +0000
    Updated:2020-04-24 13:05:53.00000 +0000 +0000
}
  

Clojure

{:description "Electricity for the Long Night",
 :amount 10874,
 :fee 0,
 :tags ["energy" "winterfell"],
 :created "2020-04-24T19:04:46.594557+00:00",
 :line "83640000001 1 07540138007 0 61053026111 0 08067159411 9",
 :status "created",
 :id "5949004768608256",
 :scheduled "2020-04-25T15:00:00+00:00",
 :bar-code "83640000001075401380076105302611108067159411",
 :updated "2020-04-24T19:04:46.594557+00:00"}
  

Curl

{
    "cursor": null,
    "payments": [
        {
            "id": "5949004768608256",
            "status": "created",
            "fee": 0,
            "amount": 10874,
            "description": "Electricity for the Long Night",
            "scheduled": "2020-04-25T15:22:24.957735+00:00",
            "created": "2020-04-24T15:22:25.096450+00:00",
            "barCode": "83640000001075401380076105302611108067159411",
            "line": "83640000001 1 07540138007 0 61053026111 0 08067159411 9",
            "tags": ["Energy", "Winterfell"],
            "transactionIds": [],
            "status": "created",
            "type": "utility",
            "updated": "2020-04-24T15:22:25.096450+00:00",
        }
    ]
}
  

Get a Utility Payment

Get a single utility payment by its id.

Parameters

id REQUIRED

Id of the utility payment entity.

fields OPTIONAL

List of strings to filter response JSON keys. Not available in the SDKs.

ENDPOINT
GET /v2/utility-payment/:id
REQUEST

Python

import starkbank

payment = starkbank.utilitypayment.get("5949004768608256")

print(payment)
  

Javascript

  const starkbank = require('starkbank');

  (async() => {
      let payment = await starkbank.utilityPayment.get('5949004768608256');
      console.log(payment);
  })();
  

PHP

  $payment = StarkBank\UtilityPayment::get("5949004768608256");

  print_r($payment);
  

Java

import com.starkbank.*;

UtilityPayment payment = UtilityPayment.get("5949004768608256");

System.out.println(payment);
  

Ruby

require('starkbank')

payment = StarkBank::UtilityPayment.get('5949004768608256')

puts payment
  

Elixir

payment = StarkBank.UtilityPayment.get!("5949004768608256")

payment |> IO.inspect
  

C#

using System;

StarkBank.UtilityPayment payment = StarkBank.UtilityPayment.Get("5949004768608256");

Console.WriteLine(payment);
  

Go

package main

import (
    "fmt"
    "github.com/starkbank/sdk-go/starkbank/utilitypayment"
)

func main() {

    payment, err := utilitypayment.Get("5949004768608256", nil)
    if err.Errors != nil {
        for _, e := range err.Errors {
            fmt.Printf("code: %s, message: %s", e.Code, e.Message)
        }
    }

    fmt.Printf("%+v", payment)
}
  

Clojure

(def payment (starkbank.utility-payment/get "5949004768608256"))
(println payment)
  

Curl

curl --location --request GET '{{baseUrl}}/v2/utility-payment/5949004768608256' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}'
  
RESPONSE

Python

UtilityPayment(
  amount=10874,
  bar_code=83640000001087401380076105302611108067159411,
  created=2020-04-24 18:03:18.662638,
  description=Electricity for the Long Night,
  fee=0,
  id=5949004768608256,
  line=83640000001 1 08740138007 0 61053026111 0 08067159411 9,
  scheduled=2020-04-25 15:00:00,
  status=created,
  tags=['energy', 'winterfell'],
  transaction_ids=[],
  type=utility,
  updated=2020-04-24 18:03:18.662638,
)
  

Javascript

UtilityPayment {
    id: '5949004768608256',
    barCode: '83640000001078501380076105302611108067159411',
    line: '83640000001 1 07850138007 0 61053026111 0 08067159411 9',
    description: 'Electricity for the Long Night',
    scheduled: '2020-04-25T15:00:00+00:00',
    tags: [ 'energy', 'winterfell' ],
    transactionIds: [ ],
    amount: 10874,
    status: 'created',
    type: 'utility',
    created: '2020-04-24T01:43:13.038706+00:00',
    fee: 0,
    updated: '2020-04-24T01:43:13.038706+00:00',
}
  

PHP

StarkBank\UtilityPayment Object
(
    [id] => 5949004768608256
    [line] => 83640000001 1 07540138007 0 61053026111 0 08067159411 9
    [barCode] => 83640000001075401380076105302611108067159411
    [description] => Electricity for the Long Night
    [tags] => Array
        (
            [0] => energy
            [1] => winterfell
        )

    [transactionIds] => Array
        (
        )

    [scheduled] => DateTime Object
        (
            [date] => 2020-04-25T15:00:00+00:00
            [timezone_type] => 1
            [timezone] => +00:00
        )

    [status] => canceled
    [type] => utility
    [amount] => 10874
    [fee] => 0
    [created] => DateTime Object
        (
            [date] => 2020-04-24 19:04:46.594557
            [timezone_type] => 1
            [timezone] => +00:00
        )
    [updated] => DateTime Object
        (
            [date] => 2020-04-24 19:04:46.594557
            [timezone_type] => 1
            [timezone] => +00:00
        )

)
  

Java

UtilityPayment({
  "id": "5949004768608256",
  "description": "Electricity for the Long Night",
  "line": "83640000001 1 07540138007 0 61053026111 0 08067159411 9",
  "barCode": "83640000001075401380076105302611108067159411",
  "tags": ["energy", "winterfell"],
  "transactionIds": [],
  "scheduled": "2020-04-20T15:00:00+00:00",
  "amount": 10874,
  "fee": 0,
  "amount": 10874,
  "type": "utility",
  "created": "2020-04-13T13:05:53+00:00",
  "updated": "2020-04-13T13:05:53+00:00"
})
  

Ruby

utilitypayment(
    id: 5949004768608256,
    description: Electricity for the Long Night,
    line: 83640000001 1 07540138007 0 61053026111 0 08067159411 9,
    bar_code: 83640000001075401380076105302611108067159411,
    tags: ["energy", "winterfell"],
    transaction_ids: [],
    scheduled: 2020-04-20T15:00:00+00:00,
    amount: 10874,
    fee: 0,
    status: created,
    type: utility,
    created: 2020-04-24T13:05:53+00:00,
    updated: 2020-04-24T13:05:53+00:00
)
  

Elixir

%StarkBank.UtilityPayment{
    amount: 10874,
    bar_code: "83640000001075401380076105302611108067159411",
    created: ~U[2020-04-24 18:20:15.232053Z],
    description: "Electricity for the Long Night",
    fee: 0,
    id: "5949004768608256",
    line: "83640000001 1 07540138007 0 61053026111 0 08067159411 9",
    scheduled: ~U[2020-04-25 15:00:00Z],
    status: "created",
    type: "utility",
    tags: ["energy", "winterfell"],
    transaction_ids: [],
    updated: ~U[2020-04-24 18:20:15.232053Z],
}
  

C#

UtilityPayment(
    Amount: 10874,
    Description: electricity payment,
    Line: 83640000001 1 07540138007 0 61053026111 0 08067159411 9,
    BarCode: 83640000001075401380076105302611108067159411,
    Scheduled: 04/25/2020 12:00:00,
    Tags: { energy winterfell },
    TransactionIds: {  },
    Status: created,
    Fee: 0,
    Type: utility,
    Created: 04/24/2020 17:46:39,
    ID: 5949004768608256,
    Updated: 04/24/2020 17:46:39,
  )
  

Go

{
    Id:5949004768608256 
    Line:83640000001 1 07540138007 0 61053026111 0 08067159411 9 
    BarCode:83640000001075401380076105302611108067159411 
    Description:Electricity for the Long Night 
    Scheduled:2020-04-25 15:00:00.000000 +0000 +0000 
    Tags:[energy winterfell] 
    TransactionIds:[] 
    Status:created 
    Type:utility 
    Amount:10874 
    Fee:0 
    TransactionIds:[5733517593935872 6057392487792640] 
    Created:2020-04-24 13:05:53.00000 +0000 +0000
    Updated:2020-04-24 13:05:53.00000 +0000 +0000
}
  

Clojure

{:description "Electricity for the Long Night",
:amount 10874,
:fee 0,
:tags ["energy" "winterfell"],
:created "2020-04-24T19:04:46.594557+00:00",
:line "83640000001 1 07540138007 0 61053026111 0 08067159411 9",
:status "created",
:id "5949004768608256",
:scheduled "2020-04-25T15:00:00+00:00",
:bar-code "83640000001075401380076105302611108067159411"}
  

Curl

{
  "payment": {
      "id": "5949004768608256",
      "status": "created",
      "fee": 0,
      "amount": 10874,
      "description": "Electricity for the Long Night",
      "scheduled": "2020-04-25T15:22:24.957735+00:00",
      "created": "2020-04-24T15:22:25.096450+00:00",
      "barCode": "83640000001075401380076105302611108067159411",
      "line": "83640000001 1 07540138007 0 61053026111 0 08067159411 9",
      "tags": ["Energy", "Winterfell"],
      "transactionIds": [],
      "status": "created",
      "type": "utility",
      "updated": "2020-04-24T15:22:25.096450+00:00",
  }
}
  

Delete a Utility Payment

Cancel a scheduled utility payment. You can only cancel utility payments before they start being processed.

NOTE: Payments that have already been processed can be deleted, but not cancelled.

Parameters

id REQUIRED

Id of the utility payment entity.

ENDPOINT
DELETE /v2/utility-payment/:id
REQUEST

Python

import starkbank

payment = starkbank.utilitypayment.delete("5949004768608256")

print(payment)
  

Javascript

const starkbank = require('starkbank');

(async() => {
    let payment = await starkbank.utilityPayment.delete('5949004768608256');
    console.log(payment);
})();
  

PHP

$payment = StarkBank\UtilityPayment::delete("5949004768608256");

print_r($payment);
  

Java

import com.starkbank.*;

UtilityPayment payment = UtilityPayment.delete("5949004768608256");

System.out.println(payment);
  

Ruby

require('starkbank')

payment = StarkBank::UtilityPayment.delete('5949004768608256')

puts payment
  

Elixir

payment = StarkBank.UtilityPayment.delete!("5949004768608256")

payment |> IO.inspect
  

C#

using System;

StarkBank.UtilityPayment payment = StarkBank.UtilityPayment.Delete("5949004768608256");

Console.WriteLine(payment);
  

Go

package main

import (
    "fmt"
    "github.com/starkbank/sdk-go/starkbank/utilitypayment"
)

func main() {

    payment, err := utilitypayment.Delete("5949004768608256", nil)
    if err.Errors != nil {
        for _, e := range err.Errors {
            fmt.Printf("code: %s, message: %s", e.Code, e.Message)
        }
    }

    fmt.Printf("%+v", payment)
} 
  

Clojure

(def payment (starkbank.utility-payment/delete "5949004768608256"))
(println payment)
  

Curl

curl --location --request DELETE '{{baseUrl}}/v2/utility-payment/5949004768608256' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}'
  
RESPONSE

Python

UtilityPayment(
  amount=10874,
  bar_code=83640000001087401380076105302611108067159411,
  created=2020-04-24 18:03:18.662638,
  description=Electricity for the Long Night,
  fee=0,
  id=5949004768608256,
  line=83640000001 1 08740138007 0 61053026111 0 08067159411 9,
  scheduled=2020-04-25 15:00:00,
  status=canceled,
  tags=['energy', 'winterfell'],
  transaction_ids=[],
  type=utility,
  updated=2020-04-24 18:03:18.662638,
)
  

Javascript

UtilityPayment {
  id: '5949004768608256',
  barCode: '83640000001078501380076105302611108067159411',
  line: '83640000001 1 07850138007 0 61053026111 0 08067159411 9',
  description: 'Electricity for the Long Night',
  scheduled: '2020-04-25T15:00:00+00:00',
  tags: [ 'energy', 'winterfell' ],
  transactionIds: [ ],
  amount: 10874,
  status: 'canceled',
  type: 'utility',
  created: '2020-04-24T01:43:13.038706+00:00',
  fee: 0,
  updated: '2020-04-24T01:43:13.038706+00:00',
  }  
  

PHP

StarkBank\UtilityPayment Object
(
    [id] => 5949004768608256
    [line] => 83640000001 1 07540138007 0 61053026111 0 08067159411 9
    [barCode] => 83640000001075401380076105302611108067159411
    [description] => Electricity for the Long Night
    [tags] => Array
        (
            [0] => energy
            [1] => winterfell
        )

    [transactionIds] => Array
        (
        )

    [scheduled] => DateTime Object
        (
            [date] => 2020-04-25T15:00:00+00:00
            [timezone_type] => 1
            [timezone] => +00:00
        )

    [status] => canceled
    [type] => utility
    [amount] => 10874
    [fee] => 0
    [created] => DateTime Object
        (
            [date] => 2020-04-24 19:04:46.594557
            [timezone_type] => 1
            [timezone] => +00:00
        )
    [updated] => DateTime Object
        (
            [date] => 2020-04-24 19:04:46.594557
            [timezone_type] => 1
            [timezone] => +00:00
        )

)
  

Java

UtilityPayment({
  "id": "5949004768608256",
  "description": "Electricity for the Long Night",
  "line": "83640000001 1 07540138007 0 61053026111 0 08067159411 9",
  "barCode": "83640000001075401380076105302611108067159411",
  "tags": ["energy", "winterfell"],
  "transactionIds": [],
  "scheduled": "2020-04-20T15:00:00+00:00",
  "amount": 10874,
  "fee": 0,
  "status": "canceled",
  "type": "utility",
  "created": "2020-04-13T13:05:53+00:00",
  "updated": "2020-04-13T13:05:53+00:00"
  })
  

Ruby

utilitypayment(
  id: 5949004768608256,
  description: Electricity for the Long Night,
  line: 83640000001 1 07540138007 0 61053026111 0 08067159411 9,
  bar_code: 83640000001075401380076105302611108067159411,
  tags: ["energy", "winterfell"],
  transaction_ids: [],
  scheduled: 2020-04-20T15:00:00+00:00,
  amount: 10874,
  fee: 0,
  status: canceled,
  type: utility,
  created: 2020-04-24T13:05:53+00:00,
  updated: 2020-04-24T13:05:53+00:00
  )
  

Elixir

%StarkBank.UtilityPayment{
  amount: 10874,
  bar_code: "83640000001075401380076105302611108067159411",
  created: ~U[2020-04-24 18:20:15.232053Z],
  description: "Electricity for the Long Night",
  fee: 0,
  id: "5949004768608256",
  line: "83640000001 1 07540138007 0 61053026111 0 08067159411 9",
  scheduled: ~U[2020-04-25 15:00:00Z],
  status: "canceled",
  type: "utility",
  tags: ["energy", "winterfell"],
  transaction_ids: [],
  updated: ~U[2020-04-24 18:20:15.232053Z],
}
  

C#

UtilityPayment(
  Amount: 10874,
  Description: electricity payment,
  Line: 83640000001 1 07540138007 0 61053026111 0 08067159411 9,
  BarCode: 83640000001075401380076105302611108067159411,
  Scheduled: 04/25/2020 12:00:00,
  Tags: { energy winterfell },
  TransactionIds: {  },
  Status: canceled,
  Fee: 0,
  Type: utility,
  Created: 04/24/2020 17:46:39,
  ID: 5949004768608256,
  Updated: 04/24/2020 17:46:39,
)
  

Go

{
  Id:5949004768608256 
  Line:83640000001 1 07540138007 0 61053026111 0 08067159411 9 
  BarCode:83640000001075401380076105302611108067159411 
  Description:Electricity for the Long Night 
  Scheduled:2020-04-25 15:00:00.000000 +0000 +0000 
  Tags:[energy winterfell] 
  TransactionIds:[] 
  Status:canceled 
  Type:utility 
  Amount:10874 
  Fee:0 
  TransactionIds:[5733517593935872 6057392487792640] 
  Created:2020-04-24 13:05:53.00000 +0000 +0000
  Updated:2020-04-24 13:05:53.00000 +0000 +0000
}
  

Clojure

{:description "Electricity for the Long Night",
:amount 10874,
:fee 0,
:tags ["energy" "winterfell"],
:created "2020-04-24T19:04:46.594557+00:00",
:line "83640000001 1 07540138007 0 61053026111 0 08067159411 9",
:status "canceled",
:id "5949004768608256",
:scheduled "2020-04-25T15:00:00+00:00",
:bar-code "83640000001075401380076105302611108067159411",
:updated "2020-04-24T19:04:46.594557+00:00"}
  

Curl

{
  "message": "Utility Payment successfully deleted",
  "payment": {
      "id": "5949004768608256",
      "status": "canceled",
      "fee": 0,
      "amount": 10874,
      "description": "Electricity for the Long Night",
      "scheduled": "2020-04-25T15:22:24.957735+00:00",
      "created": "2020-04-24T15:22:25.096450+00:00",
      "barCode": "83640000001075401380076105302611108067159411",
      "line": "83640000001 1 07540138007 0 61053026111 0 08067159411 9",
      "tags": ["Energy", "Winterfell"],
      "transactionIds": [],
      "status": "canceled",
      "type": "utility",
      "updated": "2020-04-24T15:22:25.096450+00:00",
  }
}
  

Get a Utility Payment PDF

Get a utility payment PDF receipt. You can only get a receipt for payments whose status are either success, processing or created.

Parameters

id REQUIRED

Id of the utility payment entity

ENDPOINT
GET /v2/utility-payment/:id/pdf
REQUEST

Python

import starkbank

pdf = starkbank.utilitypayment.pdf("5949004768608256")

with open("utility-payment.pdf", "wb") as file:
    file.write(pdf)
  

Javascript

const starkbank = require('starkbank');
const fs = require('fs').promises;

(async() => {
    let pdf = await starkbank.utilityPayment.pdf('5949004768608256');
    await fs.writeFile('utility-payment.pdf', pdf);
})();
  

PHP

$pdf = StarkBank\UtilityPayment::pdf("5949004768608256");

$fp = fopen('utility-payment.pdf', 'w');
fwrite($fp, $pdf);
fclose($fp);
  

Java

import java.io.File;
import java.io.InputStream;
import java.nio.file.StandardCopyOption;
import com.starkbank.*;

InputStream pdf = UtilityPayment.pdf("5949004768608256");

java.nio.file.Files.copy(
    pdf,
    new File("utility-payment.pdf").toPath(),
    StandardCopyOption.REPLACE_EXISTING
);
  

Ruby

require('starkbank')

pdf = StarkBank::UtilityPayment.pdf('5949004768608256')

File.open('utility-payment.pdf', 'w') { |file| file.write(pdf) }
  

Elixir

pdf = StarkBank.UtilityPayment.pdf!("5949004768608256")

file = File.open!("utility-payment.pdf", [:write])
IO.binwrite(file, pdf)
File.close(file)
  

C#

byte[] pdf = StarkBank.UtilityPayment.Pdf("5949004768608256");

System.IO.File.WriteAllBytes("utility-payment.pdf", pdf);
  

Go

package main

import (
    "fmt"
    "github.com/starkbank/sdk-go/starkbank/utilitypayment"
)

func main() {

    pdf, err := utilitypayment.Pdf("5949004768608256", nil)
    if err.Errors != nil {
        for _, e := range err.Errors {
            fmt.Printf("code: %s, message: %s", e.Code, e.Message)
        }
    }

    errFile := ioutil.WriteFile("utilitypayment.pdf", pdf, 0666)
    if errFile != nil {
        fmt.Print(errFile)
    }
  

Clojure

(clojure.java.io/copy
(starkbank.utility-payment/pdf "5949004768608256")
(clojure.java.io/file "utility-payment.pdf"))
  

Curl

curl --location --request GET '{{baseUrl}}/v2/utility-payment/5949004768608256/pdf' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}'
  

List Utility Payment Logs

Get a paged list of all utility payment logs. A log tracks a change in the payment entity according to its life cycle.

Parameters

after OPTIONAL

Filter entities created after this date.

before OPTIONAL

Filter entities created before this date.

cursor OPTIONAL

String used to get the next batch of results. Our SDKs handle this for you.

fields OPTIONAL

List of strings to filter response JSON keys. Not available in the SDKs.

limit OPTIONAL

Number of results per cursor. Max = 100.

paymentIds OPTIONAL

Array of payment ids linked to the desired logs.

types OPTIONAL

Filters logs by log types.

ENDPOINT
GET /v2/utility-payment/log
REQUEST

Python

import starkbank

logs = starkbank.utilitypayment.log.query(
    payment_ids=["5949004768608256"]
)

for log in logs:
    print(log)
  

Javascript

const starkbank = require('starkbank');

(async() => {
    let logs = await starkbank.utilityPayment.log.query({
        paymentIds:['5949004768608256'],
    });

    for await (let log of logs) {
        console.log(log);
    }
})();
  

PHP

$logs = StarkBank\UtilityPayment\Log::query([
    "paymentIds" => ["5949004768608256"]
]);

foreach($logs as $log){
    print_r($log);
}
  

Java

import com.starkbank.*;
import com.starkbank.utils.Generator;
import java.util.HashMap;

HashMap<String, Object> params = new HashMap<>();
params.put("paymentIds", "5949004768608256");
Generator<UtilityPayment.Log> logs = UtilityPayment.Log.query(params);

for (UtilityPayment.Log log : logs){
    System.out.println(log);
}
  

Ruby

require('starkbank')

logs = StarkBank::UtilityPayment::Log.query(
    payment_ids: ['5949004768608256']
)

logs.each do |log|
    puts log
end
  

Elixir

logs = StarkBank.UtilityPayment.Log.query!(
    payment_ids: ["5949004768608256"]
)

for log <- logs do
    log |> IO.inspect
end
  

C#

using System;
using System.Collections.Generic;

IEnumerable<StarkBank.UtilityPayment.Log> logs = StarkBank.UtilityPayment.Log.Query(
    paymentIds: new List<string> { "5949004768608256" }
);

foreach(StarkBank.UtilityPayment.Log log in logs)
{
    Console.WriteLine(log);
}
  

Go

package main

import (
    "fmt"
    "github.com/starkbank/sdk-go/starkbank/utilitypayment/log"
)

func main() {

    var params = map[string]interface{}{}
    params["paymentIds"] = []string{"5949004768608256"}
    
    logs, errorChannel := log.Query(params, nil)

    loop:
    for {
        select {
        case err := <-errorChannel:
            if err.Errors != nil {
                for _, e := range err.Errors {
                    fmt.Printf("code: %s, message: %s", e.Code, e.Message)
                }
            }
        case log, ok := <-logs:
            if !ok {
                break loop
            }
            fmt.Printf("%+v", log)
        }
    }
}     
  

Clojure

(def logs
    (starkbank.utility-payment.log/query
        {
        :payment-ids ["5949004768608256"]
        }))
    (dorun (map println logs))
  

Curl

curl --location --request GET '{{baseUrl}}/v2/utility-payment/log?paymentIds=5949004768608256' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}'
  
RESPONSE

Python

Log(
    id=5369811349536768,
    created=2020-04-24 18:03:18.733424,
    errors=[],
    type=created,
    payment=UtilityPayment(
        amount=10874,
        bar_code=83640000001087401380076105302611108067159411,
        created=2020-04-24 18:03:18.662638,
        description=Electricity for the Long Night,
        fee=0,
        id=5949004768608256,
        line=83640000001 1 08740138007 0 61053026111 0 08067159411 9,
        scheduled=2020-04-25 15:00:00,
        status=created,
        tags=['energy', 'winterfell'],
        transaction_ids=[],
        type=utility,
        updated=2020-04-24 18:03:18.662638,
    )
)
  

Javascript

Log {
    id: '5369811349536768',
    created: '2020-04-24T01:43:13.136987+00:00',
    type: 'created',
    errors: [],
    payment: {
        id: '5949004768608256',
        barCode: '83640000001078501380076105302611108067159411',
        line: '83640000001 1 07850138007 0 61053026111 0 08067159411 9',
        description: 'Electricity for the Long Night',
        scheduled: '2020-04-25T15:00:00+00:00',
        tags: [ 'energy', 'winterfell' ],
        transactionIds: [ ],
        amount: 10874,
        status: 'created',
        type: 'utility',
        created: '2020-04-24T01:43:13.038706+00:00',
        fee: 0,
        updated: '2020-04-24T01:43:13.038706+00:00',
    }
}
  

PHP

StarkBank\UtilityPayment\Log Object
(
    [id] => 5369811349536768
    [created] => DateTime Object
        (
            [date] => 2020-04-24 19:04:46.689468
            [timezone_type] => 1
            [timezone] => +00:00
        )

    [type] => created
    [errors] => Array
        (
        )

    [payment] => StarkBank\UtilityPayment Object
        (
            [id] => 5949004768608256
            [line] => 83640000001 1 07540138007 0 61053026111 0 08067159411 9
            [barCode] => 83640000001075401380076105302611108067159411
            [description] => Electricity for the Long Night
            [tags] => Array
                (
                    [0] => energy
                    [1] => winterfell
                )

            [transactionIds] => Array
                (
                )

            [scheduled] => DateTime Object
                (
                    [date] => 2020-04-25T15:00:00+00:00
                    [timezone_type] => 1
                    [timezone] => +00:00
                )

            [status] => created
            [type] => utility
            [amount] => 10874
            [fee] => 0
            [created] => DateTime Object
                (
                    [date] => 2020-04-24 19:04:46.594557
                    [timezone_type] => 1
                    [timezone] => +00:00
                )

            [updated] => DateTime Object
                (
                    [date] => 2020-04-24 19:04:46.594557
                    [timezone_type] => 1
                    [timezone] => +00:00
                )

        )

)
  

Java

Log({
    "id": "5369811349536768",
    "created": "2020-04-24T13:05:53+00:00",
    "type": "created",
    "errors": [],
    "payment": {
        "id": "5949004768608256",
        "description": "Electricity for the Long Night",
        "line": "83640000001 1 07540138007 0 61053026111 0 08067159411 9",
        "barCode": "83640000001075401380076105302611108067159411",
        "tags": ["energy", "winterfell"],
        "transactionIds": [],
        "scheduled": "2020-04-20T15:00:00+00:00",
        "amount": 10874,
        "fee": 0,
        "status": "canceled",
        "type": "utility",
        "created": "2020-04-13T13:05:53+00:00",
        "updated": "2020-04-13T13:05:53+00:00"
    }
})
  

Ruby

log(
    id: 5369811349536768,
    created: 2020-04-24T13:05:53+00:00,
    type: created,
    errors: [],
    payment: utilitypayment(
        id: 5949004768608256,
        description: Electricity for the Long Night,
        line: 83640000001 1 07540138007 0 61053026111 0 08067159411 9,
        bar_code: 83640000001075401380076105302611108067159411,
        tags: ["energy", "winterfell"],
        transaction_ids: [],
        scheduled: 2020-04-20T15:00:00+00:00,
        amount: 10874,
        fee: 0,
        status: created,
        type: utility,
        created: 2020-04-24T13:05:53+00:00,
        updated: 2020-04-24T13:05:53+00:00
    )
)
  

Elixir

%StarkBank.UtilityPayment.Log{
    id: "5369811349536768",
    created: ~U[2020-04-24 18:20:15.331313Z],
    errors: [],
    type: "created",
    payment: %starkbank.utilitypayment{
        amount: 10874,
        bar_code: "83640000001075401380076105302611108067159411",
        created: ~U[2020-04-24 18:20:15.232053Z],
        description: "Electricity for the Long Night",
        fee: 0,
        id: "5949004768608256",
        line: "83640000001 1 07540138007 0 61053026111 0 08067159411 9",
        scheduled: ~U[2020-04-25 15:00:00Z],
        status: "created",
        type: "utility",
        tags: ["energy", "winterfell"],
        transaction_ids: [],
        updated: ~U[2020-04-24 18:20:15.232053Z],
    }
}
  

C#

Log(
    ID: 5369811349536768,
    Created: 04/24/2020 18:20:39,
    Type: created,
    Errors: {  },
    Payment: UtilityPayment(
        Amount: 10874,
        Description: electricity payment,
        Line: 83640000001 1 07540138007 0 61053026111 0 08067159411 9,
        BarCode: 83640000001075401380076105302611108067159411,
        Scheduled: 04/25/2020 12:00:00,
        Tags: { energy winterfell },
        TransactionIds: {  },
        Status: created,
        Fee: 0,
        Type: utility,
        Created: 04/24/2020 17:46:39,
        ID: 5949004768608256,
        Updated: 04/24/2020 17:46:39
    )
)
  

Go

{
    Id:5369811349536768 
    Payment:{
        Id:5949004768608256 
        Line:83640000001 1 07540138007 0 61053026111 0 08067159411 9 
        BarCode:83640000001075401380076105302611108067159411 
        Description:Electricity for the Long Night 
        Scheduled:2020-04-25 15:00:00.000000 +0000 +0000 
        Tags:[energy winterfell] 
        TransactionIds:[] 
        Status:created 
        Type:utility 
        Amount:10874 
        Fee:0 
        TransactionIds:[5733517593935872 6057392487792640] 
        Created:2020-04-24 13:05:53.00000 +0000 +0000
        Updated:2020-04-24 13:05:53.00000 +0000 +0000
    } 
    Errors:[] 
    Type:created 
    Created:2020-04-24 17:51:54.284559 +0000 +0000
}
  

Clojure

{:id "5369811349536768",
:created "2020-04-24T13:30:07.200512+00:00",
:errors [],
:type "created",
:payment
{:description "Electricity for the Long Night",
    :amount 10874,
    :fee 0,
    :tags ["energy" "winterfell"],
    :created "2020-04-24T19:04:46.594557+00:00",
    :line "83640000001 1 07540138007 0 61053026111 0 08067159411 9",
    :status "created",
    :id "5949004768608256",
    :scheduled "2020-04-25T15:00:00+00:00",
    :bar-code "83640000001075401380076105302611108067159411",
    :updated "2020-04-24T19:04:46.594557+00:00"}}
  

Curl

{
    "cursor": null,
    "logs": [
        {
            "id": "5369811349536768",
            "created": "2020-04-24T23:00:08.338233+00:00",
            "errors": [],
            "type": "created",
            "payment": {
                "id": "5949004768608256",
                "status": "created",
                "fee": 0,
                "amount": 10874,
                "description": "Electricity for the Long Night",
                "scheduled": "2020-04-25T15:22:24.957735+00:00",
                "created": "2020-04-24T15:22:25.096450+00:00",
                "barCode": "83640000001075401380076105302611108067159411",
                "line": "83640000001 1 07540138007 0 61053026111 0 08067159411 9",
                "tags": ["Energy", "Winterfell"],
                "transactionIds": [],
                "status": "created",
                "type": "utility",
                "updated": "2020-04-24T15:22:25.096450+00:00",
            }   
        }
    ]
}
  

Get a Utility Payment Log

Get a single utility payment log by its id.

Parameters

id REQUIRED

Id of the log entity

fields OPTIONAL

List of strings to filter response JSON keys. Not available in the SDKs.

ENDPOINT
GET /v2/utility-payment/log/:id
REQUEST

Python

import starkbank

log = starkbank.utilitypayment.log.get("5369811349536768")

print(log)
  

Javascript

const starkbank = require('starkbank');

(async() => {
    let log = await starkbank.utilityPayment.log.get('5369811349536768');
    console.log(log);
})();
  

PHP

  $log = StarkBank\UtilityPayment\Log::get("5369811349536768");

  print_r($log);
  

Java

import com.starkbank.*;

UtilityPayment.Log log = UtilityPayment.Log.get("5369811349536768");

System.out.println(log);
  

Ruby

require('starkbank')

log = StarkBank::UtilityPayment::Log.get('5369811349536768')

puts log
  

Elixir

log = StarkBank.UtilityPayment.Log.get!("5369811349536768")

log |> IO.inspect
  

C#

using System;

StarkBank.UtilityPayment.Log log = StarkBank.UtilityPayment.Log.Get("5369811349536768");

Console.WriteLine(log);
  

Go

package main

import (
    "fmt"
    "github.com/starkbank/sdk-go/starkbank/utilitypayment/log"
)

func main() {

    log, err := log.Get("5369811349536768", nil)
    if err.Errors != nil {
        for _, e := range err.Errors {
            fmt.Printf("code: %s, message: %s", e.Code, e.Message)
        }
    }

    fmt.Printf("%+v", log)
}
  

Clojure

(def log (starkbank.utility-payment.log/get "5369811349536768"))
(println log)
  

Curl

curl --location --request GET '{{baseUrl}}/v2/utility-payment/log/5369811349536768' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}'
  
RESPONSE

Python

  Log(
    id=5369811349536768,
    created=2020-04-24 18:03:18.733424,
    errors=[],
    type=created,
    payment=UtilityPayment(
        amount=10874,
        bar_code=83640000001087401380076105302611108067159411,
        created=2020-04-24 18:03:18.662638,
        description=Electricity for the Long Night,
        fee=0,
        id=5949004768608256,
        line=83640000001 1 08740138007 0 61053026111 0 08067159411 9,
        scheduled=2020-04-25 15:00:00,
        status=created,
        tags=['energy', 'winterfell'],
        transaction_ids=[],
        type=utility,
        updated=2020-04-24 18:03:18.662638,
    )
)
  

Javascript

Log {
    id: '5369811349536768',
    created: '2020-04-24T01:43:13.136987+00:00',
    type: 'created',
    errors: [],
    payment: {
        id: '5949004768608256',
        barCode: '83640000001078501380076105302611108067159411',
        line: '83640000001 1 07850138007 0 61053026111 0 08067159411 9',
        description: 'Electricity for the Long Night',
        scheduled: '2020-04-25T15:00:00+00:00',
        tags: [ 'energy', 'winterfell' ],
        transactionIds: [ ],
        amount: 10874,
        status: 'created',
        type: 'utility',
        created: '2020-04-24T01:43:13.038706+00:00',
        fee: 0,
        updated: '2020-04-24T01:43:13.038706+00:00',
    }
}
  

PHP

StarkBank\UtilityPayment\Log Object
(
    [id] => 5369811349536768
    [created] => DateTime Object
        (
            [date] => 2020-04-24 19:04:46.689468
            [timezone_type] => 1
            [timezone] => +00:00
        )

    [type] => created
    [errors] => Array
        (
        )

    [payment] => StarkBank\UtilityPayment Object
        (
            [id] => 5949004768608256
            [line] => 83640000001 1 07540138007 0 61053026111 0 08067159411 9
            [barCode] => 83640000001075401380076105302611108067159411
            [description] => Electricity for the Long Night
            [tags] => Array
                (
                    [0] => energy
                    [1] => winterfell
                )

            [transactionIds] => Array
                (
                )

            [scheduled] => DateTime Object
                (
                    [date] => 2020-04-25T15:00:00+00:00
                    [timezone_type] => 1
                    [timezone] => +00:00
                )

            [status] => created
            [type] => utility
            [amount] => 10874
            [fee] => 0
            [created] => DateTime Object
                (
                    [date] => 2020-04-24 19:04:46.594557
                    [timezone_type] => 1
                    [timezone] => +00:00
                )

            [updated] => DateTime Object
                (
                    [date] => 2020-04-24 19:04:46.594557
                    [timezone_type] => 1
                    [timezone] => +00:00
                )

        )

)
  

Java

Log({
  "id": "5369811349536768",
  "created": "2020-04-24T13:05:53+00:00",
  "type": "created",
  "errors": [],
  "payment": {
      "id": "5949004768608256",
      "description": "Electricity for the Long Night",
      "line": "83640000001 1 07540138007 0 61053026111 0 08067159411 9",
      "barCode": "83640000001075401380076105302611108067159411",
      "tags": ["energy", "winterfell"],
      "transactionIds": [],
      "scheduled": "2020-04-20T15:00:00+00:00",
      "amount": 10874,
      "fee": 0,
      "status": "canceled",
      "type": "utility",
      "created": "2020-04-13T13:05:53+00:00",
      "updated": "2020-04-13T13:05:53+00:00"
  }
})
  

Ruby

log(
  id: 5369811349536768,
  created: 2020-04-24T13:05:53+00:00,
  type: created,
  errors: [],
  payment: utilitypayment(
      id: 5949004768608256,
      description: Electricity for the Long Night,
      line: 83640000001 1 07540138007 0 61053026111 0 08067159411 9,
      bar_code: 83640000001075401380076105302611108067159411,
      tags: ["energy", "winterfell"],
      transaction_ids: [],
      scheduled: 2020-04-20T15:00:00+00:00,
      amount: 10874,
      fee: 0,
      status: created,
      type: utility,
      created: 2020-04-24T13:05:53+00:00,
      updated: 2020-04-24T13:05:53+00:00
  )
)
  

Elixir

%StarkBank.UtilityPayment.Log{
  id: "5369811349536768",
  created: ~U[2020-04-24 18:20:15.331313Z],
  errors: [],
  type: "created",
  payment: %starkbank.utilitypayment{
      amount: 10874,
      bar_code: "83640000001075401380076105302611108067159411",
      created: ~U[2020-04-24 18:20:15.232053Z],
      description: "Electricity for the Long Night",
      fee: 0,
      id: "5949004768608256",
      line: "83640000001 1 07540138007 0 61053026111 0 08067159411 9",
      scheduled: ~U[2020-04-25 15:00:00Z],
      status: "created",
      type: "utility",
      tags: ["energy", "winterfell"],
      transaction_ids: [],
      updated: ~U[2020-04-24 18:20:15.232053Z],
  }
}
  

C#

Log(
  ID: 5369811349536768,
  Created: 04/24/2020 18:20:39,
  Type: created,
  Errors: {  },
  Payment: UtilityPayment(
      Amount: 10874,
      Description: electricity payment,
      Line: 83640000001 1 07540138007 0 61053026111 0 08067159411 9,
      BarCode: 83640000001075401380076105302611108067159411,
      Scheduled: 04/25/2020 12:00:00,
      Tags: { energy winterfell },
      TransactionIds: {  },
      Status: created,
      Fee: 0,
      Type: utility,
      Created: 04/24/2020 17:46:39,
      ID: 5949004768608256,
      Updated: 04/24/2020 17:46:39
  )
)
  

Go

{
  Id:5369811349536768 
  Payment:{
      Id:5949004768608256 
      Line:83640000001 1 07540138007 0 61053026111 0 08067159411 9 
      BarCode:83640000001075401380076105302611108067159411 
      Description:Electricity for the Long Night 
      Scheduled:2020-04-25 15:00:00.000000 +0000 +0000 
      Tags:[energy winterfell] 
      TransactionIds:[] 
      Status:created 
      Type:utility 
      Amount:10874 
      Fee:0 
      TransactionIds:[5733517593935872 6057392487792640] 
      Created:2020-04-24 13:05:53.00000 +0000 +0000
      Updated:2020-04-24 13:05:53.00000 +0000 +0000
  } 
  Errors:[] 
  Type:created 
  Created:2020-04-24 17:51:54.284559 +0000 +0000
}
  

Clojure

{:id "5369811349536768",
:created "2020-04-24T13:30:07.200512+00:00",
:errors [],
:type "created",
:payment
{:description "Electricity for the Long Night",
  :amount 10874,
  :fee 0,
  :tags ["energy" "winterfell"],
  :created "2020-04-24T19:04:46.594557+00:00",
  :line "83640000001 1 07540138007 0 61053026111 0 08067159411 9",
  :status "created",
  :id "5949004768608256",
  :scheduled "2020-04-25T15:00:00+00:00",
  :bar-code "83640000001075401380076105302611108067159411",
  :updated "2020-04-24T19:04:46.594557+00:00"}}
  

Curl

{
  "log": {
      "id": "5369811349536768",
      "created": "2020-04-24T23:00:08.338233+00:00",
      "errors": [],
      "type": "created",
      "payment": {
          "id": "5949004768608256",
          "status": "created",
          "fee": 0,
          "amount": 10874,
          "description": "Electricity for the Long Night",
          "scheduled": "2020-04-25T15:22:24.957735+00:00",
          "created": "2020-04-24T15:22:25.096450+00:00",
          "barCode": "83640000001075401380076105302611108067159411",
          "line": "83640000001 1 07540138007 0 61053026111 0 08067159411 9",
          "tags": ["Energy", "Winterfell"],
          "transactionIds": [],
          "status": "created",
          "type": "utility",
          "updated": "2020-04-24T15:22:25.096450+00:00",
      }   
  }
}
  

Payment Status

Each payment has a status that can change over time according to its life cycle: payment-status

Payment Log

Every time we modify a tax payment, we create a log. Logs are pretty useful for understanding the life cycle of each payment and the changes that happened to it. Here is the possible event flow: payment-log

The Tax Payment object

Attributes

id STRING

Unique id for the tax payment.

amount INTEGER

Payment amount in cents.

barCode STRING

Bar code number that describes the payment.

created STRING

Creation datetime. Example: "2020-04-23T23:00:00.000000+00:00".

description STRING

Text displayed in the bank statement.

fee INTEGER

Fee charged in cents.

line STRING

Number sequence that describes the payment.

scheduled STRING

Scheduled payment date. Example: "2020-04-23".

status STRING

Current payment status. Options: "created", "processing", "confirmed", "success", "failed", "canceled".

tags LIST OF STRINGS

Tags associated with the tax payment.

transactionIds LIST OF STRINGS

Ledger transaction IDs linked to the payment.

type STRING

Type of the tax payment.

updated STRING

Last update datetime. Example: "2020-04-23T23:00:00.000000+00:00".

Create Tax Payments

Use this route to pay taxes using the available balance in your Stark Bank account.

Parameters

description REQUIRED

Text to be displayed in your statement. Min length = 10.

barCode CONDITIONALLY REQUIRED

Bar code number that describes the payment. Either "line" or "barCode" parameters are required. If both are sent, they must match.

line CONDITIONALLY REQUIRED

Number sequence that describes the payment. Either "line" or "barCode" parameters are required. If both are sent, they must match.

scheduled OPTIONAL

Schedule the payment for a specific date. Default value is the current day.

tags OPTIONAL

Array of strings to tag the entity for future queries. All tags will be converted to lowercase.

ENDPOINT
POST /v2/tax-payment
REQUEST

Python

import starkbank

payments = starkbank.taxpayment.create([
    starkbank.TaxPayment(
        bar_code="81660000005003657010074119002551100010601813",
        scheduled="2023-08-02",
        description="fix the road",
        tags=["take", "my", "money"],
    )
])

for payment in payments:
    print(payment)
  

Javascript

const starkbank = require('starkbank');

(async() => {
    let payments = await starkbank.taxPayment.create([
        {
            barCode: '81660000005003657010074119002551100010601813',
            scheduled: '2023-08-02',
            description: 'fix the road',
            tags: ['take', 'my', 'money'],
        },
    ]);

    for await (let payment of payments) {
        console.log(payment);
    }
})();
  

PHP

use StarkBank\TaxPayment;

$payments = TaxPayment::create([
    new TaxPayment([
        "barCode" => "81660000005003657010074119002551100010601813",
        "description" => "fix the road",
        "tags" => ["take", "my", "money"],
        "scheduled" => "2023-08-02"
    ])
]);

foreach($payments as $payment){
    print_r($payment);
}
  

Java

import com.starkbank.*;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

List<TaxPayment> payments = new ArrayList<>();

HashMap<String, Object> data = new HashMap<>();
data.put("barCode", "81660000005003657010074119002551100010601813");
data.put("description", "fix the road");
data.put("tags", new String[]{"take", "my", "money"});
data.put("scheduled", "2023-08-02");

payments.add(new TaxPayment(data));

payments = TaxPayment.create(payments);

for (TaxPayment payment : payments) {
    System.out.println(payment);
}
  

Ruby

require('starkbank')

payments = StarkBank::TaxPayment.create(
    [
        StarkBank::TaxPayment.new(
            bar_code: '81660000005003657010074119002551100010601813',
            description: 'fix the road',
            tags: ['take', 'my', 'money'],
            scheduled: '2023-08-02'
        )
    ]
)

payments.each do |payment|
    puts payment
end
  

Elixir

payments = StarkBank.TaxPayment.create!(
    [
        %StarkBank.TaxPayment{
            bar_code: "81660000005003657010074119002551100010601813",
            description: "fix the road",
            tags: ["take", "my", "money"],
            scheduled: "2023-08-02"
        }
    ]
) |> IO.inspect
  

C#

using System;
using System.Collections.Generic;

List<StarkBank.TaxPayment> payments = StarkBank.TaxPayment.Create(
    new List<StarkBank.TaxPayment>() { 
        new StarkBank.TaxPayment(
            barCode: "81660000005003657010074119002551100010601813",
            description: "fix the road",
            tags: new List<string> { "take", "my", "money" },
            scheduled: "2023-08-02"
        )
    }
);

foreach (StarkBank.TaxPayment payment in payments)
{
    Console.WriteLine(payment);
}
  

Go

package main

import (
    "fmt"
    "github.com/starkbank/sdk-go/starkbank/taxpayment"
)

func main() {

    scheduled := time.Date(2023, 8, 2, 0, 0, 0, 0, time.UTC),    

    payments, err := taxpayment.Create(
        []taxpayment.TaxPayment{
            {
                BarCode:     "81660000005003657010074119002551100010601813",
                Description: "fix the road",
                Tags:        []string{"take", "my", "money"},
                Scheduled:   &scheduled,
            },
        }, nil)
    if err.Errors != nil {
        for _, e := range err.Errors {
            fmt.Printf("code: %s, message: %s", e.Code, e.Message)
        }
    }

    for _, payment := range payments {
        fmt.Printf("%+v", payment)
    }
}
  

Clojure

(def payments
(starkbank.tax-payment/create
    [
        {
            :bar-code "81660000005003657010074119002551100010601813"
            :scheduled "2023-08-02"
            :description "fix the road"
            :tags ["take" "my" "money"]
        }
    ]
))

(println payments)
  

Curl

curl --location --request POST '{{baseUrl}}/v2/tax-payment' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}' 
--header 'Content-Type: application/json' 
--data-raw '{
    "payments": [
        {
            "barCode": "81660000005003657010074119002551100010601813",
            "tags": ["take" "my" "money"],
            "description": "fix the road",
            "scheduled": "2023-08-02"
        }
    ]
}'
  
RESPONSE

Python

TaxPayment(
    amount=50036,
    bar_code=81660000005003657010074119002551100010601813,
    created=2023-01-24 18:03:18.662638,
    description=fix the road,
    fee=0,
    id=5186070702456832,
    line=81660000005 2 00365701007 4 41190025511 7 00010601813 8,
    scheduled=2023-08-02 11:00:00.000000,
    status=created,
    tags=["take", "my", "money"],
    transaction_ids=[],
    type=iss,
    updated=2023-01-24 18:03:18.000000
)
  

Javascript

TaxPayment {
    amount: 50036,
    barCode: '81660000005003657010074119002551100010601813',
    created: '2023-01-24T18:03:18.662638+00:00',
    description: 'fix the road',
    fee: 0,
    id: '5186070702456832',
    line: '81660000005 2 00365701007 4 41190025511 7 00010601813 8',
    scheduled: '2023-08-02T11:00:00.000000+00:00',
    status: 'created',
    tags: [ 'take', 'my', 'money' ],
    transactionIds: [],
    type: 'iss',
    updated: '2023-01-24T18:03:18.662638+00:00'
}
  

PHP

StarkBank\TaxPayment Object
(
    [amount] => 50036,
    [barCode] => 81660000005003657010074119002551100010601813,
    [created] => DateTime Object
    (
        [date] => 2023-01-24 18:03:18.662638
        [timezone_type] => 1
        [timezone] => +00:00
    )

    [description] => fix the road,
    [fee] => 0,
    [id] => 5186070702456832,
    [line] => 81660000005 2 00365701007 4 41190025511 7 00010601813 8,
    [scheduled] => DateTime Object
        (
            [date] => 2023-08-02 11:00:00.000000
            [timezone_type] => 1
            [timezone] => +00:00
        )

    [status] => created,
    [tags] => Array
        (
            [0] => take
            [1] => my
            [2] => money
        )

    [transaction_ids] => Array
        (
        )

    [type] => iss,
    [updated] => DateTime Object
    (
        [date] => 2023-01-24 18:03:18.662638
        [timezone_type] => 1
        [timezone] => +00:00
    )

)
  

Java

TaxPayment({
    "amount": 50036,
    "barCode": "81660000005003657010074119002551100010601813",
    "created": "2023-01-24T18:03:18.662638+00:00",
    "description": "fix the road",
    "fee": 0,
    "id": "5186070702456832",
    "line": "81660000005 2 00365701007 4 41190025511 7 00010601813 8",
    "scheduled": "2023-08-02T11:00:00.000000+00:00",
    "status": "created",
    "tags": [ "take", "my", "money" ],
    "transactionIds": [],
    "type": "iss",
    "updated": "2023-01-24T18:03:18.662638+00:00"
})
  

Ruby

taxpayment(
    amount: 50036,
    bar_code: 81660000005003657010074119002551100010601813,
    created: 2023-01-24T18:03:18.662638+00:00,
    description: fix the road,
    fee: 0,
    id: 5186070702456832,
    line: 81660000005 2 00365701007 4 41190025511 7 00010601813 8,
    scheduled: 2023-08-02T11:00:00.000000+00:00,
    status: created,
    tags: ["take", "my", "money"],
    transaction_ids: [],
    type: iss,
    updated: 2023-01-24T18:03:18.662638+00:00
)
  

Elixir

%StarkBank.TaxPayment{
    description: "fix the road",
    scheduled: ~U[2023-08-02 11:00:00.000000Z],
    line: "81660000005 2 00365701007 4 41190025511 7 00010601813 8",
    bar_code: "81660000005003657010074119002551100010601813",
    tags: ["take", "my", "money"],
    transaction_ids: [],
    amount: 50036,
    status: "created",
    type: "iss",
    updated: ~U[2023-01-30 18:26:20.785439Z],
    created: ~U[2023-01-30 18:26:20.785430Z],
    fee: 0,
    id: "5096686175125504"
}
  

C#

TaxPayment(
    Amount: 50036,
    BarCode: 81660000005003657010074119002551100010601813,
    Created: 01/24/2023 18:03:18,
    Description: fix the road,
    Fee: 0,
    ID: 5186070702456832,
    Line: 81660000005 2 00365701007 4 41190025511 7 00010601813 8,
    Scheduled: 08/02/2023 11:00:00,
    Status: created,
    Tags: { "take", "my", "money" },
    TransactionIds: {  },
    Type: iss,
    Updated: 01/24/2023 18:03:18
)
  

Go

{
    Id:5186070702456832 
    Line:81660000005 2 00365701007 4 41190025511 7 00010601813 8 
    BarCode:81660000005003657010074119002551100010601813 
    Description:fix the road 
    Scheduled:2023-08-02 18:18:12.955754 +0000 +0000 
    Tags:[take my money] 
    Status:created 
    Amount:50036 
    Fee:0 
    Type:iss 
    TransactionIds:[] 
    Updated:2023-01-24 11:16:31.994675 +0000 +0000 
    Created:2021-01-24 17:18:12.974157 +0000 +0000
}
  

Clojure

{
    :amount: 50036,
    :bar-code: "81660000005003657010074119002551100010601813",
    :created: "2023-01-24T18:03:18.662638+00:00",
    :description: "fix the road",
    :fee: 0,
    :id: "5186070702456832",
    :line: "81660000005 2 00365701007 4 41190025511 7 00010601813 8",
    :scheduled: "2023-08-02T11:00:00.000000+00:00",
    :status: "created",
    :tags: [ "take", "my", "money" ],
    :transaction-ids: [],
    :type: "iss",
    :updated: "2023-01-24T18:03:18.662638+00:00"
}
  

Curl

{
    "message": "Tax Payment(s) successfully created",
    "payments": [
        {
            "amount": 50036,
            "barCode": "81660000005003657010074119002551100010601813",
            "created": "2023-01-24T18:03:18.662638+00:00",
            "description": "fix the road",
            "fee": 0,
            "id": "5186070702456832",
            "line": "81660000005 2 00365701007 4 41190025511 7 00010601813 8",
            "scheduled": "2023-08-02T11:00:00.000000+00:00",
            "status": "created",
            "tags": ["take", "my", "money"],
            "transactionIds": [],
            "type": "iss",
            "updated": "2023-01-24T18:03:18.662638+00:00"
        }
    ]
}
  

List Tax Payments

Get a list of non-deleted tax payments in chunks of at most 100. If you need smaller chunks, use the limit parameter.

Parameters

after OPTIONAL

Filter entities created after this date.

before OPTIONAL

Filter entities created before this date.

cursor OPTIONAL

String used to get the next batch of results. Our SDKs handle this for you.

fields OPTIONAL

List of strings to filter response JSON keys. Not available in the SDKs.

ids OPTIONAL

List of strings to get specific entities by ids.

limit OPTIONAL

Number of results per cursor. Max = 100.

status OPTIONAL

Filter tax payments by the specified status.

tags OPTIONAL

Filter entities that contain the specified tags.

ENDPOINT
GET /v2/tax-payment
REQUEST

Python

import starkbank

payments = starkbank.taxpayment.query(
    after="2023-01-01",
    before="2023-01-30"
)

for payment in payments:
    print(payment)
  

Javascript

const starkbank = require('starkbank');

(async() => {
    let payments = await starkbank.taxPayment.query({
        after: '2023-01-01',
        before: '2023-01-30'
    });

    for await (let payment of payments) {
        console.log(payment);
    }
})();
  

PHP

use StarkBank\TaxPayment;

$payments = StarkBank\TaxPayment::query([
    "after" => "2023-01-01",
    "before" => "2023-01-30"
]);

foreach($payments as $payment){
    print_r($payment);
}
  

Java

import com.starkbank.*;
import com.starkbank.utils.Generator;
import java.util.HashMap;

HashMap<String, Object> params = new HashMap<>();
params.put("after", "2023-01-01");
params.put("before", "2023-01-30");
Generator<TaxPayment> payments = TaxPayment.query(params);

for (TaxPayment payment : payments){
    System.out.println(payment);
}
  

Ruby

require('starkbank')

payments = StarkBank::TaxPayment.query(
    after: '2023-01-01',
    before: '2023-01-30'
)

payments.each do |payment|
    puts payment
end
  

Elixir

payments = StarkBank.TaxPayment.query!(
    after: "2023-01-01",
    before: "2023-01-30"
)

for payment <- payments do
  payment |> IO.inspect
end
  

C#

using System;
using System.Collections.Generic;

IEnumerable<StarkBank.TaxPayment> payments = StarkBank.TaxPayment.Query(
    after: new DateTime(2023, 1, 1),
    before: new DateTime(2023, 1, 30)
);

foreach(StarkBank.TaxPayment payment in payments)
{
    Console.WriteLine(payment);
}
  

Go

package main

import (
    "fmt"
    "time"
    "github.com/starkbank/sdk-go/starkbank/taxpayment"
)

func main() {

    var params = map[string]interface{}{}
    params["after"] = time.Date(2021, 1, 1, 0, 0, 0, 0, time.UTC)
    params["before"] = time.Date(2023, 1, 30, 0, 0, 0, 0, time.UTC)
    
    payments, errorChannel := taxpayment.Query(params, nil)

    loop:
    for {
        select {
        case err := <-errorChannel:
            if err.Errors != nil {
                for _, e := range err.Errors {
                    fmt.Printf("code: %s, message: %s", e.Code, e.Message)
                }
            }
        case payment, ok := <-payments:
            if !ok {
                break loop
            }
            fmt.Printf("%+v", payment)
        }
    }
}
  

Clojure

(def payments
  (starkbank.tax-payment/query
    {
      :after "2023-01-01"
      :before "2023-01-30"
    }))
(dorun (map println payments))
  

Curl

curl --location --request GET '{{baseUrl}}/v2/tax-payment?after=2023-01-01&before=2023-01-30' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}'
  
RESPONSE

Python

TaxPayment(
    amount=50036,
    bar_code=81660000005003657010074119002551100010601813,
    created=2023-01-24 18:03:18.662638,
    description=fix the road,
    fee=0,
    id=5186070702456832,
    line=81660000005 2 00365701007 4 41190025511 7 00010601813 8,
    scheduled=2023-08-02 11:00:00.000000,
    status=created,
    tags=["take", "my", "money"],
    transaction_ids=[],
    type=iss,
    updated=2023-01-24 18:03:18.000000
)
  

Javascript

TaxPayment {
    amount: 50036,
    barCode: '81660000005003657010074119002551100010601813',
    created: '2023-01-24T18:03:18.662638+00:00',
    description: 'fix the road',
    fee: 0,
    id: '5186070702456832',
    line: '81660000005 2 00365701007 4 41190025511 7 00010601813 8',
    scheduled: '2023-08-02T11:00:00.000000+00:00',
    status: 'created',
    tags: [ 'take', 'my', 'money' ],
    transactionIds: [],
    type: 'iss',
    updated: '2023-01-24T18:03:18.662638+00:00'
}
  

PHP

StarkBank\TaxPayment Object
(
    [amount] => 50036,
    [barCode] => 81660000005003657010074119002551100010601813,
    [created] => DateTime Object
    (
        [date] => 2023-01-24 18:03:18.662638
        [timezone_type] => 1
        [timezone] => +00:00
    )

    [description] => fix the road,
    [fee] => 0,
    [id] => 5186070702456832,
    [line] => 81660000005 2 00365701007 4 41190025511 7 00010601813 8,
    [scheduled] => DateTime Object
        (
            [date] => 2023-08-02 11:00:00.000000
            [timezone_type] => 1
            [timezone] => +00:00
        )

    [status] => created,
    [tags] => Array
        (
            [0] => take
            [1] => my
            [2] => money
        )

    [transaction_ids] => Array
        (
        )

    [type] => iss,
    [updated] => DateTime Object
    (
        [date] => 2023-01-24 18:03:18.662638
        [timezone_type] => 1
        [timezone] => +00:00
    )

)
  

Java

TaxPayment({
    "amount": 50036,
    "barCode": "81660000005003657010074119002551100010601813",
    "created": "2023-01-24T18:03:18.662638+00:00",
    "description": "fix the road",
    "fee": 0,
    "id": "5186070702456832",
    "line": "81660000005 2 00365701007 4 41190025511 7 00010601813 8",
    "scheduled": "2023-08-02T11:00:00.000000+00:00",
    "status": "created",
    "tags": [ "take", "my", "money" ],
    "transactionIds": [],
    "type": "iss",
    "updated": "2023-01-24T18:03:18.662638+00:00"
})
  

Ruby

taxpayment(
    amount: 50036,
    bar_code: 81660000005003657010074119002551100010601813,
    created: 2023-01-24T18:03:18.662638+00:00,
    description: fix the road,
    fee: 0,
    id: 5186070702456832,
    line: 81660000005 2 00365701007 4 41190025511 7 00010601813 8,
    scheduled: 2023-08-02T11:00:00.000000+00:00,
    status: created,
    tags: ["take", "my", "money"],
    transaction_ids: [],
    type: iss,
    updated: 2023-01-24T18:03:18.662638+00:00
)
  

Elixir

%StarkBank.TaxPayment{
    description: "fix the road",
    scheduled: ~U[2023-08-02 11:00:00.000000Z],
    line: "81660000005 2 00365701007 4 41190025511 7 00010601813 8",
    bar_code: "81660000005003657010074119002551100010601813",
    tags: ["take", "my", "money"],
    transaction_ids: [],
    amount: 50036,
    status: "created",
    type: "iss",
    updated: ~U[2023-01-30 18:26:20.785439Z],
    created: ~U[2023-01-30 18:26:20.785430Z],
    fee: 0,
    id: "5096686175125504"
}
  

C#

TaxPayment(
    Amount: 50036,
    BarCode: 81660000005003657010074119002551100010601813,
    Created: 01/24/2023 18:03:18,
    Description: fix the road,
    Fee: 0,
    ID: 5186070702456832,
    Line: 81660000005 2 00365701007 4 41190025511 7 00010601813 8,
    Scheduled: 08/02/2023 11:00:00,
    Status: created,
    Tags: { "take", "my", "money" },
    TransactionIds: {  },
    Type: iss,
    Updated: 01/24/2023 18:03:18
)
  

Go

{
    Id:5186070702456832 
    Line:81660000005 2 00365701007 4 41190025511 7 00010601813 8 
    BarCode:81660000005003657010074119002551100010601813 
    Description:fix the road 
    Scheduled:2023-08-02 18:18:12.955754 +0000 +0000 
    Tags:[take my money] 
    Status:created 
    Amount:50036 
    Fee:0 
    Type:iss 
    TransactionIds:[] 
    Updated:2023-01-24 11:16:31.994675 +0000 +0000 
    Created:2021-01-24 17:18:12.974157 +0000 +0000
}
  

Clojure

{
    :amount: 50036,
    :bar-code: "81660000005003657010074119002551100010601813",
    :created: "2023-01-24T18:03:18.662638+00:00",
    :description: "fix the road",
    :fee: 0,
    :id: "5186070702456832",
    :line: "81660000005 2 00365701007 4 41190025511 7 00010601813 8",
    :scheduled: "2023-08-02T11:00:00.000000+00:00",
    :status: "created",
    :tags: [ "take", "my", "money" ],
    :transaction-ids: [],
    :type: "iss",
    :updated: "2023-01-24T18:03:18.662638+00:00"
}
  

Curl

{
    "cursor": null,
    "payments": [
        {
            "amount": 50036,
            "barCode": "81660000005003657010074119002551100010601813",
            "created": "2023-01-24T18:03:18.662638+00:00",
            "description": "fix the road",
            "fee": 0,
            "id": "5186070702456832",
            "line": "81660000005 2 00365701007 4 41190025511 7 00010601813 8",
            "scheduled": "2023-08-02T11:00:00.000000+00:00",
            "status": "created",
            "tags": ["take", "my", "money"],
            "transactionIds": [],
            "type": "iss",
            "updated": "2023-01-24T18:03:18.662638+00:00"
        }
    ]
}
  

Get a Tax Payment

Get a single tax payment by its id.

Parameters

id REQUIRED

Id of the tax payment entity.

fields OPTIONAL

List of strings to filter response JSON keys. Not available in the SDKs.

ENDPOINT
GET /v2/tax-payment/:id
REQUEST

Python

import starkbank

payment = starkbank.taxpayment.get("5186070702456832")

print(payment)
  

Javascript

const starkbank = require('starkbank');

(async() => {
    let payment = await starkbank.taxPayment.get('5186070702456832');
    console.log(payment);
})();
  

PHP

use StarkBank\TaxPayment;

$payment = StarkBank\TaxPayment::get("5186070702456832");

print_r($payment);
  

Java

import com.starkbank.*;

TaxPayment payment = TaxPayment.get("5186070702456832");

System.out.println(payment);
  

Ruby

require('starkbank')

payment = StarkBank::TaxPayment.get('5186070702456832')

puts payment
  

Elixir

payment = StarkBank.TaxPayment.get!("5186070702456832")

payment |> IO.inspect
  

C#

using System;

StarkBank.TaxPayment payment = StarkBank.TaxPayment.Get("5186070702456832");

Console.WriteLine(payment);
  

Go

package main

import (
    "fmt"
    "github.com/starkbank/sdk-go/starkbank/taxpayment"
)

func main() {

    payment, err := taxpayment.Get("5186070702456832", nil)
    if err.Errors != nil {
        for _, e := range err.Errors {
            fmt.Printf("code: %s, message: %s", e.Code, e.Message)
        }
    }

    fmt.Printf("%+v", payment)
}
  

Clojure

(def payment (starkbank.tax-payment/get "5186070702456832"))
(println payment)
  

Curl

curl --location --request GET '{{baseUrl}}/v2/tax-payment/5186070702456832' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}'
  
RESPONSE

Python

TaxPayment(
    amount=50036,
    bar_code=81660000005003657010074119002551100010601813,
    created=2023-01-24 18:03:18.662638,
    description=fix the road,
    fee=0,
    id=5186070702456832,
    line=81660000005 2 00365701007 4 41190025511 7 00010601813 8,
    scheduled=2023-08-02 11:00:00,
    status=created,
    tags=["take", "my", "money"],
    transaction_ids=[],
    type=iss,
    updated=2023-01-24 18:03:18.662638
)
  

Javascript

TaxPayment {
    amount: 50036,
    barCode: '81660000005003657010074119002551100010601813',
    created: '2023-01-24T18:03:18.662638+00:00',
    description: 'fix the road',
    fee: 0,
    id: '5186070702456832',
    line: '81660000005 2 00365701007 4 41190025511 7 00010601813 8',
    scheduled: '2023-08-02T11:00:00.000000+00:00',
    status: 'created',
    tags: [ 'take', 'my', 'money' ],
    transactionIds: [],
    type: 'iss',
    updated: '2023-01-24T18:03:18.662638+00:00'
}
  

PHP

StarkBank\TaxPayment Object
(
    [amount] => 50036,
    [barCode] => 81660000005003657010074119002551100010601813,
    [created] => DateTime Object
    (
        [date] => 2023-01-24 18:03:18.662638
        [timezone_type] => 1
        [timezone] => +00:00
    )

    [description] => fix the road,
    [fee] => 0,
    [id] => 5186070702456832,
    [line] => 81660000005 2 00365701007 4 41190025511 7 00010601813 8,
    [scheduled] => DateTime Object
        (
            [date] => 2023-08-02 11:00:00.000000
            [timezone_type] => 1
            [timezone] => +00:00
        )

    [status] => created,
    [tags] => Array
        (
            [0] => take
            [1] => my
            [2] => money
        )

    [transaction_ids] => Array
        (   
        )

    [type] => iss,
    [updated] => DateTime Object
    (
        [date] => 2023-01-24 18:03:18.662638
        [timezone_type] => 1
        [timezone] => +00:00
    )

)
  

Java

TaxPayment({
    "amount": 50036,
    "barCode": "81660000005003657010074119002551100010601813",
    "created": "2023-01-24T18:03:18.662638+00:00",
    "description": "fix the road",
    "fee": 0,
    "id": "5186070702456832",
    "line": "81660000005 2 00365701007 4 41190025511 7 00010601813 8",
    "scheduled": "2023-08-02T11:00:00.000000+00:00",
    "status": "created",
    "tags": [ "take", "my", "money" ],
    "transactionIds": [],
    "type": "iss",
    "updated": "2023-01-24T18:03:18.662638+00:00"
})
  

Ruby

taxpayment(
    amount: 50036,
    bar_code: 81660000005003657010074119002551100010601813,
    created: 2023-01-24T18:03:18.662638+00:00,
    description: fix the road,
    fee: 0,
    id: 5186070702456832,
    line: 81660000005 2 00365701007 4 41190025511 7 00010601813 8,
    scheduled: 2023-08-02T11:00:00.000000+00:00,
    status: created,
    tags: ["take", "my", "money"],
    transaction_ids: [],
    type: iss,
    updated: 2023-01-24T18:03:18.662638+00:00
)
  

Elixir

%StarkBank.TaxPayment{
    amount: 50036,
    bar_code: "81660000005003657010074119002551100010601813",
    created: ~U[2023-01-24 18:03:18.662638Z],
    description: "fix the road",
    fee: 0,
    id: "5186070702456832",
    line: "81660000005 2 00365701007 4 41190025511 7 00010601813 8",
    scheduled: ~U[2023-08-02 11:00:00.000000Z],
    status: "created",
    tags: ["take", "my", "money"],
    transaction_ids: [],
    type: "iss",
    updated: ~U[2023-01-24T18:03:18.662638Z]
}
  

C#

TaxPayment(
    Amount: 50036,
    BarCode: 81660000005003657010074119002551100010601813,
    Created: 01/24/2023 18:03:18,
    Description: fix the road,
    Fee: 0,
    ID: 5186070702456832,
    Line: 81660000005 2 00365701007 4 41190025511 7 00010601813 8,
    Scheduled: 08/02/2023 11:00:00,
    Status: created,
    Tags: { "take", "my", "money" },
    TransactionIds: {  },
    Type: iss,
    Updated: 01/24/2023 18:03:18
)
  

Go

{
    Id:5186070702456832 
    Line:81660000005 2 00365701007 4 41190025511 7 00010601813 8 
    BarCode:81660000005003657010074119002551100010601813 
    Description:fix the road 
    Scheduled:2023-08-02 18:18:12.955754 +0000 +0000 
    Tags:[take my money] 
    Status:created 
    Amount:50036 
    Fee:0 
    Type:iss 
    TransactionIds:[] 
    Updated:2023-01-24 11:16:31.994675 +0000 +0000 
    Created:2021-01-24 17:18:12.974157 +0000 +0000
}
  

Clojure

{
    :amount: 50036,
    :bar-code: "81660000005003657010074119002551100010601813",
    :created: "2023-01-24T18:03:18.662638+00:00",
    :description: "fix the road",
    :fee: 0,
    :id: "5186070702456832",
    :line: "81660000005 2 00365701007 4 41190025511 7 00010601813 8",
    :scheduled: "2023-08-02T11:00:00.000000+00:00",
    :status: "created",
    :tags: [ "take", "my", "money" ],
    :transaction-ids: [],
    :type: "iss",
    :updated: "2023-01-24T18:03:18.662638+00:00"
}
  

Curl

{
    "payment": {
        "amount": 50036,
        "barCode": "81660000005003657010074119002551100010601813",
        "created": "2023-01-24T18:03:18.662638+00:00",
        "description": "fix the road",
        "fee": 0,
        "id": "5186070702456832",
        "line": "81660000005 2 00365701007 4 41190025511 7 00010601813 8",
        "scheduled": "2023-08-02T11:00:00.000000+00:00",
        "status": "created",
        "tags": ["take", "my", "money"],
        "transactionIds": [],
        "type": "iss",
        "updated": "2023-01-24T18:03:18.662638+00:00"
    }
}
  

Delete a Tax Payment

Cancel a scheduled tax payment. You can only cancel tax payments before they start being processed.

NOTE: Payments that have already been processed can be deleted, but not cancelled.

Parameters

id REQUIRED

Id of the tax payment entity.

ENDPOINT
DELETE /v2/tax-payment/:id
REQUEST

Python

import starkbank

payment = starkbank.taxpayment.delete("5186070702456832")

print(payment)
  

Javascript

const starkbank = require('starkbank');

(async() => {
    let payment = await starkbank.taxPayment.delete('5186070702456832');
    console.log(payment);
})();
  

PHP

StarkBank\TaxPayment;

$payment = StarkBank\TaxPayment::delete("5186070702456832");

print_r($payment);
  

Java

import com.starkbank.*;

TaxPayment payment = TaxPayment.delete("5186070702456832");

System.out.println(payment);
  

Ruby

require('starkbank')

payment = StarkBank::TaxPayment.delete('5186070702456832')

puts payment
  

Elixir

payment = StarkBank.TaxPayment.delete!("5186070702456832")

payment |> IO.inspect
  

C#

using System;

StarkBank.TaxPayment payment = StarkBank.TaxPayment.Delete("5186070702456832");

Console.WriteLine(payment);
  

Go

package main

import (
    "fmt"
    "github.com/starkbank/sdk-go/starkbank/boletopayment"
)

func main() {

    payment, err := boletopayment.Delete("5186070702456832", nil)
    if err.Errors != nil {
        for _, e := range err.Errors {
            fmt.Printf("code: %s, message: %s", e.Code, e.Message)
        }
    }

    fmt.Printf("%+v", payment)
}
  

Clojure

(def payment (starkbank.tax-payment/delete "5186070702456832"))
(println payment)
  

Curl

curl --location --request DELETE '{{baseUrl}}/v2/tax-payment/5186070702456832' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}'
  
RESPONSE

Python

TaxPayment(
    amount=50036,
    bar_code=81660000005003657010074119002551100010601813,
    created=2023-01-24 18:03:18.662638,
    description=fix the road,
    fee=0,
    id=5186070702456832,
    line=81660000005 2 00365701007 4 41190025511 7 00010601813 8,
    scheduled=2023-08-02 11:00:00.000000,
    status=canceled,
    tags=["take", "my", "money"],
    transaction_ids=[],
    type=iss,
    updated=2023-01-26 14:44:22.522334
)
  

Javascript

TaxPayment {
    amount: 50036,
    barCode: '81660000005003657010074119002551100010601813',
    created: '2023-01-24T18:03:18.662638+00:00',
    description: 'fix the road',
    fee: 0,
    id: '5186070702456832',
    line: '81660000005 2 00365701007 4 41190025511 7 00010601813 8',
    scheduled: '2023-08-02T11:00:00.000000+00:00',
    status: 'canceled',
    tags: [ 'take', 'my', 'money' ],
    transactionIds: [],
    type: 'iss',
    updated: '2023-01-26T14:44:22.522334+00:00'
}
  

PHP

StarkBank\TaxPayment Object
(
    [amount] => 50036,
    [barCode] => 81660000005003657010074119002551100010601813,
    [created] => DateTime Object
    (
        [date] => 2023-01-24 18:03:18.662638
        [timezone_type] => 1
        [timezone] => +00:00
    )

    [description] => fix the road,
    [fee] => 0,
    [id] => 5186070702456832,
    [line] => 81660000005 2 00365701007 4 41190025511 7 00010601813 8,
    [scheduled] => DateTime Object
        (
            [date] => 2023-08-02 11:00:00.000000
            [timezone_type] => 1
            [timezone] => +00:00
        )

    [status] => canceled,
    [tags] => Array
        (
            [0] => take
            [1] => my
            [2] => money
        )

    [transaction_ids] => Array
        (
        )

    [type] => iss,
    [updated] => DateTime Object
    (
        [date] => 2023-01-26 14:44:22.522334
        [timezone_type] => 1
        [timezone] => +00:00
    )

)
  

Java

TaxPayment({
    "amount": 50036,
    "barCode": "81660000005003657010074119002551100010601813",
    "created": "2023-01-24T18:03:18.662638+00:00",
    "description": "fix the road",
    "fee": 0,
    "id": "5186070702456832",
    "line": "81660000005 2 00365701007 4 41190025511 7 00010601813 8",
    "scheduled": "2023-08-02T11:00:00.000000+00:00",
    "status": "canceled",
    "tags": [ "take", "my", "money" ],
    "transactionIds": [],
    "type": "iss",
    "updated": "2023-01-26T14:44:22.522334+00:00"
})
  

Ruby

taxpayment(
    amount: 50036,
    bar_code: 81660000005003657010074119002551100010601813,
    created: 2023-01-24T18:03:18.662638+00:00,
    description: fix the road,
    fee: 0,
    id: 5186070702456832,
    line: 81660000005 2 00365701007 4 41190025511 7 00010601813 8,
    scheduled: 2023-08-02T11:00:00.000000+00:00,
    status: canceled,
    tags: ["take", "my", "money"],
    transaction_ids: [],
    type: iss,
    updated: 2023-01-26T14:44:22.522334+00:00
)
  

Elixir

%StarkBank.TaxPayment{
    amount: 50036,
    bar_code: "81660000005003657010074119002551100010601813",
    created: ~U[2023-01-24 18:03:18.662638Z],
    description: "fix the road",
    fee: 0,
    id: "5186070702456832",
    line: "81660000005 2 00365701007 4 41190025511 7 00010601813 8",
    scheduled: ~U[2023-08-02 11:00:00.000000Z],
    status: "canceled",
    tags: ["take", "my", "money"],
    transaction_ids: [],
    type: "iss",
    updated: ~U[2023-01-26T14:44:22.522334Z]
}
  

C#

TaxPayment(
    Amount: 50036,
    BarCode: 81660000005003657010074119002551100010601813,
    Created: 01/24/2023 18:03:18,
    Description: fix the road,
    Fee: 0,
    ID: 5186070702456832,
    Line: 81660000005 2 00365701007 4 41190025511 7 00010601813 8,
    Scheduled: 08/02/2023 11:00:00,
    Status: canceled,
    Tags: { "take", "my", "money" },
    TransactionIds: {  },
    Type: iss,
    Updated: 01/26/2023 14:44:22
)
  

Go

{
    Id:5186070702456832 
    Line:81660000005 2 00365701007 4 41190025511 7 00010601813 8 
    BarCode:81660000005003657010074119002551100010601813 
    Description:fix the road 
    Scheduled:2023-08-02 18:18:12.955754 +0000 +0000 
    Tags:[take my money] 
    Status:canceled 
    Amount:50036 
    Fee:0 
    Type:iss 
    TransactionIds:[] 
    Updated:2023-01-24 11:16:31.994675 +0000 +0000 
    Created:2021-01-24 17:18:12.974157 +0000 +0000
}
  

Clojure

{
    :amount: 50036,
    :bar-code: "81660000005003657010074119002551100010601813",
    :created: "2023-01-24T18:03:18.662638+00:00",
    :description: "fix the road",
    :fee: 0,
    :id: "5186070702456832",
    :line: "81660000005 2 00365701007 4 41190025511 7 00010601813 8",
    :scheduled: "2023-08-02T11:00:00.000000+00:00",
    :status: "canceled",
    :tags: [ "take", "my", "money" ],
    :transaction-ids: [],
    :type: "iss",
    :updated: "2023-01-26T14:44:22.522334+00:00"
}
  

Curl

{
    "message": "Tax Payment successfully deleted",
    "payment": {
        "amount": 50036,
        "barCode": "81660000005003657010074119002551100010601813",
        "created": "2023-01-24T18:03:18.662638+00:00",
        "description": "fix the road",
        "fee": 0,
        "id": "5186070702456832",
        "line": "81660000005 2 00365701007 4 41190025511 7 00010601813 8",
        "scheduled": "2023-08-02T11:00:00.000000+00:00",
        "status": "canceled",
        "tags": ["take", "my", "money"],
        "transactionIds": [],
        "type": "iss",
        "updated": "2023-01-26T14:44:22.522334+00:00"
    }
}
  

Get a Tax Payment PDF

Get a tax payment PDF receipt. You can only get a receipt for payments whose status are either success, processing or created.

Parameters

id REQUIRED

Id of the tax payment entity

ENDPOINT
GET /v2/tax-payment/:id/pdf
REQUEST

Python

import starkbank

pdf = starkbank.taxpayment.pdf("5186070702456832")

with open("tax-payment.pdf", "wb") as file:
    file.write(pdf)
  

Javascript

const starkbank = require('starkbank');
const fs = require('fs').promises;

(async() => {
    let pdf = await starkbank.taxPayment.pdf('5186070702456832');
    await fs.writeFile('tax-payment.pdf', pdf);
})();
  

PHP

use StarkBank\TaxPayment;

$pdf = StarkBank\TaxPayment::pdf("5186070702456832");

$fp = fopen('tax-payment.pdf', 'w');
fwrite($fp, $pdf);
fclose($fp);
  

Java

import java.io.File;
import java.io.InputStream;
import java.nio.file.StandardCopyOption;
import com.starkbank.*;

InputStream pdf = TaxPayment.pdf("5186070702456832");

java.nio.file.Files.copy(
    pdf,
    new File("iss-payment.pdf").toPath(),
    StandardCopyOption.REPLACE_EXISTING
);
  

Ruby

require('starkbank')

pdf = StarkBank::TaxPayment.pdf('5186070702456832')

File.open('iss-payment.pdf', 'w') { |file| file.write(pdf) }
  

Elixir

pdf = StarkBank.TaxPayment.pdf!("5186070702456832")

file = File.open!("iss-payment.pdf", [:write])
IO.binwrite(file, pdf)
File.close(file)
  

C#

byte[] pdf = StarkBank.TaxPayment.Pdf("5186070702456832");

System.IO.File.WriteAllBytes("iss-payment.pdf", pdf);
  

Go

package main

import (
    "fmt"
    "github.com/starkbank/sdk-go/starkbank/taxpayment"
)

func main() {

    pdf, err := taxpayment.Pdf("5186070702456832", nil)
    if err.Errors != nil {
        for _, e := range err.Errors {
            fmt.Printf("code: %s, message: %s", e.Code, e.Message)
        }
    }

    errFile := ioutil.WriteFile("taxpayment.pdf", pdf, 0666)
    if errFile != nil {
        fmt.Print(errFile)
    }
}
  

Clojure

(clojure.java.io/copy
  (starkbank.tax-payment/pdf "5186070702456832")
  (clojure.java.io/file "iss-payment.pdf"))
  

Curl

curl --location --request GET '{{baseUrl}}/v2/tax-payment/5186070702456832/pdf' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}'
  

List Tax Payment Logs

Get a paged list of all tax payment logs. A log tracks a change in the payment entity according to its life cycle.

Parameters

after OPTIONAL

Filter entities created after this date.

before OPTIONAL

Filter entities created before this date.

cursor OPTIONAL

String used to get the next batch of results. Our SDKs handle this for you.

limit OPTIONAL

Number of results per cursor. Max = 100.

paymentIds OPTIONAL

Array of payment ids linked to the desired logs.

types OPTIONAL

Filters logs by log types.

ENDPOINT
GET /v2/tax-payment/log
REQUEST

Python

import starkbank

logs = starkbank.taxpayment.log.query(
    payment_ids=["5133524998815744"]
)

for log in logs:
    print(log)
  

Javascript

const starkbank = require('starkbank');

(async() => {
    let logs = await starkbank.taxPayment.log.query({
        paymentIds:['5133524998815744'],
    });

    for await (let log of logs) {
        console.log(log);
    }
})();
  

PHP

StarkBank\TaxPayment;

$logs = StarkBank\TaxPayment\Log::query([
    "paymentIds" => ["5133524998815744"]
]);

foreach($logs as $log){
    print_r($log);
}
  

Java

import com.starkbank.*;
import com.starkbank.utils.Generator;
import java.util.HashMap;

HashMap<String, Object> params = new HashMap<>();
params.put("paymentIds", "5133524998815744");
Generator<TaxPayment.Log> logs = TaxPayment.Log.query(params);

for (TaxPayment.Log log : logs){
    System.out.println(log);
}
  

Ruby

require('starkbank')

logs = StarkBank::TaxPayment::Log.query(
    payment_ids: ['5133524998815744']
)

logs.each do |log|
    puts log
end
  

Elixir

logs = StarkBank.TaxPayment.Log.query!(
    payment_ids: ["5133524998815744"]
)

for log <- logs do
    log |> IO.inspect
end
  

C#

using System;
using System.Collections.Generic;

IEnumerable<StarkBank.TaxPayment.Log> logs = StarkBank.TaxPayment.Log.Query(
    paymentIds: new List<string> { "5133524998815744" }
);

foreach(StarkBank.TaxPayment.Log log in logs)
{
    Console.WriteLine(log);
}
  

Go

package main

import (
    "fmt"
    "github.com/starkbank/sdk-go/starkbank/taxpayment/log"
)

func main() {

    var params = map[string]interface{}{}
    params["paymentIds"] = []string{"5133524998815744"}
    
    logs, errorChannel := log.Query(params, nil)

    loop:
    for {
        select {
        case err := <-errorChannel:
            if err.Errors != nil {
                for _, e := range err.Errors {
                    fmt.Printf("code: %s, message: %s", e.Code, e.Message)
                }
            }
        case log, ok := <-logs:
            if !ok {
                break loop
            }
            fmt.Printf("%+v", log)
        }
    }
}
  

Clojure

(def logs
  (starkbank.tax-payment.log/query
    {
      :payment-ids ["5133524998815744"]
    }))
(dorun (map println logs))
  

Curl

curl --location --request GET '{{baseUrl}}/v2/tax-payment/log?paymentIds=5133524998815744' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}'
  
RESPONSE

Python

Log(
    created=2023-01-18 16:49:06.080497,
    errors=[],
    id=5068165377687552,
    payment=TaxPayment(
        amount=8271,
        bar_code=85660000000827100640074119002551100010601813,
        created=2023-01-18 16:49:05.981612,
        description=paying taxes,
        fee=0,
        id=5133524998815744,
        line=85660000000 9 82710064007 3 41190025511 7 00010601813 8,
        scheduled=2023-01-20 11:00:00.000000,
        status=created,
        tags=['expensive'],
        transaction_ids=[],
        type=iss,
        updated=2023-01-20 15:00:01.494340
    ),
    type=created
)
  

Javascript

Log {
    id: '5068165377687552',
    created: '2023-01-18T16:49:06.080497+00:00',
    type: 'created',
    errors: [],
    payment: {
        amount: 8271,
        barCode: '85660000000827100640074119002551100010601813',
        created: '2023-01-18T16:49:05.981612+00:00',
        description: 'paying taxes',
        fee: 0,
        id: '5133524998815744',
        line: '85660000000 9 82710064007 3 41190025511 7 00010601813 8',
        scheduled: '2023-01-20T11:00:00.000000+00:00',
        status: 'created',
        tags: [ 'expensive' ],
        transactionIds: [],
        type: 'iss',
        updated: '2023-01-20T15:00:01.494340+00:00'
    }
}
  

PHP

StarkBank\TaxPayment\Log Object
(
    [id] => 5068165377687552
    [type] => created
    [errors] => Array
        (
        )

    [payment] => Array
        (
            [amount] => 8271
            [barCode] => 85660000000827100640074119002551100010601813
            [created] => 2023-01-18T16:49:05.981612+00:00
            [description] => paying taxes
            [fee] => 0
            [id] => 5133524998815744
            [line] => 85660000000 9 82710064007 3 41190025511 7 00010601813 8
            [scheduled] => DateTime Object
            (
                [date] => 2023-08-02 11:00:00.000000
                [timezone_type] => 1
                [timezone] => +00:00
            )
    
            [status] => created
            [tags] => Array
                (
                    [0] => expensive
                )

            [transactionIds] => Array
                (
                )

            [type] => iss
            [updated] => 2023-01-20T15:00:01.494340+00:00
        )

    [created] => DateTime Object
        (
            [date] => 2023-01-18 16:49:06.080497
            [timezone_type] => 1
            [timezone] => +00:00
        )

)
  

Java

Log({
    "created": "2023-01-18T16:49:06.080497+00:00",
    "type": "created",
    "errors": [],
    "payment": {
        "line": "85660000000 9 82710064007 3 41190025511 7 00010601813 8",
        "barCode": "85660000000827100640074119002551100010601813",
        "description": "paying taxes",
        "tags": [ "expensive" ],
        "scheduled": "2023-01-20T11:00:00.000000+00:00",
        "status": "created",
        "amount": "8271",
        "transaction_ids": [],
        "fee": "0",
        "type": "iss",
        "updated": "2023-01-20T15:00:01.494340+00:00",
        "created": "2023-01-18T16:49:05.981612+00:00",
        "id": "5133524998815744"
    },
    "id": "5068165377687552"
})
  

Ruby

log(
    id: 5068165377687552,
    type: created,
    errors: [],
    payment: taxpayment(
        id: 5133524998815744,
        line: 85660000000 9 82710064007 3 41190025511 7 00010601813 8,
        bar_code: 85660000000827100640074119002551100010601813,
        description: paying taxes,
        tags: ["expensive"],
        transaction_ids: [],
        scheduled: 2023-01-20T11:00:00.000000+00:00,
        status: created,
        amount: 8271,
        fee: 0,
        type: iss,
        updated: 2023-01-20T15:00:01+00:00,
        created: 2023-01-18T16:49:05+00:00
    ),
    created: 2023-01-18T16:49:06+00:00
)
  

Elixir

%StarkBank.TaxPayment.Log{
    id: "5068165377687552",
    payment: %StarkBank.TaxPayment{
        description: "paying taxes",
        scheduled: ~U[2023-01-20 11:00:00.000000Z],
        line: "85660000000 9 82710064007 3 41190025511 7 00010601813 8",
        bar_code: "85660000000827100640074119002551100010601813",
        tags: ["expensive"],
        transaction_ids: [],
        amount: 8271,
        status: "created",
        type: "iss",
        updated: ~U[2023-01-20 15:00:01.494340Z],
        created: ~U[2023-01-18 16:49:05.981612Z],
        fee: 0,
        id: "5133524998815744"
    },
    errors: [],
    type: "created",
    created: ~U[2023-01-18 16:49:06.080497Z]
}
  

C#

Log(
    ID: 5068165377687552,
    Created: 01/18/2023 16:49:06,
    Type: created,
    Errors: {  },
    Payment: TaxPayment(
        Amount: 8271,
        Description: paying taxes,
        Line: 85660000000 9 82710064007 3 41190025511 7 00010601813 8,
        BarCode: 85660000000827100640074119002551100010601813,
        Scheduled: 01/20/2024 11:00:00,
        Tags: { expensive },
        TransactionIds: {  },
        Type: iss,
        Status: created,
        Fee: 0,
        Created: 01/20/2023 15:00:01,
        ID: 5133524998815744
    )
)
  

Go

{
    Id:5068165377687552 
    Payment:{
        Id:5133524998815744 
        Line:85660000000 9 82710064007 3 41190025511 7 00010601813 8 
        BarCode:85660000000827100640074119002551100010601813 
        Description:paying taxes 
        Scheduled:2023-01-20 11:00:00.000000 +0000 +0000 
        Tags:[expensive] 
        Status:created 
        Amount:8271 
        Fee:0 
        Type:iss 
        TransactionIds:[] 
        Updated:2023-01-18 16:49:05.981612 +0000 +0000 
        Created:2023-01-20 15:00:01.494340 +0000 +0000
    } 
    Errors:[] 
    Type:created 
    Created:2023-01-18 16:49:06.080497 +0000 +0000
}
  

Clojure

{:id "5068165377687552",
 :created "2023-01-18T16:49:06.080497+00:00",
 :errors [],
 :type "created",
 :payment
 {:description "paying taxes",
  :amount 8271,
  :fee 0,
  :tags ["expensive"],
  :transaction-ids [],
  :type "iss",
  :created "2023-01-18T16:49:05.981612+00:00",
  :line "85660000000 9 82710064007 3 41190025511 7 00010601813 8",
  :status "created",
  :id "5133524998815744",
  :scheduled "2023-01-20T11:00:00.000000+00:00",
  :bar-code "85660000000827100640074119002551100010601813"}}
  

Curl

{
    "cursor": null,
    "logs": [
        {
            "created": "2023-01-18T16:49:06.080497+00:00",
            "errors": [],
            "id": "5068165377687552",
            "payment": {
                "amount": 8271,
                "barCode": "85660000000827100640074119002551100010601813",
                "created": "2023-01-18T16:49:05.981612+00:00",
                "description": "paying taxes",
                "fee": 0,
                "id": "5133524998815744",
                "line": "85660000000 9 82710064007 3 41190025511 7 00010601813 8",
                "scheduled": "2023-01-20T11:00:00.000000+00:00",
                "status": "created",
                "tags": [ "expensive" ],
                "transactionIds": [],
                "type": "iss",
                "updated": "2023-01-20T15:00:01.494340+00:00"
            },
            "type": "created"
        }
    ]
}
  

Get a Tax Payment Log

Get a single tax payment log by its id.

Parameters

id REQUIRED

Id of the log entity

fields OPTIONAL

List of strings to filter response JSON keys. Not available in the SDKs.

ENDPOINT
GET /v2/tax-payment/log/:id
REQUEST

Python

import starkbank

log = starkbank.taxpayment.log.get("5068165377687552")

print(log)
  

Javascript

const starkbank = require('starkbank');

(async() => {
    let log = await starkbank.taxPayment.log.get('5068165377687552');
    console.log(log);
})();
  

PHP

use StarkBank\TaxPayment;

$log = StarkBank\TaxPayment\Log::get("5068165377687552");

print_r($log);
  

Java

import com.starkbank.*;

TaxPayment.Log log = TaxPayment.Log.get("5068165377687552");

System.out.println(log);
  

Ruby

require('starkbank')

log = StarkBank::TaxPayment::Log.get('5068165377687552')

puts log
  

Elixir

log = StarkBank.TaxPayment.Log.get!("5068165377687552")

log |> IO.inspect
  

C#

using System;

StarkBank.TaxPayment.Log log = StarkBank.TaxPayment.Log.Get("5068165377687552");

Console.WriteLine(log);
  

Go

package main

import (
    "fmt"
    "github.com/starkbank/sdk-go/starkbank/taxpayment/log"
)

func main() {

    log, err := log.Get("5068165377687552", nil)
    if err.Errors != nil {
        for _, e := range err.Errors {
            fmt.Printf("code: %s, message: %s", e.Code, e.Message)
        }
    }

    fmt.Printf("%+v", log)
}
  

Clojure

(def log (starkbank.tax-payment.log/get "5068165377687552"))
(println log)
  

Curl

curl --location --request GET '{{baseUrl}}/v2/tax-payment/log/5068165377687552' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}'
  
RESPONSE

Python

Log(
    created=2023-01-18 16:49:06.080497,
    errors=[],
    id=5068165377687552,
    payment=TaxPayment(
        amount=8271,
        bar_code=85660000000827100640074119002551100010601813,
        created=2023-01-18 16:49:05.981612,
        description=paying taxes,
        fee=0,
        id=5133524998815744,
        line=85660000000 9 82710064007 3 41190025511 7 00010601813 8,
        scheduled=2023-01-20 11:00:00,
        status=created,
        tags=['expensive'],
        transaction_ids=[],
        type=iss,
        updated=2023-01-20 15:00:01.494340
    ),
    type=created
)
  

Javascript

Log {
    id: '5068165377687552',
    created: '2023-01-18T16:49:06.080497+00:00',
    type: 'created',
    errors: [],
    payment: {
        amount: 8271,
        barCode: '85660000000827100640074119002551100010601813',
        created: '2023-01-18T16:49:05.981612+00:00',
        description: 'paying taxes',
        fee: 0,
        id: '5133524998815744',
        line: '85660000000 9 82710064007 3 41190025511 7 00010601813 8',
        scheduled: '2023-01-20T11:00:00+00:00',
        status: 'created',
        tags: [ 'expensive' ],
        transactionIds: [],
        type: 'iss',
        updated: '2023-01-20T15:00:01.494340+00:00'
    }
}
  

PHP

StarkBank\TaxPayment\Log Object
(
    [id] => 5068165377687552
    [type] => created
    [errors] => Array
        (
        )

    [payment] => Array
        (
            [amount] => 8271
            [barCode] => 85660000000827100640074119002551100010601813
            [created] => 2023-01-18T16:49:05.981612+00:00
            [description] => paying taxes
            [fee] => 0
            [id] => 5133524998815744
            [scheduled] => DateTime Object
            (
                [date] => 2023-08-02 11:00:00.000000
                [timezone_type] => 1
                [timezone] => +00:00
            )
    
            [status] => created
            [tags] => Array
                (
                    [0] => expensive
                )

            [transactionIds] => Array
                (
                )

            [type] => iss
            [updated] => 2023-01-20T15:00:01.494340+00:00
        )

    [created] => DateTime Object
        (
            [date] => 2023-01-18 16:49:06.080497
            [timezone_type] => 1
            [timezone] => +00:00
        )

)
  

Java

Log({
    "created": "2023-01-18T16:49:06.080497+00:00",
    "type": "created",
    "errors": [],
    "payment": {
        "line": "85660000000 9 82710064007 3 41190025511 7 00010601813 8",
        "barCode": "85660000000827100640074119002551100010601813",
        "description": "paying taxes",
        "tags": [ "expensive" ],
        "transactionIds": [],
        "scheduled": "2023-01-20T11:00:00+00:00",
        "status": "created",
        "amount": "8271",
        "fee": "0",
        "type": "iss",
        "updated": "2023-01-20T15:00:01.494340+00:00",
        "created": "2023-01-18T16:49:05.981612+00:00",
        "id": "5133524998815744"
    },
    "id": "5068165377687552"
})
  

Ruby

log(
    id: 5068165377687552,
    type: created,
    errors: [],
    payment: taxpayment(
        id: 5133524998815744,
        line: 85660000000 9 82710064007 3 41190025511 7 00010601813 8,
        bar_code: 85660000000827100640074119002551100010601813,
        description: paying taxes,
        tags: ["expensive"],
        transaction_ids: [],
        scheduled: 2023-01-20T11:00:00+00:00,
        status: created,
        amount: 8271,
        fee: 0,
        type: iss,
        updated: 2023-01-20T15:00:01+00:00,
        created: 2023-01-18T16:49:05+00:00
    ),
    created: 2023-01-18T16:49:06+00:00
)
  

Elixir

%StarkBank.TaxPayment.Log{
    id: "5068165377687552",
    payment: %StarkBank.TaxPayment{
        description: "paying taxes",
        scheduled: ~U[2023-01-20 11:00:00Z],
        line: "85660000000 9 82710064007 3 41190025511 7 00010601813 8",
        bar_code: "85660000000827100640074119002551100010601813",
        tags: ["expensive"],
        transaction_ids: [],
        amount: 8271,
        status: "created",
        type: "iss",
        updated: ~U[2023-01-20 15:00:01.494340Z],
        created: ~U[2023-01-18 16:49:05.981612Z],
        fee: 0,
        id: "5133524998815744"
    },
    errors: [],
    type: "created",
    created: ~U[2023-01-18 16:49:06.080497Z]
}
  

C#

Log(
    ID: 5068165377687552,
    Created: 01/18/2023 16:49:06,
    Type: created,
    Errors: {  },
    Payment: TaxPayment(
        Amount: 8271,
        Description: paying taxes,
        Line: 85660000000 9 82710064007 3 41190025511 7 00010601813 8,
        BarCode: 85660000000827100640074119002551100010601813,
        Scheduled: 01/20/2023 12:00:00,
        Tags: { expensive },
        TransactionIds: {  },
        Type: iss,
        Status: created,
        Fee: 0,
        Created: 01/20/2023 15:00:01,
        ID: 5133524998815744
    )
)
  

Go

{
    Id:5068165377687552 
    Payment:{
        Id:5133524998815744 
        Line:85660000000 9 82710064007 3 41190025511 7 00010601813 8 
        BarCode:85660000000827100640074119002551100010601813 
        Description:paying taxes 
        Scheduled:2023-01-20 11:00:00.000000 +0000 +0000 
        Tags:[expensive] 
        Status:created 
        Amount:8271 
        Fee:0 
        Type:iss 
        TransactionIds:[] 
        Updated:2023-01-18 16:49:05.981612 +0000 +0000 
        Created:2023-01-20 15:00:01.494340 +0000 +0000
    } 
    Errors:[] 
    Type:created 
    Created:2023-01-18 16:49:06.080497 +0000 +0000
}
  

Clojure

{:id "5068165377687552",
 :created "2023-01-18T16:49:06.080497+00:00",
 :errors [],
 :type "created",
 :payment
 {:description "paying taxes",
  :amount 8271,
  :fee 0,
  :tags ["expensive"],
  :transaction-ids [],
  :type "iss",
  :created "2023-01-18T16:49:05.981612+00:00",
  :line "85660000000 9 82710064007 3 41190025511 7 00010601813 8",
  :status "created",
  :id "5133524998815744",
  :scheduled "2023-01-20T11:00:00+00:00",
  :bar-code "85660000000827100640074119002551100010601813"}}
  

Curl

{
    "log": {
        "created": "2023-01-18T16:49:06.080497+00:00",
        "errors": [],
        "id": "5068165377687552",
        "payment": {
            "amount": 8271,
            "barCode": "85660000000827100640074119002551100010601813",
            "created": "2023-01-18T16:49:05.981612+00:00",
            "description": "paying taxes",
            "fee": 0,
            "id": "5133524998815744",
            "line": "85660000000 9 82710064007 3 41190025511 7 00010601813 8",
            "scheduled": "2023-01-20T11:00:00+00:00",
            "status": "created",
            "tags": [
                "expensive"
            ],
            "transactionIds": [],
            "type": "iss",
            "updated": "2023-01-20T15:00:01.494340+00:00"
        },
        "type": "created"
    }
}
  

Payment Status

Each payment has a status that can change over time according to its life cycle: payment-status

Payment Log

Every time we modify a DARF payment, we create a log. Logs are pretty useful for understanding the life cycle of each payment and the changes that happened to it. Here is the possible event flow: payment-log

The Darf Payment object

Attributes

id STRING

Unique id for the DARF payment.

amount INTEGER

Total payment amount in cents.

competence STRING

Competence month of the service. Example: "2020-03-10".

created STRING

Creation datetime. Example: "2020-04-23T23:00:00.000000+00:00".

description STRING

Text displayed in the bank statement.

due STRING

Due date for payment. Example: "2020-03-10".

fee INTEGER

Fee charged in cents.

fineAmount INTEGER

Fixed fine amount in cents.

interestAmount INTEGER

Interest amount in cents.

nominalAmount INTEGER

Amount due in cents without fee or interest.

referenceNumber STRING

Number assigned to the region of the tax.

revenueCode STRING

4-digit tax code assigned by Federal Revenue.

scheduled STRING

Scheduled payment date. Example: "2020-04-23".

status STRING

Current payment status. Options: "created", "processing", "confirmed", "success", "failed", "canceled".

tags LIST OF STRINGS

Tags associated with the DARF payment.

taxId STRING

Payer CPF or CNPJ.

transactionIds LIST OF STRINGS

Ledger transaction IDs linked to the payment.

updated STRING

Last update datetime. Example: "2020-04-23T23:00:00.000000+00:00".

Create Darf payments

Use this route to pay Darfs using the available balance in your Stark Bank account.

Parameters

competence REQUIRED

Competence month of the service. Example: '2020-03-10'

description REQUIRED

Text to be displayed in your statement (min. 10 characters). Example: "payment ABC"

due REQUIRED

Due date for payment. Example: '2020-03-10'

fineAmount REQUIRED

Fixed amount due in cents for fines. Example: 234 (= R$ 2.34)

interestAmount REQUIRED

Amount due in cents for interest. Example: 456 (= R$ 4.56)

nominalAmount REQUIRED

Amount due in cents without fee or interest. Example: 23456 (= R$ 234.56)

revenueCode REQUIRED

4-digit tax code assigned by Federal Revenue. Example: "5948"

taxId REQUIRED

Payer CPF (11 digits formatted or unformatted) or CNPJ (14 digits formatted or unformatted). Example: 012.345.678-90

referenceNumber OPTIONAL

Number assigned to the region of the tax. Example: "08.1.17.00-4"

scheduled OPTIONAL

Schedule the payment for a specific date. Default value is the current day.

tags OPTIONAL

Array of strings to tag the entity for future queries. All tags will be converted to lowercase.

ENDPOINT
POST /v2/darf-payment
REQUEST

Python

import starkbank

payments = starkbank.darfpayment.create([
    starkbank.DarfPayment(
        revenue_code="1240",
        tax_id="12.345.678/0001-95",
        competence="2021-03-01",
        reference_number="2340978970",
        nominal_amount=1234,
        fine_amount=12,
        interest_amount=34,
        due=datetime(2021, 5, 12, 15, 23, 26, 689377),
        scheduled=datetime(2021, 3, 12, 15, 23, 26, 689377)
        tags=["DARF", "making money"],
        description="take my money",
    )
])

for payment in payments:
    print(payment)
  

Javascript

const starkbank = require('starkbank');

(async() => {
    let payments = await starkbank.darfPayment.create([
        {
            revenueCode: "1240",
            taxId: "12.345.678/0001-95",
            competence: "2021-03-01",
            referenceNumber: "2340978970",
            nominalAmount: 1234,
            fineAmount: 12,
            interestAmount: 34,
            due: "2021-05-12",
            scheduled: "2021-03-12",
            tags: ["DARF", "making money"],
            description: "take my money"
        }
    ]);

    for await (let payment of payments) {
        console.log(payment);
    }
})();
  

PHP

use StarkBank\DarfPayment;

$payments = DarfPayment::create([
    new DarfPayment([
        "description" => "take my money",
        "tags" => ["DARF", "making money"],
        "due" => "2021-05-12",
        "competence" => "2021-03-01",
        "fineAmount" => 12,
        "interestAmount" => 34,
        "nominalAmount" => 1234,
        "revenueCode" => "1240",
        "referenceNumber" => "2340978970"
        "taxId" => "12.345.678/0001-95",
        "scheduled" => "2021-03-12",
    ])
]);

foreach($payments as $payment){
    print_r($payment);
}
  

Java

import com.starkbank.*;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

HashMap<String, Object$gt data = new HashMap<$gt();
data.put("revenueCode", "1240");
data.put("taxId", "12.345.678/0001-95");
data.put("competence", "2021-03-01");
data.put("nominalAmount", "1234");
data.put("fineAmount", 12);
data.put("interestAmount", 34);
data.put("referenceNumber",  "2340978970");
data.put("due", "2021-05-12");
data.put("scheduled", "2021-03-12");
data.put("tags", new String[]{"DARF", "making money"});
data.put("description", "take my money");

List<DarfPayment$gt payments = new ArrayList<$gt();
payments.add(new DarfPayment(data));

payments = DarfPayment.create(payments);

for (DarfPayment payment : payments) {
    System.out.println(payment);
}
  

Ruby

require('starkbank')

payments = StarkBank::DarfPayment.create(
  [
    StarkBank::DarfPayment.new(
        revenue_code: "1240",
        tax_id: "12.345.678/0001-95",
        competence: "2021-03-01",
        nominal_amount: 1234,
        fine_amount: 12,
        interest_amount: 34,
        due: "2021-05-12",
        scheduled: "2021-03-12",
        reference_number: "2340978970"
        tags: ["DARF", "making money"],
        description: "take my money",
    )
  ]
)

payments.each do |payment|
  puts payment
end
  

Elixir

payments = StarkBank.DarfPayment.create!(
    [
        %StarkBank.DarfPayment{
            revenue_code: "1240",
            tax_id: "12.345.678/0001-95",
            competence: "2021-03-01",
            reference_number: "2340978970",
            nominal_amount: 1234,
            fine_amount: 12,
            interest_amount: 34,
            due: "2021-03-12",
            scheduled: "2021-05-12",
            tags: ["DARF", "making money"],
            description: "take my money",
        }
    ]
) |> IO.inspect
  

C#

using System;
using System.Collections.Generic;

List<StarkBank.DarfPayment> payments = StarkBank.DarfPayment.Create(
    new List<StarkBank.DarfPayment>() { 
        new StarkBank.DarfPayment(
            revenueCode: "1240",
            taxID: "12.345.678/0001-95",
            competence: new DateTime(2023, 03, 01),
            referenceNumber: "2340978970",
            nominalAmount: 1234,
            fineAmount: 12,
            interestAmount: 34,
            due: new DateTime(2021, 05, 12),
            scheduled: new DateTime(2021, 03, 12),
            tags: new List<string> { "DARF", "making money" },
            description: "take my money"
        )
    }
);

foreach (StarkBank.DarfPayment payment in payments)
{
    Console.WriteLine(payment);
}
  

Go

package main

import (
    "fmt"
    "github.com/starkbank/sdk-go/starkbank/darfpayment"
)

func main() {

    due := time.Date(2021, 05, 12, 0, 0, 0, 0, time.UTC)
    scheduled := time.Date(2021, 03, 12, 0, 0, 0, 0, time.UTC)

    payments, err := darfpayment.Create(
        []darfpayment.DarfPayment{
            {
                RevenueCode:     "1240",
                TaxId:           "12.345.678/0001-95",
                Competence:      "2021-03-01",
                NominalAmount:   1234,
                FineAmount:      12,
                InterestAmount:  34,
                ReferenceNumber: "2340978970"
                Due:             &due,
                Scheduled:       &scheduled,
                Tags:            []string{"DARF", "making money"},
                Description:     "take my money",
            },
        }, nil)
    if err.Errors != nil {
        for _, e := range err.Errors {
            fmt.Printf("code: %s, message: %s", e.Code, e.Message)
        }
    }

    for _, payment := range payments {
        fmt.Printf("%+v", payment)
    }
}
  

Clojure

(def payments
(starkbank.darf-payment/create
    [
        {
            :revenue-code "1240",
            :tax-id "12.345.678/0001-95",
            :competence "2021-03-01",
            :reference-number "2340978970",
            :nominal-amount 1234,
            :fine-amount 12,
            :interest-amount 34,
            :due "2021-05-12",
            :scheduled "2021-03-12",
            :tags ["DARF", "making money"],
            :description "take my money"
        }
    ]
))

(println payments)
  

Curl

curl --location --request POST '{{baseUrl}}/v2/darf-payment' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}' 
--header 'Content-Type: application/json' 
--data-raw '{
    "payments": [
        {
            "description": take my money",
            "tags": ["DARF", "making money"],
            "scheduled": "2021-03-12",
            "competence": "2021-03-01",
            "due": "2021-05-12",
            "fineAmount": 12,
            "interestAmount": 34,
            "nominalAmount": 1234,
            "referenceNumber": "2340978970",
            "revenueCode": "1240",
            "taxId": "12.345.678/0001-95"
        }
    ]
}'
  
RESPONSE

Python

DarfPayment(
    amount=1280,
    competence=2021-03-01 02:59:59.999999,
    created=2021-02-20 14:39:15.565841,
    description=take my money,
    due=2021-05-12 02:59:59.999999,
    fee=0,
    fine_amount=12,
    id=5116552814788608,
    interest_amount=34,
    nominal_amount=1234,
    reference_number=2340978970,
    revenue_code=1240,
    scheduled=2021-03-012 15:00:00,
    status=created,
    tags=['darf', 'making money'],
    tax_id=12.345.678/0001-95,
    transaction_ids=[],
    updated=2021-02-20 14:39:15.565841
)
  

Javascript

DarfPayment {
    id: '5116552814788608',
    revenueCode: '1240',
    taxId: '12.345.678/0001-95',
    competence: '2021-03-01T02:59:59.999999+00:00',
    referenceNumber: '2340978970',
    fineAmount: 12,
    interestAmount: 34,
    due: '2021-05-12T02:59:59.999999+00:00',
    description: 'take my money',
    tags: [ 'darf', 'making money' ],
    scheduled: '2021-03-12T15:00:00+00:00',
    status: 'created',
    amount: 1280,
    nominalAmount: 1234,
    transactionIds: [],
    fee: 0,
    updated: '2021-02-20T14:40:10.977929+00:00',
    created: '2021-02-20T14:40:10.977921+00:00'
}
  

PHP

StarkBank\DarfPayment Object
(
    [id] => 5116552814788608
    [revenueCode] => 1240
    [taxId] => 12.345.678/0001-95
    [competence] => DateTime Object
        (
            [date] => 2021-03-01 02:59:59.999999
            [timezone_type] => 1
            [timezone] => +00:00
        )

    [referenceNumber] => 
    [fineAmount] => 12
    [interestAmount] => 34
    [due] => DateTime Object
        (
            [date] => 2021-05-12 02:59:59.999999
            [timezone_type] => 1
            [timezone] => +00:00
        )

    [description] => Darf Payment Example
    [tags] => Array
        (
            [0] => darf
            [1] => making money
        )

    [transactionIds] => Array
        (
        )

    [scheduled] => DateTime Object
        (
            [date] => 2021-03-12 15:00:00.000000
            [timezone_type] => 1
            [timezone] => +00:00
        )

    [status] => created
    [amount] => 1280
    [nominalAmount] => 1234
    [fee] => 0
    [updated] => DateTime Object
        (
            [date] => 2021-02-20 20:32:03.626083
            [timezone_type] => 1
            [timezone] => +00:00
        )

    [created] => DateTime Object
        (
            [date] => 2021-02-20 20:32:03.626074
            [timezone_type] => 1
            [timezone] => +00:00
        )

)
  

Java

DarfPayment({
    "description": "take my money",
    "revenueCode": "1240",
    "taxId": "12.345.678/0001-95",
    "competence": "2021-03-01T02:59:59.999999+00:00",
    "nominalAmount": 1234,
    "fineAmount": 12,
    "interestAmount": 34,
    "due": "2021-05-12T02:59:59.999999+00:00",
    "referenceNumber": "2340978970",
    "scheduled": "2021-03-12T16:17:20.291274+00:00",
    "tags": [
        "darf",
        "making money"
    ],
    "status": "created",
    "amount": "1280",
    "fee": "0",
    "transactionIds": [],
    "updated": "2021-02-20T16:17:20.291796+00:00",
    "created": "2021-02-20T16:17:20.291788+00:00",
    "id": "5116552814788608"
})
  

Ruby

darfpayment(
    id: 5116552814788608,
    revenue_code: 1240,
    tax_id: 12.345.678/0001-95,
    competence: 2021-03-01T02:59:59+00:00,
    reference_number: 2340978970,
    fine_amount: 12,
    interest_amount: 34,
    due: 2021-05-12T02:59:59+00:00,
    description: take my money,
    tags: ["darf", "making money"],
    transaction_ids: [],
    scheduled: 2021-03-12T15:00:00+00:00,
    status: created,
    amount: 1280,
    nominal_amount: 1234,
    fee: 0,
    updated: 2021-02-20T16:30:21+00:00,
    created: 2021-02-20T16:30:21+00:00
)
  

Elixir

%StarkBank.DarfPayment{
    revenue_code: "1240",
    tax_id: "12.345.678/0001-95",
    competence: ~U[2021-03-01 02:59:59.999999Z],
    reference_number: "2340978970",
    fine_amount: 12,
    interest_amount: 34,
    due: ~U[2021-05-12 02:59:59.999999Z],
    description: "take my money",
    tags: ["darf", "making money"],
    transaction_ids: [],
    scheduled: ~U[2021-03-12 20:44:50.956510Z],
    status: "created",
    amount: 1280,
    nominal_amount: 1234,
    id: "5116552814788608",
    updated: ~U[2021-02-20 20:44:50.957006Z],
    created: ~U[2021-02-20 20:44:50.956999Z]
}
  

C#

DarfPayment(
    RevenueCode: 1240,
    TaxID: 12.345.678/0001-95,
    Description: take my money,
    Competence: 01/03/2021 23:59:59,
    FineAmount: 12,
    InterestAmount: 34,
    Due: 12/05/2021 12:00:00,
    ReferenceNumber: 2340978970,
    NominalAmount: 1234,
    Tags: { darf, making money },
    TransactionIds: {  },
    Amount: 1280,
    Fee: 0,
    Created: 20/02/2021 13:45:51,
    Updated: 20/02/2021 13:45:51,
    Scheduled: 12/03/2021 12:00:00,
    Status: created,
    ID: 5116552814788608
)
  

Go

{
    Id:5116552814788608 
    RevenueCode:1240
    TaxId:12.345.678/0001-95
    Competence:2021-03-01 11:16:31.994675 +0000 +0000
    ReferenceNumber:2340978970
    FineAmount:12
    InterestAmount:34
    Due:2021-05-12 11:16:31.994675 +0000 +0000 
    Description:take my money
    Tags:[darf making money]
    TransactionIds:[]
    Scheduled:2021-03-12T15:00:00+00:00
    Status:created
    Amount:1280
    NominalAmount:1234
    Fee:0
    Updated:2021-02-20 11:16:31.994675 +0000 +0000 
    Created:2021-02-20 17:18:12.974157 +0000 +0000
}
  

Clojure

{
    :id: '5116552814788608',
    :revenue-code: '1240',
    :tax-id: '12.345.678/0001-95',
    :competence: '2021-03-01T02:59:59.999999+00:00',
    :reference-number: '2340978970',
    :fine-amount: 12,
    :interest-amount: 34,
    :due: '2021-05-12T02:59:59.999999+00:00',
    :description: 'take my money',
    :tags: [ 'darf', 'making money' ],
    :scheduled: '2021-03-12T15:00:00+00:00',
    :status: 'created',
    :amount: 1280,
    :nominal-amount: 1234,
    :fee: 0,
    :updated: '2021-02-20T14:40:10.977929+00:00',
    :created: '2021-02-20T14:40:10.977921+00:00'
}
  

Curl

{
    "message": "Darf payment(s) successfully created",
    "payments": [
        {
            "amount": 1280,
            "competence": "2021-03-01T02:59:59.999999+00:00",
            "created": "2021-02-20T16:51:04.528640+00:00",
            "description": "take my money",
            "due": "2021-05-12T02:59:59.999999+00:00",
            "fee": 0,
            "fineAmount": 12,
            "id": "5116552814788608",
            "interestAmount": 34,
            "nominalAmount": 1234,
            "referenceNumber": "2340978970",
            "revenueCode": "1240",
            "scheduled": "2021-03-12T15:00:00+00:00",
            "status": "created",
            "tags": ["darf", "making money"],
            "taxId": "12.345.678/0001-95",
            "transactionIds": [],
            "updated": "2021-02-20T16:51:04.528650+00:00"
        }
    ]
}
  

List Darf Payments

Get a list of non-deleted Darf payments in chunks of at most 100. If you need smaller chunks, use the limit parameter.

Parameters

after OPTIONAL

Filter entities created after this date.

before OPTIONAL

Filter entities created before this date.

cursor OPTIONAL

String used to get the next batch of results. Our SDKs handle this for you.

ids OPTIONAL

List of strings to get specific entities by ids.

limit OPTIONAL

Number of results per cursor. Max = 100.

status OPTIONAL

Filter Darfs by the specified status.

tags OPTIONAL

Filter entities that contain the specified tags.

ENDPOINT
GET /v2/darf-payment
REQUEST

Python

import starkbank

payments = starkbank.darfpayment.query(
    after="2021-02-01",
    before="2021-02-28"
)

for payment in payments:
    print(payment)
  

Javascript

const starkbank = require('starkbank');

(async() => {
    let payments = await starkbank.darfPayment.query({
        after: '2021-02-01',
        before: '2021-02-28'
    });

    for await (let payment of payments) {
        console.log(payment);
    }
})();
  

PHP

use StarkBank\DarfPayment;

$payments = StarkBank\DarfPayment::query([
    "after" => "2021-02-01",
    "before" => "2021-02-28"
]);

foreach($payments as $payment){
    print_r($payment);
}
  

Java

import com.starkbank.*;
import com.starkbank.utils.Generator;
import java.util.HashMap;

HashMap<String, Object> params = new HashMap<>();
params.put("after", "2021-02-01");
params.put("before", "2021-02-28");
Generator<DarfPayment> payments = DarfPayment.query(params);

for (DarfPayment payment : payments){
    System.out.println(payment);
}
  

Ruby

require('starkbank')

payments = StarkBank::DarfPayment.query(
    after: '2021-02-01',
    before: '2021-02-28'
)

payments.each do |payment|
    puts payment
end
  

Elixir

payments = StarkBank.DarfPayment.query!(
    after: "2021-02-01",
    before: "2021-02-28"
)

for payment <- payments do
    payment |> IO.inspect
end
  

C#

using System;
using System.Collections.Generic;

IEnumerable<StarkBank.DarfPayment> payments = StarkBank.DarfPayment.Query(
    after: new DateTime(2021, 2, 1),
    before: new DateTime(2021, 2, 28)
);

foreach(StarkBank.DarfPayment payment in payments)
{
    Console.WriteLine(payment);
}
  

Go

package main

import (
    "fmt"
    "time"
    "github.com/starkbank/sdk-go/starkbank/darfpayment"
)

func main() {

    var params = map[string]interface{}{}
    params["after"] = time.Date(2021, 2, 1, 0, 0, 0, 0, time.UTC)
    params["before"] = time.Date(2021, 2, 28, 0, 0, 0, 0, time.UTC)
    
    payments, errorChannel := darfpayment.Query(params, nil)

    loop:
    for {
        select {
        case err := <-errorChannel:
            if err.Errors != nil {
                for _, e := range err.Errors {
                    fmt.Printf("code: %s, message: %s", e.Code, e.Message)
                }
            }
        case payment, ok := <-payments:
            if !ok {
                break loop
            }
            fmt.Printf("%+v
", payment)
        }
    }
}
  

Clojure

(def payments
  (starkbank.darf-payment/query
    {
      :after "2021-02-01"
      :before "2021-02-28"
    }))
(dorun (map println payments))
  

Curl

curl --location --request GET '{{baseUrl}}/v2/darf-payment?after=2021-02-01&before=2021-02-28' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}'
  
RESPONSE

Python

DarfPayment(
    amount=1280,
    competence=2021-03-01 02:59:59.999999,
    created=2021-02-20 14:39:15.565841,
    description=take my money,
    due=2021-05-12 02:59:59.999999,
    fee=0,
    fine_amount=12,
    id=5116552814788608,
    interest_amount=34,
    nominal_amount=1234,
    reference_number=2340978970,
    revenue_code=1240,
    scheduled=2021-03-012 15:00:00,
    status=created,
    tags=['darf', 'making money'],
    tax_id=12.345.678/0001-95,
    transaction_ids=[],
    updated=2021-02-20 14:39:15.565841
)
  

Javascript

DarfPayment {
    id: '5116552814788608',
    revenueCode: '1240',
    taxId: '12.345.678/0001-95',
    competence: '2021-03-01T02:59:59.999999+00:00',
    referenceNumber: '2340978970',
    fineAmount: 12,
    interestAmount: 34,
    due: '2021-05-12T02:59:59.999999+00:00',
    description: 'take my money',
    tags: [ 'darf', 'making money' ],
    scheduled: '2021-03-12T15:00:00+00:00',
    status: 'created',
    amount: 1280,
    nominalAmount: 1234,
    transactionIds: [],
    fee: 0,
    updated: '2021-02-20T14:40:10.977929+00:00',
    created: '2021-02-20T14:40:10.977921+00:00'
}
  

PHP

StarkBank\DarfPayment Object
(
    [id] => 5116552814788608
    [revenueCode] => 1240
    [taxId] => 12.345.678/0001-95
    [competence] => DateTime Object
        (
            [date] => 2021-03-01 02:59:59.999999
            [timezone_type] => 1
            [timezone] => +00:00
        )

    [referenceNumber] => 
    [fineAmount] => 12
    [interestAmount] => 34
    [due] => DateTime Object
        (
            [date] => 2021-05-12 02:59:59.999999
            [timezone_type] => 1
            [timezone] => +00:00
        )

    [description] => Darf Payment Example
    [tags] => Array
        (
            [0] => darf
            [1] => making money
        )

    [transactionIds] => Array
        (
        )

    [scheduled] => DateTime Object
        (
            [date] => 2021-03-12 15:00:00.000000
            [timezone_type] => 1
            [timezone] => +00:00
        )

    [status] => created
    [amount] => 1280
    [nominalAmount] => 1234
    [fee] => 0
    [updated] => DateTime Object
        (
            [date] => 2021-02-20 20:32:03.626083
            [timezone_type] => 1
            [timezone] => +00:00
        )

    [created] => DateTime Object
        (
            [date] => 2021-02-20 20:32:03.626074
            [timezone_type] => 1
            [timezone] => +00:00
        )

)
  

Java

DarfPayment({
    "description": "take my money",
    "revenueCode": "1240",
    "taxId": "12.345.678/0001-95",
    "competence": "2021-03-01T02:59:59.999999+00:00",
    "nominalAmount": 1234,
    "fineAmount": 12,
    "interestAmount": 34,
    "due": "2021-05-12T02:59:59.999999+00:00",
    "referenceNumber": "2340978970",
    "scheduled": "2021-03-12T16:17:20.291274+00:00",
    "tags": [
        "darf",
        "making money"
    ],
    "status": "created",
    "amount": "1280",
    "fee": "0",
    "transactionIds": [],
    "updated": "2021-02-20T16:17:20.291796+00:00",
    "created": "2021-02-20T16:17:20.291788+00:00",
    "id": "5116552814788608"
})
  

Ruby

darfpayment(
    id: 5116552814788608,
    revenue_code: 1240,
    tax_id: 12.345.678/0001-95,
    competence: 2021-03-01T02:59:59+00:00,
    reference_number: 2340978970,
    fine_amount: 12,
    interest_amount: 34,
    due: 2021-05-12T02:59:59+00:00,
    description: take my money,
    tags: ["darf", "making money"],
    transaction_ids: [],
    scheduled: 2021-03-12T15:00:00+00:00,
    status: created,
    amount: 1280,
    nominal_amount: 1234,
    fee: 0,
    updated: 2021-02-20T16:30:21+00:00,
    created: 2021-02-20T16:30:21+00:00
)
  

Elixir

%StarkBank.DarfPayment{
    revenue_code: "1240",
    tax_id: "12.345.678/0001-95",
    competence: ~U[2021-03-01 02:59:59.999999Z],
    reference_number: "2340978970",
    fine_amount: 12,
    interest_amount: 34,
    due: ~U[2021-05-12 02:59:59.999999Z],
    description: "take my money",
    tags: ["darf", "making money"],
    transaction_ids: [],
    scheduled: ~U[2021-03-12 20:44:50.956510Z],
    status: "created",
    amount: 1280,
    nominal_amount: 1234,
    id: "5116552814788608",
    updated: ~U[2021-02-20 20:44:50.957006Z],
    created: ~U[2021-02-20 20:44:50.956999Z]
}
  

C#

DarfPayment(
    RevenueCode: 1240,
    TaxID: 12.345.678/0001-95,
    Description: take my money,
    Competence: 01/03/2021 23:59:59,
    FineAmount: 12,
    InterestAmount: 34,
    Due: 12/05/2021 12:00:00,
    ReferenceNumber: 2340978970,
    NominalAmount: 1234,
    Tags: { darf, making money },
    TransactionIds: {  },
    Amount: 1280,
    Fee: 0,
    Created: 20/02/2021 13:45:51,
    Updated: 20/02/2021 13:45:51,
    Scheduled: 12/03/2021 12:00:00,
    Status: created,
    ID: 5116552814788608
)
  

Go

{
    Id:5116552814788608 
    RevenueCode:1240
    TaxId:12.345.678/0001-95
    Competence:2021-03-01 11:16:31.994675 +0000 +0000
    ReferenceNumber:2340978970
    FineAmount:12
    InterestAmount:34
    Due:2021-05-12 11:16:31.994675 +0000 +0000 
    Description:take my money
    Tags:[darf making money]
    TransactionIds:[]
    Scheduled:2021-03-12T15:00:00+00:00
    Status:created
    Amount:1280
    NominalAmount:1234
    Fee:0
    Updated:2021-02-20 11:16:31.994675 +0000 +0000 
    Created:2021-02-20 17:18:12.974157 +0000 +0000
}
  

Clojure

{
    :id: '5116552814788608',
    :revenue-code: '1240',
    :tax-id: '12.345.678/0001-95',
    :competence: '2021-03-01T02:59:59.999999+00:00',
    :reference-number: '2340978970',
    :fine-amount: 12,
    :interest-amount: 34,
    :due: '2021-05-12T02:59:59.999999+00:00',
    :description: 'take my money',
    :tags: [ 'darf', 'making money' ],
    :scheduled: '2021-03-12T15:00:00+00:00',
    :status: 'created',
    :amount: 1280,
    :nominal-amount: 1234,
    :fee: 0,
    :updated: '2021-02-20T14:40:10.977929+00:00',
    :created: '2021-02-20T14:40:10.977921+00:00'
}
  

Curl

{
    "cursor": "ClAKFAoHY3JlYXRlZBIJCMfd7sCjhP0CEjRqGGl-YXBpLW1zLXRheC1wYXltZW50LXNieHIYCxILRGFyZlBheW1lbnQYgICAqKOFmwkMGAAgAQ==",
    "payments": [
        {
            "amount": 1280,
            "competence": "2021-03-01T02:59:59.999999+00:00",
            "created": "2021-02-20T16:51:04.528640+00:00",
            "description": "take my money",
            "due": "2021-05-12T02:59:59.999999+00:00",
            "fee": 0,
            "fineAmount": 12,
            "id": "5116552814788608",
            "interestAmount": 34,
            "nominalAmount": 1234,
            "referenceNumber": "2340978970",
            "revenueCode": "1240",
            "scheduled": "2021-03-12T15:00:00+00:00",
            "status": "created",
            "tags": ["darf", "making money"],
            "taxId": "12.345.678/0001-95",
            "transactionIds": [],
            "updated": "2021-02-20T16:51:04.528650+00:00"
        }
    ]
}
  

Get a Darf Payment

Get a single Darf payment by its id.

Parameters

id REQUIRED

Id of the Darf payment entity.

fields OPTIONAL

List of strings to filter response JSON keys. Not available in the SDKs.

ENDPOINT
GET /v2/darf-payment/:id
REQUEST

Python

import starkbank

payment = starkbank.darfpayment.get("5116552814788608")

print(payment)
  

Javascript

const starkbank = require('starkbank');

(async() => {
    let payment = await starkbank.darfPayment.get('5116552814788608');
    console.log(payment);
})();
  

PHP

use StarkBank\DarfPayment;

$payment = StarkBank\DarfPayment::get("5116552814788608");

print_r($payment);
  

Java

import com.starkbank.*;

DarfPayment payment = DarfPayment.get("5116552814788608");

System.out.println(payment);
  

Ruby

require('starkbank')

payment = StarkBank::DarfPayment.get('5116552814788608')

puts payment
  

Elixir

payment = StarkBank.DarfPayment.get!("5116552814788608")

payment |> IO.inspect
  

C#

using System;

StarkBank.DarfPayment payment = StarkBank.DarfPayment.Get("5116552814788608");

Console.WriteLine(payment);
  

Go

package main

import (
    "fmt"
    "github.com/starkbank/sdk-go/starkbank/darfpayment"
)

func main() {

    payment, err := darfpayment.Get("5116552814788608", nil)
    if err.Errors != nil {
        for _, e := range err.Errors {
            fmt.Printf("code: %s, message: %s", e.Code, e.Message)
        }
    }

    fmt.Printf("%+v", payment)
}
  

Clojure

(def payment (starkbank.darf-payment/get "5116552814788608"))
(println payment)
  

Curl

curl --location --request GET '{{baseUrl}}/v2/darf-payment/5116552814788608' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}'
  
RESPONSE

Python

DarfPayment(
    amount=1280,
    competence=2021-03-01 02:59:59.999999,
    created=2021-02-20 14:39:15.565841,
    description=take my money,
    due=2021-05-12 02:59:59.999999,
    fee=0,
    fine_amount=12,
    id=5116552814788608,
    interest_amount=34,
    nominal_amount=1234,
    reference_number=2340978970,
    revenue_code=1240,
    scheduled=2021-03-012 15:00:00,
    status=created,
    tags=['darf', 'making money'],
    tax_id=12.345.678/0001-95,
    transaction_ids=[],
    updated=2021-02-20 14:39:15.565841
)
  

Javascript

DarfPayment {
    id: '5116552814788608',
    revenueCode: '1240',
    taxId: '12.345.678/0001-95',
    competence: '2021-03-01T02:59:59.999999+00:00',
    referenceNumber: '2340978970',
    fineAmount: 12,
    interestAmount: 34,
    due: '2021-05-12T02:59:59.999999+00:00',
    description: 'take my money',
    tags: [ 'darf', 'making money' ],
    scheduled: '2021-03-12T15:00:00+00:00',
    status: 'created',
    amount: 1280,
    nominalAmount: 1234,
    transactionIds: [],
    fee: 0,
    updated: '2021-02-20T14:40:10.977929+00:00',
    created: '2021-02-20T14:40:10.977921+00:00'
}
  

PHP

StarkBank\DarfPayment Object
(
    [id] => 5116552814788608
    [revenueCode] => 1240
    [taxId] => 12.345.678/0001-95
    [competence] => DateTime Object
        (
            [date] => 2021-03-01 02:59:59.999999
            [timezone_type] => 1
            [timezone] => +00:00
        )

    [referenceNumber] => 2340978970
    [fineAmount] => 12
    [interestAmount] => 34
    [due] => DateTime Object
        (
            [date] => 2021-05-12 02:59:59.999999
            [timezone_type] => 1
            [timezone] => +00:00
        )

    [description] => take my money
    [tags] => Array
        (
            [0] => darf
            [1] => making money
        )

    [transactionIds] => Array
        (
        )

    [scheduled] => DateTime Object
        (
            [date] => 2021-03-12 15:00:00.000000
            [timezone_type] => 1
            [timezone] => +00:00
        )

    [status] => created
    [amount] => 1280
    [nominalAmount] => 1234
    [fee] => 0
    [updated] => DateTime Object
        (
            [date] => 2021-02-20 20:32:03.626083
            [timezone_type] => 1
            [timezone] => +00:00
        )

    [created] => DateTime Object
        (
            [date] => 2021-02-20 20:32:03.626074
            [timezone_type] => 1
            [timezone] => +00:00
        )

)
  

Java

DarfPayment({
    "description": "take my money",
    "revenueCode": "1240",
    "taxId": "12.345.678/0001-95",
    "competence": "2021-03-01T02:59:59.999999+00:00",
    "nominalAmount": 1234,
    "fineAmount": 12,
    "interestAmount": 34,
    "due": "2021-05-12T02:59:59.999999+00:00",
    "referenceNumber": "2340978970",
    "scheduled": "2021-03-12T16:17:20.291274+00:00",
    "tags": [
        "darf",
        "making money"
    ],
    "status": "created",
    "amount": "1280",
    "fee": "0",
    "transactionIds": [],
    "updated": "2021-02-20T16:17:20.291796+00:00",
    "created": "2021-02-20T16:17:20.291788+00:00",
    "id": "5116552814788608"
})
  

Ruby

darfpayment(
    id: 5116552814788608,
    revenue_code: 1240,
    tax_id: 12.345.678/0001-95,
    competence: 2021-03-01T02:59:59+00:00,
    reference_number: 2340978970,
    fine_amount: 12,
    interest_amount: 34,
    due: 2021-05-12T02:59:59+00:00,
    description: take my money,
    tags: ["darf", "making money"],
    transaction_ids: ["darf", "making money"],
    scheduled: 2021-03-12T15:00:00+00:00,
    status: created,
    amount: 1280,
    nominal_amount: 1234,
    fee: 0,
    updated: 2021-02-20T16:30:21+00:00,
    created: 2021-02-20T16:30:21+00:00
)
  

Elixir

%StarkBank.DarfPayment{
    revenue_code: "1240",
    tax_id: "12.345.678/0001-95",
    competence: ~U[2021-03-01 02:59:59.999999Z],
    reference_number: "2340978970",
    fine_amount: 12,
    interest_amount: 34,
    due: ~U[2021-05-12 02:59:59.999999Z],
    description: "take my money",
    tags: ["darf", "making money"],
    transaction_ids: [],
    scheduled: ~U[2021-03-12 20:44:50.956510Z],
    status: "created",
    amount: 1280,
    nominal_amount: 1234,
    id: "5116552814788608",
    updated: ~U[2021-02-20 20:44:50.957006Z],
    created: ~U[2021-02-20 20:44:50.956999Z]
}
  

C#

DarfPayment(
    RevenueCode: 1240,
    TaxID: 12.345.678/0001-95,
    Description: take my money,
    Competence: 01/03/2021 23:59:59,
    FineAmount: 12,
    InterestAmount: 34,
    Due: 12/05/2021 12:00:00,
    ReferenceNumber: 2340978970,
    NominalAmount: 1234,
    Tags: { darf, making money },
    TransactionIds: {  },
    Amount: 1280,
    Fee: 0,
    Created: 20/02/2021 13:45:51,
    Updated: 20/02/2021 13:45:51,
    Scheduled: 12/03/2021 12:00:00,
    Status: created,
    ID: 5116552814788608
)
  

Go

{
    Id:5116552814788608 
    RevenueCode:1240
    TaxId:12.345.678/0001-95
    Competence:2021-03-01 11:16:31.994675 +0000 +0000
    ReferenceNumber:2340978970
    FineAmount:12
    InterestAmount:34
    Due:2021-05-12 11:16:31.994675 +0000 +0000 
    Description:take my money
    Tags:[darf making money]
    TransactionIds:[]
    Scheduled:2021-03-12T15:00:00+00:00
    Status:created
    Amount:1280
    NominalAmount:1234
    Fee:0
    Updated:2021-02-20 11:16:31.994675 +0000 +0000 
    Created:2021-02-20 17:18:12.974157 +0000 +0000
}
  

Clojure

{
    :id: '5116552814788608',
    :revenue-code: '1240',
    :tax-id: '12.345.678/0001-95',
    :competence: '2021-03-01T02:59:59.999999+00:00',
    :reference-number: '2340978970',
    :fine-amount: 12,
    :interest-amount: 34,
    :due: '2021-05-12T02:59:59.999999+00:00',
    :description: 'take my money',
    :tags: [ 'darf', 'making money' ],
    :scheduled: '2021-03-12T15:00:00+00:00',
    :status: 'created',
    :amount: 1280,
    :nominal-amount: 1234,
    :fee: 0,
    :updated: '2021-02-20T14:40:10.977929+00:00',
    :created: '2021-02-20T14:40:10.977921+00:00'
}
  

Curl

{
    "payment": {
        "amount": 1280,
        "competence": "2021-03-01T02:59:59.999999+00:00",
        "created": "2021-02-20T16:51:04.528640+00:00",
        "description": "take my money",
        "due": "2021-05-12T02:59:59.999999+00:00",
        "fee": 0,
        "fineAmount": 12,
        "id": "5116552814788608",
        "interestAmount": 34,
        "nominalAmount": 1234,
        "referenceNumber": "2340978970",
        "revenueCode": "1240",
        "scheduled": "2021-03-12T15:00:00+00:00",
        "status": "created",
        "tags": ["darf", "making money"],
        "taxId": "12.345.678/0001-95",
        "transactionIds": [],
        "updated": "2021-02-20T16:51:04.528650+00:00"
    }
}
  

Delete a Darf Payment

Cancel a scheduled Darf payment. You can only cancel Darf payments before they start being processed.

NOTE: Payments that have already been processed can be deleted, but not cancelled.

Parameters

id REQUIRED

Id of the Darf payment entity.

ENDPOINT
DELETE /v2/darf-payment/:id
REQUEST

Python

import starkbank

payment = starkbank.darfpayment.delete("5116552814788608")

print(payment)
  

Javascript

const starkbank = require('starkbank');

(async() => {
    let payment = await starkbank.darfPayment.delete('5116552814788608');
    console.log(payment);
})();
  

PHP

StarkBank\DarfPayment;

$payment = StarkBank\DarfPayment::delete("5116552814788608");

print_r($payment);
  

Java

import com.starkbank.*;

DarfPayment payment = DarfPayment.delete("5116552814788608");

System.out.println(payment);
  

Ruby

require('starkbank')

payment = StarkBank::DarfPayment.delete('5116552814788608')

puts payment
  

Elixir

payment = StarkBank.DarfPayment.delete!("5116552814788608")

payment |> IO.inspect
  

C#

using System;

StarkBank.DarfPayment payment = StarkBank.DarfPayment.Delete("5116552814788608");

Console.WriteLine(payment);
  

Go

package main

import (
    "fmt"
    "github.com/starkbank/sdk-go/starkbank/boletopayment"
)

func main() {

    payment, err := boletopayment.Delete("5116552814788608", nil)
    if err.Errors != nil {
        for _, e := range err.Errors {
            fmt.Printf("code: %s, message: %s", e.Code, e.Message)
        }
    }

    fmt.Printf("%+v", payment)
}
  

Clojure

(def payment (starkbank.darf-payment/delete "5116552814788608"))
(println payment)
  

Curl

curl --location --request DELETE '{{baseUrl}}/v2/darf-payment/5116552814788608' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}'
  
RESPONSE

Python

DarfPayment(
    amount=1280,
    competence=2021-03-01 02:59:59.999999,
    created=2021-02-20 14:39:15.565841,
    description=take my money,
    due=2021-05-12 02:59:59.999999,
    fee=0,
    fine_amount=12,
    id=5116552814788608,
    interest_amount=34,
    nominal_amount=1234,
    reference_number=2340978970,
    revenue_code=1240,
    scheduled=2021-03-012 15:00:00,
    status=canceled,
    tags=['darf', 'making money'],
    tax_id=12.345.678/0001-95,
    transaction_ids=[],
    updated=2021-02-20 14:39:15.565841
)
  

Javascript

DarfPayment {
    id: '5116552814788608',
    revenueCode: '1240',
    taxId: '12.345.678/0001-95',
    competence: '2021-03-01T02:59:59.999999+00:00',
    referenceNumber: '2340978970',
    fineAmount: 12,
    interestAmount: 34,
    due: '2021-05-12T02:59:59.999999+00:00',
    description: 'take my money',
    tags: [ 'darf', 'making money' ],
    scheduled: '2021-03-12T15:00:00+00:00',
    status: 'canceled',
    amount: 1280,
    nominalAmount: 1234,
    transactionIds: [],
    fee: 0,
    updated: '2021-02-20T14:40:10.977929+00:00',
    created: '2021-02-20T14:40:10.977921+00:00'
}
  

PHP

StarkBank\DarfPayment Object
(
    [id] => 5116552814788608
    [revenueCode] => 1240
    [taxId] => 12.345.678/0001-95
    [competence] => DateTime Object
        (
            [date] => 2021-03-01 02:59:59.999999
            [timezone_type] => 1
            [timezone] => +00:00
        )

    [referenceNumber] => 
    [fineAmount] => 12
    [interestAmount] => 34
    [due] => DateTime Object
        (
            [date] => 2021-05-12 02:59:59.999999
            [timezone_type] => 1
            [timezone] => +00:00
        )

    [description] => Darf Payment Example
    [tags] => Array
        (
            [0] => darf
            [1] => making money
        )

    [transactionIds] => Array
        (
        )

    [scheduled] => DateTime Object
        (
            [date] => 2021-03-12 15:00:00.000000
            [timezone_type] => 1
            [timezone] => +00:00
        )

    [status] => canceled
    [amount] => 1280
    [nominalAmount] => 1234
    [fee] => 0
    [updated] => DateTime Object
        (
            [date] => 2021-02-20 20:32:03.626083
            [timezone_type] => 1
            [timezone] => +00:00
        )

    [created] => DateTime Object
        (
            [date] => 2021-02-20 20:32:03.626074
            [timezone_type] => 1
            [timezone] => +00:00
        )

)
  

Java

DarfPayment({
    "description": "take my money",
    "revenueCode": "1240",
    "taxId": "12.345.678/0001-95",
    "competence": "2021-03-01T02:59:59.999999+00:00",
    "nominalAmount": 1234,
    "fineAmount": 12,
    "interestAmount": 34,
    "due": "2021-05-12T02:59:59.999999+00:00",
    "referenceNumber": "2340978970",
    "scheduled": "2021-03-12T16:17:20.291274+00:00",
    "tags": [
        "darf",
        "making money"
    ],
    "status": "canceled",
    "amount": "1280",
    "fee": "0",
    "transactionIds": [],
    "updated": "2021-02-20T16:17:20.291796+00:00",
    "created": "2021-02-20T16:17:20.291788+00:00",
    "id": "5116552814788608"
})
  

Ruby

darfpayment(
    id: 5116552814788608,
    revenue_code: 1240,
    tax_id: 12.345.678/0001-95,
    competence: 2021-03-01T02:59:59+00:00,
    reference_number: 2340978970,
    fine_amount: 12,
    interest_amount: 34,
    due: 2021-05-12T02:59:59+00:00,
    description: take my money,
    tags: ["darf", "making money"],
    transaction_ids: [],
    scheduled: 2021-03-12T15:00:00+00:00,
    status: canceled,
    amount: 1280,
    nominal_amount: 1234,
    fee: 0,
    updated: 2021-02-20T16:30:21+00:00,
    created: 2021-02-20T16:30:21+00:00
)
  

Elixir

%StarkBank.DarfPayment{
    revenue_code: "1240",
    tax_id: "12.345.678/0001-95",
    competence: ~U[2021-03-01 02:59:59.999999Z],
    reference_number: "2340978970",
    fine_amount: 12,
    interest_amount: 34,
    due: ~U[2021-05-12 02:59:59.999999Z],
    description: "take my money",
    tags: ["darf", "making money"],
    transaction_ids: [],
    scheduled: ~U[2021-03-12 20:44:50.956510Z],
    status: "canceled",
    amount: 1280,
    nominal_amount: 1234,
    id: "5116552814788608",
    updated: ~U[2021-02-20 20:44:50.957006Z],
    created: ~U[2021-02-20 20:44:50.956999Z]
}
  

C#

DarfPayment(
    RevenueCode: 1240,
    TaxID: 12.345.678/0001-95,
    Description: take my money,
    Competence: 01/03/2021 23:59:59,
    FineAmount: 12,
    InterestAmount: 34,
    Due: 12/05/2021 12:00:00,
    ReferenceNumber: 2340978970,
    NominalAmount: 1234,
    Tags: { darf, making money },
    TransactionIds: {  },
    Amount: 1280,
    Fee: 0,
    Created: 20/02/2021 13:45:51,
    Updated: 20/02/2021 13:45:51,
    Scheduled: 12/03/2021 12:00:00,
    Status: canceled,
    ID: 5116552814788608
)
  

Go

{
    Id:5116552814788608 
    RevenueCode:1240
    TaxId:12.345.678/0001-95
    Competence:2021-03-01 11:16:31.994675 +0000 +0000
    ReferenceNumber:2340978970
    FineAmount:12
    InterestAmount:34
    Due:2021-05-12 11:16:31.994675 +0000 +0000 
    Description:take my money
    Tags:[darf making money]
    TransactionIds:[]
    Scheduled:2021-03-12T15:00:00+00:00
    Status:canceled
    Amount:1280
    NominalAmount:1234
    Fee:0
    Updated:2021-02-20 11:16:31.994675 +0000 +0000 
    Created:2021-02-20 17:18:12.974157 +0000 +0000
}
  

Clojure

{
    :id: '5116552814788608',
    :revenue-code: '1240',
    :tax-id: '12.345.678/0001-95',
    :competence: '2021-03-01T02:59:59.999999+00:00',
    :reference-number: '2340978970',
    :fine-amount: 12,
    :interest-amount: 34,
    :due: '2021-05-12T02:59:59.999999+00:00',
    :description: 'take my money',
    :tags: [ 'darf', 'making money' ],
    :scheduled: '2021-03-12T15:00:00+00:00',
    :status: 'canceled',
    :amount: 1280,
    :nominal-amount: 1234,
    :fee: 0,
    :updated: '2021-02-20T14:40:10.977929+00:00',
    :created: '2021-02-20T14:40:10.977921+00:00'
}
  

Curl

{
    "message": "Darf Payment successfully deleted",
    "payment": {
        "amount": 1280,
        "competence": "2021-03-01T02:59:59.999999+00:00",
        "created": "2021-02-20T16:51:04.528640+00:00",
        "description": "take my money",
        "due": "2021-05-12T02:59:59.999999+00:00",
        "fee": 0,
        "fineAmount": 12,
        "id": "5116552814788608",
        "interestAmount": 34,
        "nominalAmount": 1234,
        "referenceNumber": "2340978970",
        "revenueCode": "1240",
        "scheduled": "2021-03-12T15:00:00+00:00",
        "status": "canceled",
        "tags": ["darf", "making money"],
        "taxId": "12.345.678/0001-95",
        "transactionIds": [],
        "updated": "2021-02-20T16:51:04.528650+00:00"
    }
}
  

Get a Darf Payment PDF

Get a Darf payment PDF receipt. You can only get a receipt for payments whose status are either success, processing or created.

Parameters

id REQUIRED

Id of the Darf payment entity

ENDPOINT
GET /v2/darf-payment/:id/pdf
REQUEST

Python

import starkbank

pdf = starkbank.darfpayment.pdf("5116552814788608")

with open("darf-payment.pdf", "wb") as file:
    file.write(pdf)
  

Javascript

const starkbank = require('starkbank');
const fs = require('fs').promises;

(async() => {
    let pdf = await starkbank.darfPayment.pdf('5116552814788608');
    await fs.writeFile('darf-payment.pdf', pdf);
})();
  

PHP

use StarkBank\DarfPayment;

$pdf = StarkBank\DarfPayment::pdf("5116552814788608");

$fp = fopen('darf-payment.pdf', 'w');
fwrite($fp, $pdf);
fclose($fp);
  

Java

import java.io.File;
import java.io.InputStream;
import java.nio.file.StandardCopyOption;
import com.starkbank.*;

InputStream pdf = DarfPayment.pdf("5116552814788608");

java.nio.file.Files.copy(
    pdf,
    new File("iss-payment.pdf").toPath(),
    StandardCopyOption.REPLACE_EXISTING
);
  

Ruby

require('starkbank')

pdf = StarkBank::DarfPayment.pdf('5116552814788608')

File.open('iss-payment.pdf', 'w') { |file| file.write(pdf) }
  

Elixir

pdf = StarkBank.DarfPayment.pdf!("5116552814788608")

file = File.open!("iss-payment.pdf", [:write])
IO.binwrite(file, pdf)
File.close(file)
  

C#

byte[] pdf = StarkBank.DarfPayment.Pdf("5116552814788608");

System.IO.File.WriteAllBytes("iss-payment.pdf", pdf);
  

Go

package main

import (
    "fmt"
    "github.com/starkbank/sdk-go/starkbank/darfpayment"
)

func main() {

    pdf, err := darfpayment.Pdf("5116552814788608", nil)
    if err.Errors != nil {
        for _, e := range err.Errors {
            fmt.Printf("code: %s, message: %s", e.Code, e.Message)
        }
    }

    errFile := ioutil.WriteFile("darfpayment.pdf", pdf, 0666)
    if errFile != nil {
        fmt.Print(errFile)
    }
}
  

Clojure

(clojure.java.io/copy
  (starkbank.darf-payment/pdf "5116552814788608")
  (clojure.java.io/file "iss-payment.pdf"))
  

Curl

curl --location --request GET '{{baseUrl}}/v2/darf-payment/5116552814788608/pdf' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}'
  

List Darf Payment Logs

Get a paged list of all Darf payment logs. A log tracks a change in the payment entity according to its life cycle.

Parameters

after OPTIONAL

Filter entities created after this date.

before OPTIONAL

Filter entities created before this date.

cursor OPTIONAL

String used to get the next batch of results. Our SDKs handle this for you.

limit OPTIONAL

Number of results per cursor. Max = 100.

paymentIds OPTIONAL

Array of payment ids linked to the desired logs.

types OPTIONAL

Filters logs by log types.

ENDPOINT
GET /v2/darf-payment/log
REQUEST

Python

import starkbank

logs = starkbank.darfpayment.log.query(
    payment_ids=["5116552814788608"]
)

for log in logs:
    print(log)
  

Javascript

const starkbank = require('starkbank');

(async() => {
    let logs = await starkbank.darfPayment.log.query({
        paymentIds:['5116552814788608'],
    });

    for await (let log of logs) {
        console.log(log);
    }
})();
  

PHP

StarkBank\DarfPayment;

$logs = StarkBank\DarfPayment\Log::query([
    "paymentIds" => ["5116552814788608"]
]);

foreach($logs as $log){
    print_r($log);
}
  

Java

import com.starkbank.*;
import com.starkbank.utils.Generator;
import java.util.HashMap;

HashMap<String, Object> params = new HashMap<>();
params.put("paymentIds", "5116552814788608");
Generator<DarfPayment.Log> logs = DarfPayment.Log.query(params);

for (DarfPayment.Log log : logs){
    System.out.println(log);
}
  

Ruby

require('starkbank')

logs = StarkBank::DarfPayment::Log.query(
    payment_ids: ['5116552814788608']
)

logs.each do |log|
    puts log
end
  

Elixir

logs = StarkBank.DarfPayment.Log.query!(
    payment_ids: ["5116552814788608"]
)

for log <- logs do
    log |> IO.inspect
end
  

C#

using System;
using System.Collections.Generic;

IEnumerable<StarkBank.DarfPayment.Log> logs = StarkBank.DarfPayment.Log.Query(
    paymentIds: new List<string> { "5116552814788608" }
);

foreach(StarkBank.DarfPayment.Log log in logs)
{
    Console.WriteLine(log);
}
  

Go

package main

import (
    "fmt"
    "github.com/starkbank/sdk-go/starkbank/darfpayment/log"
)

func main() {

    var params = map[string]interface{}{}
    params["paymentIds"] = []string{"5116552814788608"}
    
    logs, errorChannel := log.Query(params, nil)

    loop:
    for {
        select {
        case err := <-errorChannel:
            if err.Errors != nil {
                for _, e := range err.Errors {
                    fmt.Printf("code: %s, message: %s", e.Code, e.Message)
                }
            }
        case log, ok := <-logs:
            if !ok {
                break loop
            }
            fmt.Printf("%+v", log)
        }
    }
}
  

Clojure

(def logs
  (starkbank.darf-payment.log/query
    {
      :payment-ids ["5116552814788608"]
    }))
(dorun (map println logs))
  

Curl

curl --location --request GET '{{baseUrl}}/v2/darf-payment/log?paymentIds=5116552814788608' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}'
  
RESPONSE

Python

Log(
    created=2021-02-20 14:39:15.565841,
    errors=[],
    id=5146850856271872,
    payment=DarfPayment(
        amount=1280,
        competence=2021-03-01 02:59:59.999999,
        created=2021-02-20 14:39:15.565841,
        description=take my money,
        due=2021-05-12 02:59:59.999999,
        fee=0,
        fine_amount=12,
        id=5116552814788608,
        interest_amount=34,
        nominal_amount=1234,
        reference_number=2340978970,
        revenue_code=1240,
        scheduled=2021-03-012 15:00:00,
        status=created,
        tags=['darf', 'making money'],
        tax_id=12.345.678/0001-95,
        transaction_ids=[],
        updated=2021-02-20 14:39:15.565841
    ),
    type=created
)
  

Javascript

Log {
    id: '5146850856271872',
    created: '2021-02-20T14:40:10.977921+00:00'
    type: 'created',
    errors: [],
    payment: {
        id: '5116552814788608',
        revenueCode: '1240',
        taxId: '12.345.678/0001-95',
        competence: '2021-03-01T02:59:59.999999+00:00',
        referenceNumber: '2340978970',
        fineAmount: 12,
        interestAmount: 34,
        due: '2021-05-12T02:59:59.999999+00:00',
        description: 'take my money',
        tags: [ 'darf', 'making money' ],
        scheduled: '2021-03-12T15:00:00+00:00',
        status: 'created',
        amount: 1280,
        nominalAmount: 1234,
        transactionIds: [],
        fee: 0,
        updated: '2021-02-20T14:40:10.977929+00:00',
        created: '2021-02-20T14:40:10.977921+00:00'
    } 
}
  

PHP

StarkBank\DarfPayment\Log Object
(
    [id] => 5146850856271872
    [type] => created
    [errors] => Array
        (
        )

    [payment] => Array
            (
                [id] => 5116552814788608
                [revenueCode] => 1240
                [taxId] => 12.345.678/0001-95
                [competence] => DateTime Object
                    (
                        [date] => 2021-03-01 02:59:59.999999
                        [timezone_type] => 1
                        [timezone] => +00:00
                    )

                [referenceNumber] => 2340978970
                [fineAmount] => 12
                [interestAmount] => 34
                [due] => DateTime Object
                    (
                        [date] => 2021-05-12 02:59:59.999999
                        [timezone_type] => 1
                        [timezone] => +00:00
                    )

                [description] => take my money
                [tags] => Array
                    (
                        [0] => darf
                        [1] => making money
                    )

                [transactionIds] => Array
                    (
                    )

                [scheduled] => DateTime Object
                    (
                        [date] => 2021-03-12 15:00:00.000000
                        [timezone_type] => 1
                        [timezone] => +00:00
                    )

                [status] => created
                [amount] => 1280
                [nominalAmount] => 1234
                [fee] => 0
                [updated] => DateTime Object
                    (
                        [date] => 2021-02-20 20:32:03.626083
                        [timezone_type] => 1
                        [timezone] => +00:00
                    )

                [created] => DateTime Object
                    (
                        [date] => 2021-02-20 20:32:03.626074
                        [timezone_type] => 1
                        [timezone] => +00:00
                    )

            )

    [created] => DateTime Object
        (
            [date] => 2021-02-20 20:32:03.626074
            [timezone_type] => 1
            [timezone] => +00:00
        )

)
  

Java

Log({
    "created": "2021-02-20T16:17:20.291788+00:00",
    "type": "created",
    "errors": [],
    "payment": {
        "description": "take my money",
        "revenueCode": "1240",
        "taxId": "12.345.678/0001-95",
        "competence": "2021-03-01T02:59:59.999999+00:00",
        "nominalAmount": 1234,
        "fineAmount": 12,
        "interestAmount": 34,
        "due": "2021-05-12T02:59:59.999999+00:00",
        "referenceNumber": "2340978970",
        "scheduled": "2021-03-12T16:17:20.291274+00:00",
        "tags": [
            "darf",
            "making money"
        ],
        "status": "created",
        "amount": "1280",
        "fee": "0",
        "transactionIds": [],
        "updated": "2021-02-20T16:17:20.291796+00:00",
        "created": "2021-02-20T16:17:20.291788+00:00",
        "id": "5116552814788608"
    },
    "id": "5146850856271872"
})
  

Ruby

log(
    id: 5146850856271872,
    type: created,
    errors: [],
    payment: darfpayment(
        id: 5116552814788608,
        revenue_code: 1240,
        tax_id: 12.345.678/0001-95,
        competence: 2021-03-01T02:59:59+00:00,
        reference_number: 2340978970,
        fine_amount: 12,
        interest_amount: 34,
        due: 2021-05-12T02:59:59+00:00,
        description: take my money,
        tags: ["darf", "making money"],
        transaction_ids: [],
        scheduled: 2021-03-12T15:00:00+00:00,
        status: created,
        amount: 1280,
        nominal_amount: 1234,
        fee: 0,
        updated: 2021-02-20T16:30:21+00:00,
        created: 2021-02-20T16:30:21+00:00
    ),
    created: 2021-02-20T16:30:21+00:00
)
  

Elixir

%StarkBank.DarfPayment.Log{
    id: "5146850856271872",
    payment: %StarkBank.DarfPayment{
        revenue_code: "1240",
        tax_id: "12.345.678/0001-95",
        competence: ~U[2021-03-01 02:59:59.999999Z],
        reference_number: "2340978970",
        fine_amount: 12,
        interest_amount: 34,
        due: ~U[2021-05-12 02:59:59.999999Z],
        description: "take my money",
        tags: ["darf", "making money"],
        transaction_ids: [],
        scheduled: ~U[2021-03-12 20:44:50.956510Z],
        status: "created",
        amount: 1280,
        nominal_amount: 1234,
        id: "5116552814788608",
        updated: ~U[2021-02-20 20:44:50.957006Z],
        created: ~U[2021-02-20 20:44:50.956999Z]
    },
    errors: [],
    type: "created",
    created: ~U[2021-02-20 20:44:50.956999Z]
}
  

C#

Log(
    Type: created,
    Created: 20/02/2021 13:45:51,
    Errors: {  },
    Payment: DarfPayment(
        RevenueCode: 1240,
        TaxID: 12.345.678/0001-95,
        Description: take my money,
        Competence: 01/03/2021 23:59:59,
        FineAmount: 12,
        InterestAmount: 34,
        Due: 12/05/2021 12:00:00,
        ReferenceNumber: 2340978970,
        NominalAmount: 1234,
        Tags: { darf, making money },
        TransactionIds: {  },
        Amount: 1280,
        Fee: 0,
        Created: 20/02/2021 13:45:51,
        Updated: 20/02/2021 13:45:51,
        Scheduled: 12/03/2021 12:00:00,
        Status: created,
        ID: 5116552814788608
    ),
    ID: 5146850856271872
)
  

Go

{
    Id:5146850856271872 
    Payment:{
        Id:5116552814788608 
        RevenueCode:1240
        TaxId:12.345.678/0001-95
        Competence:2021-03-01 11:16:31.994675 +0000 +0000
        ReferenceNumber:2340978970
        FineAmount:12
        InterestAmount:34
        Due:2021-05-12 11:16:31.994675 +0000 +0000 
        Description:take my money
        Tags:[darf making money]
        TransactionIds:[]
        Scheduled:2021-03-12T15:00:00+00:00
        Status:created
        Amount:1280
        NominalAmount:1234
        Fee:0
        Updated:2021-02-20 11:16:31.994675 +0000 +0000 
        Created:2021-02-20 17:18:12.974157 +0000 +0000
    }
    Errors:[] 
    Type:created 
    Created:2021-02-20 17:18:12.974157 +0000 +0000
}
  

Clojure

{:id "5146850856271872",
 :created "2023-02-07T13:45:51.076303Z+00:00",
 :errors [],
 :type "created",
 :payment
 {:id: '5116552814788608',
 :revenue-code: '1240',
 :tax-id: '12.345.678/0001-95',
 :competence: '2021-03-01T02:59:59.999999+00:00',
 :reference-number: '2340978970',
 :fine-amount: 12,
 :interest-amount: 34,
 :due: '2021-05-12T02:59:59.999999+00:00',
 :description: 'take my money',
 :tags: [ 'darf', 'making money' ],
 :scheduled: '2021-03-12T15:00:00+00:00',
 :status: 'created',
 :amount: 1280,
 :nominal-amount: 1234,
 :fee: 0,
 :updated: '2021-02-20T14:40:10.977929+00:00',
 :created: '2021-02-20T14:40:10.977921+00:00''}}
  

Curl

{
    "cursor": null,
    "logs": [
        {
            "created": "2023-02-07T16:51:04.581748+00:00",
            "errors": [],
            "id": "5146850856271872",
            "payment": {
                "amount": 1280,
                "competence": "2021-03-01T02:59:59.999999+00:00",
                "created": "2021-02-20T16:51:04.528640+00:00",
                "description": "take my money",
                "due": "2021-05-12T02:59:59.999999+00:00",
                "fee": 0,
                "fineAmount": 12,
                "id": "5116552814788608",
                "interestAmount": 34,
                "nominalAmount": 1234,
                "referenceNumber": "2340978970",
                "revenueCode": "1240",
                "scheduled": "2021-03-12T15:00:00+00:00",
                "status": "created",
                "tags": ["darf", "making money"],
                "taxId": "12.345.678/0001-95",
                "transactionIds": [],
                "updated": "2021-02-20T16:51:04.528650+00:00"
            },
            "type": "created"
        }
    ]
}
  

Get a Darf Payment Log

Get a single Darf payment log by its id.

Parameters

id REQUIRED

Id of the log entity

fields OPTIONAL

List of strings to filter response JSON keys. Not available in the SDKs.

ENDPOINT
GET /v2/darf-payment/log/:id
REQUEST

Python

import starkbank

log = starkbank.darfpayment.log.get("5146850856271872")

print(log)
  

Javascript

const starkbank = require('starkbank');

(async() => {
    let log = await starkbank.darfPayment.log.get('5146850856271872');
    console.log(log);
})();
  

PHP

use StarkBank\DarfPayment;

$log = StarkBank\DarfPayment\Log::get("5146850856271872");

print_r($log);
  

Java

import com.starkbank.*;

DarfPayment.Log log = DarfPayment.Log.get("5146850856271872");

System.out.println(log);
  

Ruby

require('starkbank')

log = StarkBank::DarfPayment::Log.get('5146850856271872')

puts log
  

Elixir

log = StarkBank.DarfPayment.Log.get!("5146850856271872")

log |> IO.inspect
  

C#

using System;

StarkBank.DarfPayment.Log log = StarkBank.DarfPayment.Log.Get("5146850856271872");

Console.WriteLine(log);
  

Go

package main

import (
    "fmt"
    "github.com/starkbank/sdk-go/starkbank/darfpayment/log"
)

func main() {

    log, err := log.Get("5146850856271872", nil)
    if err.Errors != nil {
        for _, e := range err.Errors {
            fmt.Printf("code: %s, message: %s", e.Code, e.Message)
        }
    }

    fmt.Printf("%+v", log)
}
  

Clojure

(def log (starkbank.darf-payment.log/get "5146850856271872"))
(println log)
  

Curl

curl --location --request GET '{{baseUrl}}/v2/darf-payment/log/5146850856271872' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}'
  
RESPONSE

Python

Log(
    created=2021-02-20 14:39:15.565841,
    errors=[],
    id=5146850856271872,
    payment=DarfPayment(
        amount=1280,
        competence=2021-03-01 02:59:59.999999,
        created=2021-02-20 14:39:15.565841,
        description=take my money,
        due=2021-05-12 02:59:59.999999,
        fee=0,
        fine_amount=12,
        id=5116552814788608,
        interest_amount=34,
        nominal_amount=1234,
        reference_number=2340978970,
        revenue_code=1240,
        scheduled=2021-03-012 15:00:00,
        status=created,
        tags=['darf', 'making money'],
        tax_id=12.345.678/0001-95,
        transaction_ids=[],
        updated=2021-02-20 14:39:15.565841
    ),
    type=created
)
  

Javascript

Log {
    id: '5146850856271872',
    created: '2021-02-20T14:40:10.977921+00:00'
    type: 'created',
    errors: [],
    payment: {
        id: '5116552814788608',
        revenueCode: '1240',
        taxId: '12.345.678/0001-95',
        competence: '2021-03-01T02:59:59.999999+00:00',
        referenceNumber: '2340978970',
        fineAmount: 12,
        interestAmount: 34,
        due: '2021-05-12T02:59:59.999999+00:00',
        description: 'take my money',
        tags: [ 'darf', 'making money' ],
        scheduled: '2021-03-12T15:00:00+00:00',
        status: 'created',
        amount: 1280,
        nominalAmount: 1234,
        transactionIds: [],
        fee: 0,
        updated: '2021-02-20T14:40:10.977929+00:00',
        created: '2021-02-20T14:40:10.977921+00:00'
    } 
}
  

PHP

StarkBank\DarfPayment\Log Object
(
    [id] => 5146850856271872
    [type] => created
    [errors] => Array
        (
        )

    [payment] => Array
            (
                [id] => 5116552814788608
                [revenueCode] => 1240
                [taxId] => 12.345.678/0001-95
                [competence] => DateTime Object
                    (
                        [date] => 2021-03-01 02:59:59.999999
                        [timezone_type] => 1
                        [timezone] => +00:00
                    )

                [referenceNumber] => 2340978970
                [fineAmount] => 12
                [interestAmount] => 34
                [due] => DateTime Object
                    (
                        [date] => 2021-05-12 02:59:59.999999
                        [timezone_type] => 1
                        [timezone] => +00:00
                    )

                [description] => take my money
                [tags] => Array
                    (
                        [0] => darf
                        [1] => making money
                    )

                [transactionIds] => Array
                    (
                    )

                [scheduled] => DateTime Object
                    (
                        [date] => 2021-03-12 15:00:00.000000
                        [timezone_type] => 1
                        [timezone] => +00:00
                    )

                [status] => created
                [amount] => 1280
                [nominalAmount] => 1234
                [fee] => 0
                [updated] => DateTime Object
                    (
                        [date] => 2021-02-20 20:32:03.626083
                        [timezone_type] => 1
                        [timezone] => +00:00
                    )

                [created] => DateTime Object
                    (
                        [date] => 2021-02-20 20:32:03.626074
                        [timezone_type] => 1
                        [timezone] => +00:00
                    )
            )

    [created] => DateTime Object
        (
            [date] => 2021-02-20 20:32:03.626074
            [timezone_type] => 1
            [timezone] => +00:00
        )

)
  

Java

Log({
    "created": "2021-02-20T16:17:20.291788+00:00",
    "type": "created",
    "errors": [],
    "payment": {
        "description": "take my money",
        "revenueCode": "1240",
        "taxId": "12.345.678/0001-95",
        "competence": "2021-03-01T02:59:59.999999+00:00",
        "nominalAmount": 1234,
        "fineAmount": 12,
        "interestAmount": 34,
        "due": "2021-05-12T02:59:59.999999+00:00",
        "referenceNumber": "2340978970",
        "scheduled": "2021-03-12T16:17:20.291274+00:00",
        "tags": [
            "darf",
            "making money"
        ],
        "status": "created",
        "amount": "1280",
        "fee": "0",
        "transactionIds": [],
        "updated": "2021-02-20T16:17:20.291796+00:00",
        "created": "2021-02-20T16:17:20.291788+00:00",
        "id": "5116552814788608"
    },
    "id": "5146850856271872"
})
  

Ruby

log(
    id: 5146850856271872,
    type: created,
    errors: [],
    payment: darfpayment(
        id: 5116552814788608,
        revenue_code: 1240,
        tax_id: 12.345.678/0001-95,
        competence: 2021-03-01T02:59:59+00:00,
        reference_number: 2340978970,
        fine_amount: 12,
        interest_amount: 34,
        due: 2021-05-12T02:59:59+00:00,
        description: take my money,
        tags: ["darf", "making money"],
        transaction_ids: [],
        scheduled: 2021-03-12T15:00:00+00:00,
        status: created,
        amount: 1280,
        nominal_amount: 1234,
        fee: 0,
        updated: 2021-02-20T16:30:21+00:00,
        created: 2021-02-20T16:30:21+00:00
    ),
    created: 2021-02-20T16:30:21+00:00
)
  

Elixir

%StarkBank.DarfPayment.Log{
    id: "5146850856271872",
    payment: %StarkBank.DarfPayment{
        revenue_code: "1240",
        tax_id: "12.345.678/0001-95",
        competence: ~U[2021-03-01 02:59:59.999999Z],
        reference_number: "2340978970",
        fine_amount: 12,
        interest_amount: 34,
        due: ~U[2021-05-12 02:59:59.999999Z],
        description: "take my money",
        tags: ["darf", "making money"],
        transaction_ids: [],
        scheduled: ~U[2021-03-12 20:44:50.956510Z],
        status: "created",
        amount: 1280,
        nominal_amount: 1234,
        id: "5116552814788608",
        updated: ~U[2021-02-20 20:44:50.957006Z],
        created: ~U[2021-02-20 20:44:50.956999Z]
    },
    errors: [],
    type: "created",
    created: ~U[2021-02-20 20:44:50.956999Z]
}
  

C#

Log(
    Type: created,
    Created: 20/02/2021 13:45:51,
    Errors: {  },
    Payment: DarfPayment(
        RevenueCode: 1240,
        TaxID: 12.345.678/0001-95,
        Description: take my money,
        Competence: 01/03/2021 23:59:59,
        FineAmount: 12,
        InterestAmount: 34,
        Due: 12/05/2021 12:00:00,
        ReferenceNumber: 2340978970,
        NominalAmount: 1234,
        Tags: { darf, making money },
        TransactionIds: {  },
        Amount: 1280,
        Fee: 0,
        Created: 20/02/2021 13:45:51,
        Updated: 20/02/2021 13:45:51,
        Scheduled: 12/03/2021 12:00:00,
        Status: created,
        ID: 5116552814788608
    ),
    ID: 5146850856271872
)
  

Go

{
    Id:5146850856271872 
    Payment:{
        Id:5116552814788608 
        RevenueCode:1240
        TaxId:12.345.678/0001-95
        Competence:2021-03-01 11:16:31.994675 +0000 +0000
        ReferenceNumber:2340978970
        FineAmount:12
        InterestAmount:34
        Due:2021-05-12 11:16:31.994675 +0000 +0000 
        Description:take my money
        Tags:[darf making money]
        TransactionIds:[]
        Scheduled:2021-03-12T15:00:00+00:00
        Status:created
        Amount:1280
        NominalAmount:1234
        Fee:0
        Updated:2021-02-20 11:16:31.994675 +0000 +0000 
        Created:2021-02-20 17:18:12.974157 +0000 +0000
    }
    Errors:[] 
    Type:created 
    Created:2021-02-20 17:18:12.974157 +0000 +0000
}
  

Clojure

{:id "5146850856271872",
 :created "2023-02-07T13:45:51.076303Z+00:00",
 :errors [],
 :type "created",
 :payment
 {:id: '5116552814788608',
 :revenue-code: '1240',
 :tax-id: '12.345.678/0001-95',
 :competence: '2021-03-01T02:59:59.999999+00:00',
 :reference-number: '2340978970',
 :fine-amount: 12,
 :interest-amount: 34,
 :due: '2021-05-12T02:59:59.999999+00:00',
 :description: 'take my money',
 :tags: [ 'darf', 'making money' ],
 :scheduled: '2021-03-12T15:00:00+00:00',
 :status: 'created',
 :amount: 1280,
 :nominal-amount: 1234,
 :fee: 0,
 :updated: '2021-02-20T14:40:10.977929+00:00',
 :created: '2021-02-20T14:40:10.977921+00:00''}}
  

Curl

{
    "cursor": null,
    "logs": [
        {
            "created": "2023-02-07T16:51:04.581748+00:00",
            "errors": [],
            "id": "5146850856271872",
            "payment": {
                "amount": 1280,
                "competence": "2021-03-01T02:59:59.999999+00:00",
                "created": "2021-02-20T16:51:04.528640+00:00",
                "description": "take my money",
                "due": "2021-05-12T02:59:59.999999+00:00",
                "fee": 0,
                "fineAmount": 12,
                "id": "5116552814788608",
                "interestAmount": 34,
                "nominalAmount": 1234,
                "referenceNumber": "2340978970",
                "revenueCode": "1240",
                "scheduled": "2021-03-12T15:00:00+00:00",
                "status": "created",
                "tags": ["darf", "making money"],
                "taxId": "12.345.678/0001-95",
                "transactionIds": [],
                "updated": "2021-02-20T16:51:04.528650+00:00"
            },
            "type": "created"
        }
    ]
}
  

Payment Preview

A Payment Preview is used to get information from multiple types of payment to confirm any information before actually paying. If the 'scheduled' parameter is not informed, today will be assumed as the intended payment date. Right now, the 'scheduled' parameter only has effect on BrcodePreviews.

This resource is able to preview the following types of payment: "brcode-payment", "boleto-payment", "utility-payment" and "tax-payment"

The Payment Preview object

Attributes

id STRING

Main identification of the payment (BR Code, line, or bar code).

scheduled STRING

Intended payment date. Example: "2020-03-10".

type STRING

Payment type. Options: "brcode-payment", "boleto-payment", "utility-payment", "tax-payment".

Create a Payment Preview

Create a payment preview to get information from a payment.

Parameters

id REQUIRED

Main identification of the payment. This should be the BR Code for Pix payments and lines or bar codes for payment slips. Example: '34191.09008 63571.277308 71444.640008 5 81960000000062'.

scheduled OPTIONAL

Intended payment date. Right now, this parameter only has effect on BrcodePreviews. Example: '2020-03-10'

ENDPOINT
POST /v2/payment-preview
REQUEST

Python

import starkbank

previews = starkbank.paymentpreview.create([
    starkbank.PaymentPreview(
        id="00020126580014br.gov.bcb.pix0136a629532e-7693-4846-852d-1bbff817b5a8520400005303986540510.005802BR5908T'Challa6009Sao Paulo62090505123456304B14A",
        scheduled="2023-01-29"
    )
])

for preview in previews:
    print(preview)
  

Javascript

const starkbank = require('starkbank');

let previews = await starkbank.paymentPreview.create([
    new starkbank.PaymentPreview({
        id: "00020126580014br.gov.bcb.pix0136a629532e-7693-4846-852d-1bbff817b5a8520400005303986540510.005802BR5908T'Challa6009Sao Paulo62090505123456304B14A",
        scheduled: '2023-01-29'
    })
]);

for (let preview of previews) {
    console.log(preview);
}
  

PHP

use StarkBank\PaymentPreview;

$previews = PaymentPreview::create([
    new PaymentPreview(["id" => "00020126580014br.gov.bcb.pix0136a629532e-7693-4846-852d-1bbff817b5a8520400005303986540510.005802BR5908T'Challa6009Sao Paulo62090505123456304B14A", "scheduled" => "2023-01-29"])
]);
foreach ($previews as $preview) {
    print_r($preview);
}
  

Java

import com.starkbank.*;
import java.util.HashMap;

List<PaymentPreview> previews = new ArrayList<>();
previews.add(new PaymentPreview(new HashMap<String, Object>(){{
    put("id", "00020126580014br.gov.bcb.pix0136a629532e-7693-4846-852d-1bbff817b5a8520400005303986540510.005802BR5908T'Challa6009Sao Paulo62090505123456304B14A");
    put("scheduled", "2023-01-29");
}}));

previews = (List<PaymentPreview>) PaymentPreview.create(previews);

for (PaymentPreview preview : previews) {
    System.out.println(preview);
}
  

Ruby

require('starkbank')

previews = StarkBank::PaymentPreview.create(
    [
        StarkBank::PaymentPreview.new(
            id: '00020126580014br.gov.bcb.pix0136a629532e-7693-4846-852d-1bbff817b5a8520400005303986540510.005802BR5908T'Challa6009Sao Paulo62090505123456304B14A',
            scheduled: '2023-01-29'
        )
    ]
)

previews.each do |preview|
    puts preview
end
  

Elixir

previews = StarkBank.PaymentPreview.create!(
    [
        %StarkBank.PaymentPreview{
            id: "00020126580014br.gov.bcb.pix0136a629532e-7693-4846-852d-1bbff817b5a8520400005303986540510.005802BR5908T'Challa6009Sao Paulo62090505123456304B14A",
            scheduled: "2023-01-29"
        }
    ]
) |> IO.inspect
  

C#

using System;

List<PaymentPreview> previews = PaymentPreview.Create(new List<PaymentPreview>
{
    new PaymentPreview(
        id: "00020126580014br.gov.bcb.pix0136a629532e-7693-4846-852d-1bbff817b5a8520400005303986540510.005802BR5908T'Challa6009Sao Paulo62090505123456304B14A",
        scheduled: new DateTime(2023, 1, 29)
    )
});

foreach (StarkBank.PaymentPreview preview in previews)
{
    Console.WriteLine(preview);
}
  

Go

package main

import (
    "fmt"
    "github.com/starkbank/sdk-go/starkbank/paymentpreview"
)

func main() {

    previews, err := paymentpreview.Create(
        []paymentpreview.PaymentPreview{
            {
                Id: "00020126580014br.gov.bcb.pix0136a629532e-7693-4846-852d-1bbff817b5a8520400005303986540510.005802BR5908T'Challa6009Sao Paulo62090505123456304B14A",
                Scheduled: "2023-01-29",
            },
        }, nil)
    if err.Errors != nil {
        for _, e := range err.Errors {
            fmt.Printf("code: %s, message: %s", e.Code, e.Message)
        }
    }

    for _, preview := range previews {
        fmt.Printf("%+v", preview)
    }
}
  

Clojure

(def previews
[
    {
        :id "00020126580014br.gov.bcb.pix0136a629532e-7693-4846-852d-1bbff817b5a8520400005303986540510.005802BR5908T'Challa6009Sao Paulo62090505123456304B14A"
        :scheduled "2023-01-29"
    }
])

(def payment-previews (payment-preview/create previews))

(doseq [preview payment-previews]
(println preview))
  

Curl

curl --location --request POST '{{baseUrl}}/v2/payment-preview' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}' 
--header 'Content-Type: application/json' 
--data-raw '{
    "previews": [
        {
            "id": "00020126580014br.gov.bcb.pix0136a629532e-7693-4846-852d-1bbff817b5a8520400005303986540510.005802BR5908T'Challa6009Sao Paulo62090505123456304B14A",
            "scheduled": "2023-01-29"
        }
    ]
}'
  
RESPONSE

Python

PaymentPreview(
    id=00020126580014br.gov.bcb.pix0136a629532e-7693-4846-852d-1bbff817b5a8520400005303986540510.005802BR5908T'Challa6009Sao Paulo62090505123456304B14A,
    payment=BrcodePreview(
        account_type=savings,
        allow_change=False,
        amount=1000,
        bank_code=01705236,
        cash_amount=0,
        cashier_bank_code=,
        cashier_type=,
        description=Descrição para o pagador,
        discount_amount=0,
        fine_amount=0,
        interest_amount=0,
        key_id=35719950-ac93-4bab-8ad6-56d7fb63afd2,
        name=Humberto EI,
        nominal_amount=1000,
        reconciliation_id=12345,
        reduction_amount=0,
        status=created,
        tax_id=27.564.801/0001-36
    ),
    scheduled=2023-01-29,
    type=brcode-payment
)
  

Javascript

PaymentPreview {
    id: "00020126580014br.gov.bcb.pix0136a629532e-7693-4846-852d-1bbff817b5a8520400005303986540510.005802BR5908T'Challa6009Sao Paulo62090505123456304B14A",
    scheduled: '2023-01-29',
    type: 'brcode-payment',
    payment: {
        accountType: 'savings',
        allowChange: false,
        amount: 1000,
        bankCode: '01705236',
        cashAmount: 0,
        cashierBankCode: '',
        cashierType: '',
        description: 'Descrição para o pagador',
        discountAmount: 0,
        fineAmount: 0,
        interestAmount: 0,
        keyId: '35719950-ac93-4bab-8ad6-56d7fb63afd2',
        name: 'Humberto EI',
        nominalAmount: 1000,
        reconciliationId: '12345',
        reductionAmount: 0,
        status: 'created',
        taxId: '27.564.801/0001-36'
    }
}
  

PHP

StarkBank\PaymentPreview Object
(
    [id] => 00020126580014br.gov.bcb.pix0136a629532e-7693-4846-852d-1bbff817b5a8520400005303986540510.005802BR5908T'Challa6009Sao Paulo62090505123456304B14A
    [scheduled] => DateTime Object
        (
            [date] => 2023-01-29 00:00:00.000000
            [timezone_type] => 3
            [timezone] => UTC
        )

    [type] => brcode-payment
    [payment] => StarkBank\PaymentPreview\BrcodePreview Object
        (
            [accountType] => savings
            [allowChange] => false
            [amount] => 1000
            [bankCode] => 01705236
            [cashAmount] => 0
            [cashierBankCode] =>
            [cashierType] =>
            [description] => Descrição para o pagador
            [discountAmount] => 0
            [fineAmount] => 0
            [interestAmount] => 0
            [keyId] => 35719950-ac93-4bab-8ad6-56d7fb63afd2
            [name] => Humberto EI
            [nominalAmount] => 1000
            [reconciliationId] => 12345
            [reductionAmount] => 0
            [status] => created
            [taxId] => 27.564.801/0001-36
        )

)
  

Java

PaymentPreview({
    "scheduled": "2023-01-29",
    "type": "brcode-payment",
    "payment": {
        "accountType": "savings",
        "allowChange": false,
        "amount": 1000.0,
        "bankCode": "01705236",
        "cashAmount": 0.0,
        "cashierBankCode": "",
        "cashierType": "",
        "description": "Descrição para o pagador",
        "discountAmount": 0.0,
        "fineAmount": 0.0,
        "interestAmount": 0.0,
        "keyId": "35719950-ac93-4bab-8ad6-56d7fb63afd2",
        "name": "Humberto EI",
        "nominalAmount": 1000.0,
        "reconciliationId": "12345",
        "reductionAmount": 0.0,
        "status": "created",
        "taxId": "27.564.801/0001-36"
    },
    "id": "00020126580014br.gov.bcb.pix0136a629532e-7693-4846-852d-1bbff817b5a8520400005303986540510.005802BR5908T'Challa6009Sao Paulo62090505123456304B14A"
})
  

Ruby

paymentpreview(
    id: 00020126580014br.gov.bcb.pix0136a629532e-7693-4846-852d-1bbff817b5a8520400005303986540510.005802BR5908T'Challa6009Sao Paulo62090505123456304B14A,
    scheduled: 2023-01-29,
    type: brcode-payment,
    payment: brcodepreview(
        account_type: savings,
        allow_change: false,
        amount: 1000,
        bank_code: 01705236,
        cash_amount: 0,
        cashier_bank_code: nil,
        cashier_type: nil,
        description: Descrição para o pagador,
        discount_amount: 0,
        fine_amount: 0,
        interest_amount: 0,
        key_id: 35719950-ac93-4bab-8ad6-56d7fb63afd2,
        name: Humberto EI,
        nominal_amount: 1000,
        reconciliation_id: 12345,
        reduction_amount: 0,
        status: created,
        tax_id: 27.564.801/0001-36
    )
)
  

Elixir

%StarkBank.PaymentPreview{
    id: "00020126580014br.gov.bcb.pix0136a629532e-7693-4846-852d-1bbff817b5a8520400005303986540510.005802BR5908T'Challa6009Sao Paulo62090505123456304B14A",
    scheduled: ~D[2023-01-29],
    type: "brcode-payment",
    payment: %StarkBank.PaymentPreview.BrcodePreview{
        account_type: "savings",
        allow_change: false,
        amount: 1000,
        bank_code: "01705236",
        cash_amount: 0,
        cashier_bank_code: "",
        cashier_type: "",
        description: "Descrição para o pagador",
        discount_amount: 0,
        fine_amount: 0,
        interest_amount: 0,
        key_id: "35719950-ac93-4bab-8ad6-56d7fb63afd2",
        name: "Humberto EI",
        nominal_amount: 1000,
        reconciliation_id: "12345",
        reduction_amount: 0,
        status: "created",
        tax_id: "27.564.801/0001-36"
    }
}
  

C#

PaymentPreview(
    ID: 00020126580014br.gov.bcb.pix0136a629532e-7693-4846-852d-1bbff817b5a8520400005303986540510.005802BR5908T'Challa6009Sao Paulo62090505123456304B14A
    Scheduled: 29/01/2023
    Type: brcode-payment
    Payment: PaymentPreview.BrcodePreview(
        AccountType: savings
        AllowChange: false
        Amount: 1000
        BankCode: 01705236
        CashAmount: 0
        CashierBankCode:
        CashierType:
        Description: Descrição para o pagador
        DiscountAmount: 0
        FineAmount: 0
        InterestAmount: 0
        KeyId: 35719950-ac93-4bab-8ad6-56d7fb63afd2
        Name: Humberto EI
        NominalAmount: 1000
        ReconciliationId: 12345
        ReductionAmount: 0
        Status: created
        TaxId: 27.564.801/0001-36
    )
)
  

Go

{
    Id:00020126580014br.gov.bcb.pix0136a629532e-7693-4846-852d-1bbff817b5a8520400005303986540510.005802BR5908T'Challa6009Sao Paulo62090505123456304B14A
    Payment:{
        AccountType:savings
        AllowChange:false
        Amount:1000
        BankCode:01705236
        CashAmount:0
        CashierBankCode:
        CashierType:
        Description:Descrição para o pagador
        DiscountAmount:0
        FineAmount:0
        InterestAmount:0
        KeyId:35719950-ac93-4bab-8ad6-56d7fb63afd2
        Name:Humberto EI
        NominalAmount:1000
        ReconciliationId:12345
        ReductionAmount:0
        Status:created
        TaxId:27.564.801/0001-36
    }
    Type:brcode-payment
    Scheduled:2023-01-29 00:00:00 +0000 UTC
}
  

Clojure

{
    :id "00020126580014br.gov.bcb.pix0136a629532e-7693-4846-852d-1bbff817b5a8520400005303986540510.005802BR5908T'Challa6009Sao Paulo62090505123456304B14A",
    :payment {
        :account-type "savings",
        :allow-change false,
        :amount 1000,
        :bank-code "01705236",
        :cash-amount 0,
        :cashier-bank-code "",
        :cashier-type "",
        :description "Descrição para o pagador",
        :discount-amount 0,
        :fine-amount 0,
        :interest-amount 0,
        :key-id "35719950-ac93-4bab-8ad6-56d7fb63afd2",
        :name "Humberto EI",
        :nominal-amount 1000,
        :reconciliation-id "12345",
        :reduction-amount 0,
        :status "created",
        :tax-id "27.564.801/0001-36"
    },
    :scheduled "2023-01-29",
    :type "brcode-payment"
}
  

Curl

{
    "previews": [
        {
            "id": "00020126580014br.gov.bcb.pix0136a629532e-7693-4846-852d-1bbff817b5a8520400005303986540510.005802BR5908T'Challa6009Sao Paulo62090505123456304B14A",
            "payment": {
                "accountType": "savings",
                "allowChange": false,
                "amount": 1000,
                "bankCode": "01705236",
                "cashAmount": 0,
                "cashierBankCode": "",
                "cashierType": "",
                "description": "Descrição para o pagador",
                "discountAmount": 0,
                "fineAmount": 0,
                "interestAmount": 0,
                "keyId": "35719950-ac93-4bab-8ad6-56d7fb63afd2",
                "name": "Humberto EI",
                "nominalAmount": 1000,
                "reconciliationId": "12345",
                "reductionAmount": 0,
                "status": "created",
                "taxId": "27.564.801/0001-36"
            },
            "scheduled": "2023-01-29",
            "type": "brcode-payment"
        }
    ]
}
  

Payment Request

Here we will teach you how to create and manage your payment requests. The payment request is the main element of our approval flow, which can be checked out by logging into our Web Banking.

The requests are bound to their respective cost centers and represent requests to execute specific payments, which can be transfers, boleto payments, etc. Expect more payment options to be introduced!

Payment Request Status

Each payment has a status that can change over time according to its life cycle: payment-request-status

The Payment Request object

Attributes

id STRING

Unique id for the payment request.

amount INTEGER

Amount in cents to be paid.

centerId STRING

ID of the targeted cost center.

created STRING

Creation datetime. Example: "2020-04-23T23:00:00.000000+00:00".

description STRING

Description of the payment request.

due STRING

Suggested payment date. Example: "2020-04-23".

status STRING

Current payment request status.

tags LIST OF STRINGS

Tags associated with the payment request.

type STRING

Payment type. Options: "transfer", "brcode-payment", "boleto-payment", "utility-payment".

updated STRING

Last update datetime. Example: "2020-04-23T23:00:00.000000+00:00".

Create Payment Requests

Use this route to create new payment requests in our Web Banking approval flow.

Parameters

centerId REQUIRED

Unique ID of the targeted cost center. You can check out the cost center ID directly on its approval section on our Web Banking. Example: 5656565656565656

payment REQUIRED

JSON specifying the requested payment. The payment JSON is the same as those passed in the requests that create the payments without going through the approval flow (see transfer and boleto payment). The only exception is that the "scheduled" parameter cannot be sent on these JSONs, as the PaymentRequest "due" parameter already serves this purpose. The SDKs also accept their respective objects instead of JSONs.

due OPTIONAL

Suggested payment date. This parameter may be altered by the controllers of the cost center. Default is today. Example: "2020-08-01"

tags OPTIONAL

Array of strings to tag the entity for future queries. All tags will be converted to lowercase.

type CONDITIONALLY REQUIRED

Payment type. The SDKs will take care of this parameter for you if you use their specialized objects. But if you pass a dictionary in payment parameter you need to inform its type. Examples: "transfer", "brcode-payment", "boleto-payment", "utility-payment".

ENDPOINT
POST /v2/payment-request
REQUEST

Python

import starkbank

requests = starkbank.paymentrequest.create([
    starkbank.PaymentRequest(
        center_id="4762954029334528",
        payment=starkbank.Transfer(
            amount=100000000,
            bank_code="665",
            branch_code="2201",
            account_number="76543-8",
            tax_id="594.739.480-42",
            name="Daenerys Targaryen Stormborn",
        ),
        tags=["daenerys", "request/1234"]
    ),
])

for request in requests:
    print(request)
  

Javascript

const starkbank = require('starkbank');

let transfer = new starkbank.Transfer({
    amount: 100000000,
    taxId: "594.739.480-42",
    name: "Daenerys Targaryen Stormborn",
    bankCode: "665",
    branchCode: "2201",
    accountNumber: "76543-8"
});

let requests = [
    new starkbank.PaymentRequest({
        centerId: '4762954029334528',
        payment: transfer,
        tags: ["daenerys", "request/1234"],
    })
];

(async() => {
    requests = await starkbank.paymentRequest.create(requests);

    for await (let request of requests){
        console.log(request);
    }
})();
  

PHP

$requests = PaymentRequest::create([
    new PaymentRequest([
        "centerId" => "4762954029334528",
        "payment" => new Transfer([
            "amount" => 100000000,
            "bankCode" => "665",
            "branchCode" => "2201",
            "accountNumber" => "76543-8",
            "taxId" => "594.739.480-42",
            "name" => "Daenerys Targaryen Stormborn",
        ]),
        "tags" => ["daenerys", "request/1234"],
    ])
]);

foreach($requests as $request){
    print_r($request);
}
  

Java

import com.starkbank.*;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

HashMap<String, Object> paymentData = new HashMap<>();
paymentData.put("amount", 100000000);
paymentData.put("bankCode", "665");
paymentData.put("branchCode", "2201");
paymentData.put("accountNumber", "76543-8");
paymentData.put("taxId", "594.739.480-42");
paymentData.put("name", "Daenerys Targaryen Stormborn");
Transfer payment = new Transfer(paymentData);

List<PaymentRequest> requests = new ArrayList<>();
HashMap<String, Object> data = new HashMap<>();
data.put("centerId", "4762954029334528");
data.put("payment", payment);
data.put("tags", new String[]{"daenerys", "request/1234"});
requests.add(new PaymentRequest(data));

requests = PaymentRequest.create(requests);

for (PaymentRequest request : requests){
    System.out.println(request);
}
  

Ruby

require('starkbank')

requests = StarkBank::PaymentRequest.create(
  [
    StarkBank::PaymentRequest.new(
      center_id: '4762954029334528',
      payment: StarkBank::Transfer.new(
        amount: 100000000,
        tax_id: '594.739.480-42',
        name: 'Daenerys Targaryen Stormborn',
        bank_code: '665',
        branch_code: '2201',
        account_number: '76543-8'
      ),
      tags: %w[daenerys request/1234]
    )
  ]
)

requests.each do |request|
  puts request
end
  

Elixir

requests = StarkBank.PaymentRequest.create!(
    [
        %StarkBank.PaymentRequest{
            center_id: "4762954029334528",
            payment: %StarkBank.Transfer{
                amount: 100000000,
                bank_code: "665",
                branch_code: "2201",
                account_number: "76543-8",
                tax_id: "594.739.480-42",
                name: "Daenerys Targaryen Stormborn",
            },
            tags: ["daenerys", "request/1234"],
        }
    ]
    ) |> IO.inspect

for request <- requests do
    request |> IO.inspect
end
  

C#

List<StarkBank.PaymentRequest> requests = StarkBank.PaymentRequest.Create(
    new List<StarkBank.PaymentRequest> {
        new StarkBank.PaymentRequest(
            centerID: "4762954029334528",
            payment: new StarkBank.Transfer(
                amount: 100000000,
                bankCode: "665",
                branchCode: "2201",
                accountNumber: "76543-8",
                taxID: "594.739.480-42",
                name: "Daenerys Targaryen Stormborn",
            )
            tags: new List<string> { "daenerys", "request/1234" }
        )
    }
);

foreach(StarkBank.PaymentRequest request in requests) {
    Console.WriteLine(request);
}
  

Go

package main

import (
    "fmt"
    "github.com/starkbank/sdk-go/starkbank/paymentrequest"
)

func main() {

    requests, err := paymentrequest.Create(
        []paymentrequest.PaymentRequest{
            {
                CenterId: "4762954029334528",
                Payment:  transfer.Transfer{
                    Amount:        100000000,
                    BankCode:      "665",
                    BranchCode:    "2201",
                    AccountNumber: "76543-8",
                    TaxId:         "594.739.480-42",
                    Name:          "Daenerys Targaryen Stormborn",
                },
                Tags:     []string{"daenerys", "request/1234"},
            },
        }, nil)
    if err.Errors != nil {
        for _, e := range err.Errors {
            fmt.Printf("code: %s, message: %s", e.Code, e.Message)
        }
    }

    for _, request := range requests {
        fmt.Printf("%+v", request)
    }
}
  

Clojure

(def payment {
    :amount 10000000000
    :bank-code "665"
    :branch-code "2201"
    :account-number "76543-8"
    :tax-id "594.739.480-42"
    :name "Daenerys Targaryen Stormborn"
})

(def payment-requests (starkbank.payment-request/create
[{
    :type "transfer"
    :payment payment
    :center-id "4762954029334528"
    :tags ["daenerys" "request/1234"]
}]))

(doseq [request payment-requests]
    (println request))
  

Curl

curl --location --request POST '{{baseUrl}}/v2/payment-request' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}' 
--header 'Content-Type: application/json' 
--data-raw '{
    "requests": [
        {
            "centerId": "4762954029334528",
            "type": "transfer",
            "payment": {
                "amount": 100000000,
                "taxId": "594.739.480-42",
                "name": "Daenerys Targaryen Stormborn",
                "bankCode": "665",
                "branchCode": "2201",
                "accountNumber": "76543-8"
            },
            "tags": ["daenerys", "request/1234"]
        }
    ]
}'
  
RESPONSE

Python

PaymentRequest(
    actions=[
        {
            'pictureUrl': '',
            'name': 'SDK Python',
            'action': 'requested',
            'type': 'project',
            'id': '5414728075575296',
            'email': ''
        },
        {
            'pictureUrl': '',
            'name': 'Rhaegar Targaryen',
            'action': 'required',
            'type': 'member',
            'id': '6025356662276096',
            'email': 'rhaegar.targaryen@starkbank.com'
        }
    ],
    amount=100000000,
    center_id=4762954029334528,
    created=2020-10-23T19:36:59.345753,
    due=2020-10-24T03:00:00+00:00,
    id=5756591424929792,
    payment=Transfer(
        account_number=76543-8,
        amount=100000000,
        bank_code=665,
        branch_code=2201,
        name=Daenerys Targaryen Stormborn,
        tax_id=594.739.480-42
    ),
    status=pending,
    tags=['daenerys', 'request/1234'],
    type=transfer,
    description=Daenerys Targaryen Stormborn (594.739.480-42),
    updated=2020-10-23T19:36:59.345760+00:00
)
  

Javascript

PaymentRequest {
    id: '5756591424929792',
    centerId: '4762954029334528',
    due: '2020-10-24T03:00:00.000000+00:00',
    tags: [ 'daenerys', 'request/1234' ],
    amount: 100000000,
    status: 'pending',
    actions: [
        {
        pictureUrl: '',
        name: 'SDK Node',
        action: 'requested',
        type: 'project',
        id: '5414728075575296',
        email: ''
        },
        {
        pictureUrl: '',
        name: 'Rhaegar Targaryen',
        action: 'required',
        type: 'member',
        id: '6025356662276096',
        email: 'rhaegar.targaryen@starkbank.com'
        }
    ],
    updated: '2020-10-23T19:36:59.345753+00:00',
    created: '2020-10-23T19:36:59.345753+00:00',
    payment: {
        name: 'Daenerys Targaryen Stormborn',
        accountNumber: '76543-8',
        taxId: '594.739.480-42',
        amount: 100000000,
        bankCode: '665',
        branchCode: '2201'
    },
    type: 'transfer',
    description: 'Daenerys Targaryen Stormborn (594.739.480-42)'
}
  

PHP

StarkBank\PaymentRequest Object
(
    [id] => 5756591424929792
    [centerId] => 4762954029334528
    [due] => 2020-10-24T03:00:00.000000+00:00
    [description] => Daenerys Targaryen Stormborn (594.739.480-42)
    [tags] => Array
        (
            [0] => daenerys
            [1] => request/1234
        )

    [amount] => 100000000
    [status] => pending
    [actions] => Array
        (
            [0] => Array
                (
                    [pictureUrl] =>
                    [name] => SDK PHP
                    [action] => requested
                    [type] => project
                    [id] => 5414728075575296
                    [email] =>
                )

            [1] => Array
                (
                    [pictureUrl] =>
                    [name] => Rhaegar Targaryen
                    [action] => required
                    [type] => member
                    [id] => 6025356662276096
                    [email] => rhaegar.targaryen@starkbank.com
                )

        )

    [created] => DateTime Object
        (
            [date] => 2020-10-23 19:36:59.988289
            [timezone_type] => 1
            [timezone] => +00:00
        )

    [updated] => DateTime Object
        (
            [date] => 2020-10-23 19:36:59.988295
            [timezone_type] => 1
            [timezone] => +00:00
        )

    [payment] => StarkBank\Transfer Object
        (
            [amount] => 100000000
            [name] => Daenerys Targaryen Stormborn
            [taxId] => 594.739.480-42
            [bankCode] => 665
            [branchCode] => 2201
            [accountNumber] => 76543-8
        )

    [type] => transfer
)
  

Java

PaymentRequest({
    "centerId": "4762954029334528",
    "payment": {
        "amount": 100000000,
        "name": "Daenerys Targaryen Stormborn",
        "taxId": "594.739.480-42",
        "bankCode": "665",
        "branchCode": "2201",
        "accountNumber": "76543-8"
    },
    "type": "transfer",
    "due": "2020-10-24T03:00:00+00:00",
    "tags": [
        "daenerys",
        "request/1234"
    ],
    "amount": 100000000,
    "description": "Daenerys Targaryen Stormborn (594.739.480-42)",
    "status": "pending",
    "actions": [
        {
        "pictureUrl": "",
        "name": "SDK Java",
        "action": "requested",
        "type": "project",
        "id": "5414728075575296",
        "email": ""
        },
        {
        "pictureUrl": "",
        "name": "Rhaegar Targaryen",
        "action": "required",
        "type": "member",
        "id": "6025356662276096",
        "email": ""
        }
    ],
    "updated": "2020-10-23T19:36:59.800963+00:00",
    "created": "2020-10-23T19:36:59.800957+00:00",
    "id": "5756591424929792"
})
  

Ruby

paymentrequest(
    actions: [
    {
        "pictureUrl"=>"",
        "name"=>"SDK Ruby",
        "action"=>"requested",
        "type"=>"project",
        "id"=>"5414728075575296",
        "email"=>""
    },
    {
        "pictureUrl"=>"",
        "name"=>"Rhaegar Targaryen",
        "action"=>"required",
        "type"=>"member",
        "id"=>"6025356662276096",
        "email"=>"rhaegar.targaryen@starkbank.com"
    }],
    updated: 2020-10-23T19:36:59.084075+00:00,
    created: 2020-10-23T19:36:59.084069+00:00,
    payment: transfer(
        id: ,
        amount: 100000000,
        name: Daenerys Targaryen Stormborn,
        tax_id: 594.739.480-42,
        bank_code: 665,
        branch_code: 2201,
        account_number: 76543-8
    ),
    type: transfer,
    id: 5756591424929792,
    center_id: 4762954029334528,
    due: 2020-10-24T03:00:00.000000+00:00,
    tags: %[daenerys request/1234],
    amount: 100000000,
    status: pending,
    description: Daenerys Targaryen Stormborn (594.739.480-42),
)
  

Elixir

[
    %StarkBank.PaymentRequest{
        actions: [
        %{
            "action" => "requested",
            "email" => "",
            "id" => "5414728075575296",
            "name" => "SDK Elixir",
            "pictureUrl" => "",
            "type" => "project"
        },
        %{
            "action" => "required",
            "email" => "rhaegar.targaryen@starkbank.com",
            "id" => "6025356662276096",
            "name" => "Rhaegar Targaryen",
            "pictureUrl" => "",
            "type" => "member"
        }
        ],
        amount: 100000000,
        center_id: "4762954029334528",
        created: ~U[2020-10-23 19:36:59.858275Z],
        description: "Daenerys Targaryen Stormborn (594.739.480-42)",
        due: ~U[2020-10-24 03:00:00.000000Z],
        id: "5756591424929792",
        payment: %StarkBank.Transfer{
            account_number: "76543-8",
            amount: 100000000,
            bank_code: "665",
            branch_code: "2201",
            name: "Daenerys Targaryen Stormborn",
            tax_id: "594.739.480-42"
        },
        status: "pending",
        tags: ["daenerys", "request/1234"],
        type: "transfer",
        updated: ~U[2020-10-23 19:36:59.858283Z]
    }
]
  

C#

PaymentRequest(
    CenterID: 4762954029334528,
    Payment: Transfer(
        Amount: 100000000,
        Name: Daenerys Targaryen Stormborn,
        TaxID: 594.739.480-42,
        BankCode: 665,
        BranchCode: 2201,
        AccountNumber: 76543-8
    ),
    Type: transfer,
    Description: Daenerys Targaryen Stormborn (594.739.480-42),
    Due: 24/10/2020 03:00:00,
    Tags: { daenerys request/1234 },
    Amount: 100000000,
    Status: pending,
    Actions: {
    {
        { pictureUrl,  },
        { name, SDK C# },
        { action, requested },
        { type, project },
        { id, 5414728075575296 },
        { email,  }
    },
    {
        { pictureUrl,  },
        { name, Rhaegar Targaryen },
        { action, required },
        { type, member },
        { id, 6025356662276096 },
        { email, rhaegar.targaryen@starkbank.com }
    } },
    Updated: 23/10/2020 19:36:59,
    Created: 23/10/2020 19:36:59,
    ID: 5756591424929792
)
  

Go

{
    CenterId:4762954029334528
    Payment:{
        Name:
        AccountNumber:76543-8
        TaxId:594.739.480-42
        Amount:100000000
        BankCode:665
        BranchCode:2201
    }
    Type:transfer
    Due:2020-10-24 03:00:00.000000 +0000 +0000
    Tags:[daenerys request/1234]
    Amount:100000000
    Status:pending
    Actions:[
        map[
            action:requested
            email:
            id:5414728075575296
            name:SDK Go
            pictureUrl:
            status:active
            type:project
        ]
        map[
            action:required
            email:rhaegar.targaryen@starkbank.com
            id:6025356662276096
            name:Rhaegar Targaryen
            pictureUrl:
            status:active
            type:member
        ]
    ]
    Updated:2023-02-06 14:26:36.667405 +0000 +0000
    Created:2023-02-06 14:26:36.667397 +0000 +0000
    Description:Daenerys Targaryen Stormborn (594.739.480-42)
}
  

Clojure

{
    :amount 100000000,
    :tags [daenerys request/1234],
    :center-id 4762954029334528,
    :updated 2020-10-23T19:36:59.698192+00:00,
    :payment {
        :amount 100000000,
        :name Daenerys Targaryen Stormborn,
        :account-number 76543-8,
        :tax-id 594.739.480-42,
        :bank-code 665,
        :branch-code 2201
    },
    :type transfer,
    :description Daenerys Targaryen Stormborn (594.739.480-42),
    :created 2020-10-23T19:36:59.698192+00:00,
    :actions [
        {
            :name SDK Clojure,
            :action requested,
            :type project,
            :id 5414728075575296,
            :email ,
            :pictureUrl
        },
        {
            :name Rhaegar Targaryen,
            :action required,
            :type member,
            :id 6025356662276096,
            :email ,
            :pictureUrl
        }
    ],
    :due 2020-10-24T03:00:00.000000+00:00,
    :status pending,
    :id 5756591424929792
}
  

Curl

{
    "message": "Payment Request(s) successfully created",
    "requests": [
        {
            "id": "5756591424929792",
            "centerId": "4762954029334528",
            "type": "transfer",
            "payment": {
                "amount": 100000000,
                "taxId": "594.739.480-42",
                "name": "Daenerys Targaryen Stormborn",
                "bankCode": "665",
                "branchCode": "2201",
                "accountNumber": "76543-8"
            },
            "due": "2020-10-24T03:00:00.000000+00:00",
            "attachments": [],
            "tags": ["daenerys", "request/1234"],
            "amount": 100000000,
            "actions": [
                {
                    "action": "requested",
                    "type": "project",
                    "id": "5414728075575296",
                    "name": "Curl",
                    "pictureUrl": "",
                    "email": ""
                },
                {
                    "action": "required",
                    "type": "member",
                    "id": "6025356662276096",
                    "name": "Rhaegar Targaryen",
                    "pictureUrl": "",
                    "email": "rhaegar.targaryen@starkbank.com"
                }
            ],
            "status": "pending",
            "description": "Daenerys Targaryen Stormborn (594.739.480-42)",
            "created": "2020-10-23T19:36:59.799815+00:00",
            "updated": "2020-10-23T19:36:59.799815+00:00"
        }
    ]
}
  

List Payment Requests

Here you can list and filter payment requests created by the requesting user. We return it paged.

Parameters

centerId REQUIRED

Unique ID of the targeted cost center. You can check out the cost center ID directly on its approval section on our Web Banking. Example: 5656565656565656

after OPTIONAL

Filter entities created after this date.

before OPTIONAL

Filter entities created before this date.

cursor OPTIONAL

String used to get the next batch of results. Our SDKs handle this for you.

fields OPTIONAL

List of strings to filter response JSON keys. Not available in the SDKs.

ids OPTIONAL

List of strings to get specific entities by ids.

limit OPTIONAL

Number of results per cursor. Max = 100.

sort OPTIONAL

Sort order considered in the response. Options are: "created", "-created", "updated" and "-updated". "-" means descending order. Default is "-created".

status OPTIONAL

Filter payment requests by the specified status. Example: success

tags OPTIONAL

Filter entities that contain the specified tags.

type OPTIONAL

Filters payment requests by the type inferred from the payment parameter, if it is not a dictionary. Example: boleto-payment

ENDPOINT
GET /v2/payment-request
REQUEST

Python

import starkbank

requests = starkbank.paymentrequest.query(center_id="4762954029334528", limit=1)

for request in requests:
    print(request)
  

Javascript

const starkbank = require('starkbank');

(async() => {
    let requests = await starkbank.paymentRequest.query({centerId: '4762954029334528', limit: 1});

    for await (let request of requests){
        console.log(request);
    }
})();
  

PHP

use StarkBank\PaymentRequest;

$requests = PaymentRequest::query(["centerId" => "4762954029334528", "limit" => 1]);

foreach($requests as $request){
    print_r($request);
}
  

Java

import com.starkbank.*;
import com.starkbank.utils.Generator;
import java.util.HashMap;

HashMap<String, Object> params = new HashMap<>();
params.put("centerId", "4762954029334528");
params.put("limit", 1);
Generator<PaymentRequest> requests = PaymentRequest.query(params);

for (PaymentRequest request : requests){
    System.out.println(request);
}
  

Ruby

require('starkbank')

requests = StarkBank::PaymentRequest.query(
    center_id: '4762954029334528',
    limit: 1
)

requests.each do |request|
    puts request
end
  

Elixir

requests = StarkBank.PaymentRequest.query!(
    center_id: "4762954029334528",
    limit: 1
) |> Enum.take(10) |> IO.inspect
  

C#

using System;
using System.Collections.Generic;

IEnumerable<StarkBank.PaymentRequest> requests = StarkBank.PaymentRequest.Query(
    centerID: "4762954029334528",
    limit: 1
);

foreach(StarkBank.PaymentRequest request in requests) {
    Console.WriteLine(request);
}
  

Go

package main

import (
    "fmt"
    "github.com/starkbank/sdk-go/starkbank/paymentrequest"
)

func main() {

    var params = map[string]interface{}{}
    params["limit"] = 1

    requests, errorChannel := paymentrequest.Query("4762954029334528", params, nil)

    loop:
    for {
        select {
        case err := <-errorChannel:
            if err.Errors != nil {
                for _, e := range err.Errors {
                    fmt.Printf("code: %s, message: %s", e.Code, e.Message)
                }
            }
        case request, ok := <-requests:
            if !ok {
                break loop
            }
            fmt.Printf("%+v", request)
        }
    }
}
  

Clojure

(def payment-requests (starkbank.payment-request/query {
    :limit 1
    :center-id "4762954029334528"}))

(doseq [request payment-requests]
    (println request))
  

Curl

curl --location --request GET '{{baseUrl}}/v2/payment-request' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}' 
--data-raw '{
    "centerId": "4762954029334528"
}'
  
RESPONSE

Python

PaymentRequest(
    actions=[
        {
            'pictureUrl': '',
            'name': 'SDK Python',
            'action': 'requested',
            'type': 'project',
            'id': '5414728075575296',
            'email': ''
        },
        {
            'pictureUrl': '',
            'name': 'Rhaegar Targaryen',
            'action': 'required',
            'type': 'member',
            'id': '6025356662276096',
            'email': 'rhaegar.targaryen@starkbank.com'
        }
    ],
    amount=100000000,
    center_id=4762954029334528,
    created=2020-10-23T19:36:59.345753,
    due=2020-10-24T03:00:00+00:00,
    id=5756591424929792,
    payment=Transfer(
        account_number=76543-8,
        amount=100000000,
        bank_code=665,
        branch_code=2201,
        name=Daenerys Targaryen Stormborn,
        tax_id=594.739.480-42
    ),
    status=pending,
    tags=['daenerys', 'request/1234'],
    type=transfer,
    description=Daenerys Targaryen Stormborn (594.739.480-42),
    updated=2020-10-23T19:36:59.345760+00:00
)
  

Javascript

PaymentRequest {
    id: '5756591424929792',
    centerId: '4762954029334528',
    due: '2020-10-24T03:00:00.000000+00:00',
    tags: [ 'daenerys', 'request/1234' ],
    amount: 100000000,
    status: 'pending',
    actions: [
        {
        pictureUrl: '',
        name: 'SDK Node',
        action: 'requested',
        type: 'project',
        id: '5414728075575296',
        email: ''
        },
        {
        pictureUrl: '',
        name: 'Rhaegar Targaryen',
        action: 'required',
        type: 'member',
        id: '6025356662276096',
        email: 'rhaegar.targaryen@starkbank.com'
        }
    ],
    updated: '2020-10-23T19:36:59.345753+00:00',
    created: '2020-10-23T19:36:59.345753+00:00',
    payment: {
        name: 'Daenerys Targaryen Stormborn',
        accountNumber: '76543-8',
        taxId: '594.739.480-42',
        amount: 100000000,
        bankCode: '665',
        branchCode: '2201'
    },
    type: 'transfer',
    description: 'Daenerys Targaryen Stormborn (594.739.480-42)'
}
  

PHP

StarkBank\PaymentRequest Object
(
    [id] => 5756591424929792
    [centerId] => 4762954029334528
    [due] => 2020-10-24T03:00:00.000000+00:00
    [description] => Daenerys Targaryen Stormborn (594.739.480-42)
    [tags] => Array
        (
            [0] => daenerys
            [1] => request/1234
        )

    [amount] => 100000000
    [status] => pending
    [actions] => Array
        (
            [0] => Array
                (
                    [pictureUrl] =>
                    [name] => SDK PHP
                    [action] => requested
                    [type] => project
                    [id] => 5414728075575296
                    [email] =>
                )

            [1] => Array
                (
                    [pictureUrl] =>
                    [name] => Rhaegar Targaryen
                    [action] => required
                    [type] => member
                    [id] => 6025356662276096
                    [email] => rhaegar.targaryen@starkbank.com
                )

        )

    [created] => DateTime Object
        (
            [date] => 2020-10-23 19:36:59.988289
            [timezone_type] => 1
            [timezone] => +00:00
        )

    [updated] => DateTime Object
        (
            [date] => 2020-10-23 19:36:59.988295
            [timezone_type] => 1
            [timezone] => +00:00
        )

    [payment] => StarkBankTransfer Object
        (
            [amount] => 100000000
            [name] => Daenerys Targaryen Stormborn
            [taxId] => 594.739.480-42
            [bankCode] => 665
            [branchCode] => 2201
            [accountNumber] => 76543-8
        )

    [type] => transfer
)
  

Java

PaymentRequest({
    "centerId": "4762954029334528",
    "payment": {
        "amount": 100000000,
        "name": "Daenerys Targaryen Stormborn",
        "taxId": "594.739.480-42",
        "bankCode": "665",
        "branchCode": "2201",
        "accountNumber": "76543-8"
    },
    "type": "transfer",
    "due": "2020-10-24T03:00:00+00:00",
    "tags": [
        "daenerys",
        "request/1234"
    ],
    "amount": 100000000,
    "status": "pending",
    "description": "Daenerys Targaryen Stormborn (594.739.480-42)"
    "actions": [
        {
        "pictureUrl": "",
        "name": "SDK Java",
        "action": "requested",
        "type": "project",
        "id": "5414728075575296",
        "email": ""
        },
        {
        "pictureUrl": "",
        "name": "Rhaegar Targaryen",
        "action": "required",
        "type": "member",
        "id": "6025356662276096",
        "email": ""
        }
    ],
    "updated": "2020-10-23T19:36:59.800963+00:00",
    "created": "2020-10-23T19:36:59.800957+00:00",
    "id": "5756591424929792"
})
  

Ruby

paymentrequest(
    actions: [
    {
        "pictureUrl"=>"",
        "name"=>"SDK Ruby",
        "action"=>"requested",
        "type"=>"project",
        "id"=>"5414728075575296",
        "email"=>""
    },
    {
        "pictureUrl"=>"",
        "name"=>"Rhaegar Targaryen",
        "action"=>"required",
        "type"=>"member",
        "id"=>"6025356662276096",
        "email"=>"rhaegar.targaryen@starkbank.com"
    }],
    updated: 2020-10-23T19:36:59.084075+00:00,
    created: 2020-10-23T19:36:59.084069+00:00,
    payment: transfer(
        id: ,
        amount: 100000000,
        name: Daenerys Targaryen Stormborn,
        tax_id: 594.739.480-42,
        bank_code: 665,
        branch_code: 2201,
        account_number: 76543-8
    ),
    type: transfer,
    id: 5756591424929792,
    center_id: 4762954029334528,
    due: 2020-10-24T03:00:00.000000+00:00,
    tags: %[daenerys request/1234],
    amount: 100000000,
    status: pending,
    description: Daenerys Targaryen Stormborn (594.739.480-42),
)
  

Elixir

[
    %StarkBank.PaymentRequest{
        actions: [
        %{
            "action" => "requested",
            "email" => "",
            "id" => "5414728075575296",
            "name" => "SDK Elixir",
            "pictureUrl" => "",
            "type" => "project"
        },
        %{
            "action" => "required",
            "email" => "rhaegar.targaryen@starkbank.com",
            "id" => "6025356662276096",
            "name" => "Rhaegar Targaryen",
            "pictureUrl" => "",
            "type" => "member"
        }
        ],
        amount: 100000000,
        center_id: "4762954029334528",
        created: ~U[2020-10-23 19:36:59.858275Z],
        description: "Daenerys Targaryen Stormborn (594.739.480-42)"
        due: ~U[2020-10-24 03:00:00.000000Z],
        id: "5756591424929792",
        payment: %StarkBank.Transfer{
            account_number: "76543-8",
            amount: 100000000,
            bank_code: "665",
            branch_code: "2201",
            name: "Daenerys Targaryen Stormborn",
            tax_id: "594.739.480-42"
        },
        status: "pending",
        tags: ["daenerys", "request/1234"],
        type: "transfer",
        updated: ~U[2020-10-23 19:36:59.858283Z]
    }
]
  

C#

PaymentRequest(
    CenterID: 4762954029334528,
    Payment: Transfer(
        Amount: 100000000,
        Name: Daenerys Targaryen Stormborn,
        TaxID: 594.739.480-42,
        BankCode: 665,
        BranchCode: 2201,
        AccountNumber: 76543-8
    ),
    Type: transfer,
    Description: Daenerys Targaryen Stormborn (594.739.480-42),
    Due: 24/10/2020 03:00:00,
    Tags: { daenerys request/1234 },
    Amount: 100000000,
    Status: pending,
    Actions: {
    {
        { pictureUrl,  },
        { name, SDK C# },
        { action, requested },
        { type, project },
        { id, 5414728075575296 },
        { email,  }
    },
    {
        { pictureUrl,  },
        { name, Rhaegar Targaryen },
        { action, required },
        { type, member },
        { id, 6025356662276096 },
        { email, rhaegar.targaryen@starkbank.com }
    } },
    Updated: 23/10/2020 19:36:59,
    Created: 23/10/2020 19:36:59,
    ID: 5756591424929792
)
  

Go

{
    CenterId:4762954029334528
    Payment:{
        Name:
        AccountNumber:76543-8
        TaxId:594.739.480-42
        Amount:100000000
        BankCode:665
        BranchCode:2201
    }
    Type:transfer
    Due:2020-10-24 03:00:00.000000 +0000 +0000
    Tags:[daenerys request/1234]
    Amount:100000000
    Status:pending
    Actions:[
        map[
            action:requested
            email:
            id:5414728075575296
            name:SDK Go
            pictureUrl:
            status:active
            type:project
        ]
        map[
            action:required
            email:rhaegar.targaryen@starkbank.com
            id:6025356662276096
            name:Rhaegar Targaryen
            pictureUrl:
            status:active
            type:member
        ]
    ]
    Updated:2023-02-06 14:26:36.667405 +0000 +0000
    Created:2023-02-06 14:26:36.667397 +0000 +0000
    Description:Daenerys Targaryen Stormborn (594.739.480-42)
}
  

Clojure

{
    :amount 100000000,
    :tags [daenerys request/1234],
    :center-id 4762954029334528,
    :updated 2020-10-23T19:36:59.698192+00:00,
    :payment {
        :amount 100000000,
        :name Daenerys Targaryen Stormborn,
        :account-number 76543-8,
        :tax-id 594.739.480-42,
        :bank-code 665,
        :branch-code 2201
    },
    :type transfer,
    :description Daenerys Targaryen Stormborn (594.739.480-42),
    :created 2020-10-23T19:36:59.698192+00:00,
    :actions [
        {
            :name SDK Clojure,
            :action requested,
            :type project,
            :id 5414728075575296,
            :email ,
            :pictureUrl
        },
        {
            :name Rhaegar Targaryen,
            :action required,
            :type member,
            :id 6025356662276096,
            :email ,
            :pictureUrl
        }
    ],
    :due 2020-10-24T03:00:00.000000+00:00,
    :status pending,
    :id 5756591424929792
}
  

Curl

{
    "requests": [
        {
            "id": "5756591424929792",
            "centerId": "4762954029334528",
            "type": "transfer",
            "payment": {
                "amount": 100000000,
                "taxId": "594.739.480-42",
                "name": "Daenerys Targaryen Stormborn",
                "bankCode": "665",
                "branchCode": "2201",
                "accountNumber": "76543-8"
            },
            "due": "2020-10-24T03:00:00.000000+00:00",
            "attachments": [],
            "tags": ["daenerys", "request/1234"],
            "amount": 100000000,
            "actions": [
                {
                    "action": "requested",
                    "type": "project",
                    "id": "5414728075575296",
                    "name": "Curl",
                    "pictureUrl": "",
                    "email": ""
                },
                {
                    "action": "required",
                    "type": "member",
                    "id": "6025356662276096",
                    "name": "Rhaegar Targaryen",
                    "pictureUrl": "",
                    "email": "rhaegar.targaryen@starkbank.com"
                }
            ],
            "status": "pending",
            "description": "Daenerys Targaryen Stormborn (594.739.480-42)",
            "created": "2020-10-23T19:36:59.799815+00:00",
            "updated": "2020-10-23T19:36:59.799815+00:00"
        }
    ]
}
  

Webhook

You can create webhook subscriptions to receive events whenever a new log is created. We send the event by making a POST request to your endpoint URL. The event will be delivered with a digital signature (headers["Digital-Signature"]), which can be verified using the Stark Bank public key. This key is recoverable by a GET request to /v2/public-key.

If your endpoint URL does not return a 200 status, the webhook service will try again at most three times. The interval between each attempt is 5 min, 30 min and finally 120 min. In case the event cannot be delivered after those three attempts, we will stop trying to deliver the message.

The event sent to the endpoint URL has the structure shown to the right, where the content of the log sent will depend on the event subscription.

NOTE 1: Registered webhooks will only work for services used in that same version. For example, if you create a transfer in v2, its logs will only trigger v2 webhooks and v1 webhooks would ignore its events.

NOTE 2: Even if you use Webhook, we strongly recommend that you create a daily task to get all undelivered events and set them as delivered. It's important to add redundancy and resilience to your system, preventing you from having outdated information just in case your system is temporarily unable to receive our Webhook events.

The Webhook object

Attributes

id STRING

Unique id for the webhook subscription.

subscriptions LIST OF STRINGS

List of subscribed event types.

url STRING

Endpoint URL that receives webhook events.

Create a Webhook

Here you can register a new webhook URL. The subscriptions refer to which kinds of logs will be sent to the webhook URL being registered. The subscriptions must be in transfer, boleto, boleto-payment, utility-payment, brcode-payment, boleto-holmes, deposit, darf-payment, payment-request or invoice.

Parameters

subscriptions REQUIRED

Array of subscriptions. Possible values: "deposit", "invoice", "brcode-payment", "transfer", "utility-payment", "boleto", "boleto-payment", "darf-payment", "payment-request" or "boleto-holmes"

url REQUIRED

The server URL that will receive the Webhook Events.

ENDPOINT
POST /v2/webhook
REQUEST

Python

import starkbank

webhook = starkbank.webhook.create(
    url="https://winterfell.westeros.gov/events-from-stark-bank",
    subscriptions=[
        "boleto",
        "boleto-payment",
        "transfer",
        "utility-payment"
    ]
)

print(webhook)
  

Javascript

const starkbank = require('starkbank');

(async() => {
    let webhook = await starkbank.webhook.create({
        url: 'https://winterfell.westeros.gov/events-from-stark-bank',
        subscriptions: ['transfer', 'boleto', 'boleto-payment', 'utility-payment'],
    });

    console.log(webhook);
})();
  

PHP

$webhook = StarkBank\Webhook::create([
    "url" => "https://winterfell.westeros.gov/events-from-stark-bank",
    "subscriptions" => ["boleto", "boleto-payment", "transfer", "utility-payment"]
]);

print_r($webhook);
  

Java

import com.starkbank.*;
import java.util.HashMap;

HashMap<String, Object> data = new HashMap<>();
data.put("url", "https://winterfell.westeros.gov/events-from-stark-bank");
data.put("subscriptions", new String[]{"boleto", "boleto-payment", "transfer", "utility-payment"});
Webhook webhook = Webhook.create(data);

System.out.println(webhook);
  

Ruby

require('starkbank')

webhook = StarkBank::Webhook.create(
    url: 'https://winterfell.westeros.gov/events-from-stark-bank',
    subscriptions: %w[boleto boleto-payment transfer utility-payment]
)

puts webhook
  

Elixir

webhook = StarkBank.Webhook.create!(
    url: "https://winterfell.westeros.gov/events-from-stark-bank",
    subscriptions: [
        "boleto",
        "boleto-payment",
        "transfer",
        "utility-payment"
    ]
)

webhook |> IO.inspect
  

C#

using System;

StarkBank.Webhook webhook = StarkBank.Webhook.Create(
    url: "https://winterfell.westeros.gov/events-from-stark-bank",
    subscriptions: new List<string> { "transfer", "boleto", "boleto-payment", "utility-payment" }
);
  

Go

package main

import (
    "fmt"
    "github.com/starkbank/sdk-go/starkbank/webhook"
)

func main() {

    webhook, err := webhook.Create(
        webhook.Webhook{
            Url:           "https://winterfell.westeros.gov/events-from-stark-bank",
            Subscriptions: []string{"boleto", "boleto-payment", "transfer", "utility-payment"},
        }, nil)
    if err.Errors != nil {
        for _, e := range err.Errors {
            fmt.Printf("code: %s, message: %s", e.Code, e.Message)
        }
    }
    fmt.Printf("%+v", webhook)
}
  

Clojure

(def webhook
  (starkbank.webhook/create
    {
      :url "https://winterfell.westeros.gov/events-from-stark-bank"
      :subscriptions ["transfer" "boleto" "boleto-payment" "utility-payment"]
    }))
(dorun (map println webhook))
  

Curl

curl --location --request POST '{{baseUrl}}/v2/webhook' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}' 
--header 'Content-Type: application/json' 
--data-raw '{
    "url": "https://winterfell.westeros.gov/events-from-stark-bank",
    "subscriptions": ["boleto", "boleto-payment", "transfer", "utility-payment"]
}'
  
RESPONSE

Python

Webhook(
    id=6225875037061120,
    subscriptions=['boleto', 'boleto-payment', 'transfer', 'utility-payment'],
    url=https://winterfell.westeros.gov/events-from-stark-bank
)
  

Javascript

Webhook {
    id: '6225875037061120',
    url: 'https://winterfell.westeros.gov/events-from-stark-bank',
    subscriptions: [ 'transfer', 'boleto', 'boleto-payment', 'utility-payment' ]
}
  

PHP

StarkBank\Webhook Object
(
    [id] => 6225875037061120
    [url] => https://winterfell.westeros.gov/events-from-stark-bank
    [subscriptions] => Array
        (
            [0] => boleto
            [1] => boleto-payment
            [2] => transfer
            [3] => utility-payment
        )

)
  

Java

Webhook({
  "id": "6225875037061120",
  "url": "https://winterfell.westeros.gov/events-from-stark-bank",
  "subscriptions": ["boleto", "boleto-payment", "transfer", "utility-payment"]
})
  

Ruby

webhook(
  id: 6225875037061120,
  url: https://winterfell.westeros.gov/events-from-stark-bank,
  subscriptions: ["boleto", "boleto-payment", "transfer", "utility-payment"]
)
  

Elixir

%StarkBank.Webhook{
    id: "6225875037061120",
    url: "https://winterfell.westeros.gov/events-from-stark-bank",
    subscriptions: [
        "boleto",
        "boleto-payment",
        "transfer",
        "utility-payment"
    ]
}
  

C#

Webhook(
    Url: https://winterfell.westeros.gov/events-from-stark-bank,
    Subscriptions: { transfer, boleto, boleto-payment, utility-payment },
    ID: 6225875037061120
)
  

Go

{
    Url:https://winterfell.westeros.gov/events-from-stark-bank
    Subscriptions:[boleto boleto-payment transfer utility-payment]
    Id:6225875037061120
}
  

Clojure

{:id "6225875037061120",
 :url "https://winterfell.westeros.gov/events-from-stark-bank",
 :subscriptions
 ["boleto" "boleto-payment" "transfer" "utility-payment"]}
  

Curl

{
    "message": "Webhook successfully created",
    "webhook": {
        "id": "6225875037061120",
        "url": "https://winterfell.westeros.gov/events-from-stark-bank",
        "subscriptions": [
            "boleto",
            "boleto-payment",
            "transfer",
            "utility-payment"
        ]
    }
}
  

List Webhooks

Get a list of non-deleted webhooks in chunks of at most 100. If you need smaller chunks, use the limit parameter.

Parameters

cursor OPTIONAL

String used to get the next batch of results. Our SDKs handle this for you.

fields OPTIONAL

List of strings to filter response JSON keys. Not available in the SDKs.

limit OPTIONAL

Maximum number of Webhooks to be retrieved. Max = 100.

ENDPOINT
GET /v2/webhook
REQUEST

Python

import starkbank

webhooks = starkbank.webhook.query()

for webhook in webhooks:
    print(webhook)
  

Javascript

const starkbank = require('starkbank');

(async() => {
    let webhooks = await starkbank.webhook.query();

    for await (let webhook of webhooks) {
        console.log(webhook);
    }
})();
  

PHP

$webhooks = StarkBank\Webhook::query();

foreach($webhooks as $webhook){
    print_r($webhook);
}
  

Java

import com.starkbank.*;
import com.starkbank.utils.Generator;

Generator<Webhook> webhooks = Webhook.query();

for (Webhook webhook : webhooks){
    System.out.println(webhook);
}
  

Ruby

require('starkbank')

webhooks = StarkBank::Webhook.query()

webhooks.each do |webhook|
    puts webhook
end
  

Elixir

webhooks = StarkBank.Webhook.query!()

for webhook <- webhooks do
    webhook |> IO.inspect
end
  

C#

using System;
using System.Collections.Generic;

IEnumerable<StarkBank.Webhook> webhooks = StarkBank.Webhook.Query();

foreach(StarkBank.Webhook webhook in webhooks)
{
    Console.WriteLine(webhook);
}
  

Go

package main

import (
    "fmt"
    "github.com/starkbank/sdk-go/starkbank/webhook"
)

func main() {

    webhooks, errorChannel := webhook.Query(nil, nil)

    loop:
    for {
        select {
        case err := <-errorChannel:
            if err.Errors != nil {
                for _, e := range err.Errors {
                    fmt.Printf("code: %s, message: %s", e.Code, e.Message)
                }
            }
        case webhook, ok := <-webhooks:
            if !ok {
                break loop
            }
            fmt.Printf("%+v", webhook)
        }
    }
}
  

Clojure

(def webhooks (starkbank.webhook/query))
(dorun (map println webhooks))
  

Curl

curl --location --request GET '{{baseUrl}}/v2/webhook' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}'
  
RESPONSE

Python

Webhook(
    id=6225875037061120,
    subscriptions=['boleto', 'boleto-payment', 'transfer', 'utility-payment'],
    url=https://winterfell.westeros.gov/events-from-stark-bank
)
  

Javascript

Webhook {
    url: 'https://winterfell.westeros.gov/events-from-stark-bank',
    subscriptions: [ 'transfer', 'boleto', 'boleto-payment', 'utility-payment' ],
    id: '6225875037061120'
}
  

PHP

StarkBank\Webhook Object
(
    [id] => 6225875037061120
    [url] => https://winterfell.westeros.gov/events-from-stark-bank
    [subscriptions] => Array
        (
            [0] => boleto
            [1] => boleto-payment
            [2] => transfer
            [3] => utility-payment
        )

)
  

Java

Webhook({
    "id": "6225875037061120",
    "url": "https://winterfell.westeros.gov/events-from-stark-bank",
    "subscriptions": ["boleto", "boleto-payment", "transfer", "utility-payment"]
})
  

Ruby

webhook(
    id: 6225875037061120,
    url: https://winterfell.westeros.gov/events-from-stark-bank,
    subscriptions: ["boleto", "boleto-payment", "transfer", "utility-payment"]
)
  

Elixir

%StarkBank.Webhook{
    id: "4844331563220992",
    url: "https://winterfell.westeros.gov/events-from-stark-bank",
    subscriptions: [
        "boleto",
        "boleto-payment",
        "transfer",
        "utility-payment"
    ]
}
  

C#

Webhook(
    Url: https://webhook.site/60e9c18e-4b5c-4369-bda1-ab5fcd8e1b29,
    Subscriptions: { transfer, boleto, boleto-payment, utility-payment },
    ID: 6225875037061120
)
  

Go

{
    Url:https://winterfell.westeros.gov/events-from-stark-bank
    Subscriptions:[boleto boleto-payment transfer utility-payment]
    Id:6225875037061120
}
  

Clojure

{:id "6225875037061120",
 :url "https://winterfell.westeros.gov/events-from-stark-bank",
 :subscriptions
 ["boleto" "boleto-payment" "transfer" "utility-payment"]}
  

Curl

{
    "cursor": null,
    "webhooks": [
        {
            "id": "6225875037061120",
            "url": "https://winterfell.westeros.gov/events-from-stark-bank",
            "subscriptions": [
                "boleto",
                "boleto-payment",
                "transfer",
                "utility-payment"
            ]
        }
    ]
}
  

Get a Webhook

Get a single Webhook by its id.

Parameters

id REQUIRED

Id of the webhook entity

fields OPTIONAL

List of strings to filter response JSON keys. Not available in the SDKs.

ENDPOINT
GET /v2/webhook/:id
REQUEST

Python

import starkbank

webhook = starkbank.webhook.get("6225875037061120")

print(webhook)
  

Javascript

const starkbank = require('starkbank');

(async() => {
    let webhook = await starkbank.webhook.get('6225875037061120');
    console.log(webhook);
})();
  

PHP

$webhook = StarkBank\Webhook::get("6225875037061120");

print_r($webhook);
  

Java

import com.starkbank.*;

Webhook webhook = Webhook.get("6225875037061120");

System.out.println(webhook);
  

Ruby

require('starkbank')

webhook = StarkBank::Webhook.get('6225875037061120')

puts webhook
  

Elixir

webhook = StarkBank.Webhook.get!("6225875037061120")

webhook |> IO.inspect
  

C#

using System;

StarkBank.Webhook webhook = StarkBank.Webhook.Get("6225875037061120");

Console.WriteLine(webhook);
  

Go

package main

import (
    "fmt"
    "github.com/starkbank/sdk-go/starkbank/webhook"
)

func main() {

    webhook, err := webhook.Get("6225875037061120", nil)
    if err.Errors != nil {
        for _, e := range err.Errors {
            fmt.Printf("code: %s, message: %s", e.Code, e.Message)
        }
    }

    fmt.Printf("%+v", webhook)
}
  

Clojure

(def webhook (starkbank.webhook/get "6225875037061120"))
(println webhook)
  

Curl

curl --location --request GET '{{baseUrl}}/v2/webhook/6225875037061120' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}'
  
RESPONSE

Python

Webhook(
    id=6225875037061120,
    subscriptions=['boleto', 'boleto-payment', 'transfer', 'utility-payment'],
    url=https://winterfell.westeros.gov/events-from-stark-bank
)
  

Javascript

Webhook {
    id: '6225875037061120',
    url: 'https://winterfell.westeros.gov/events-from-stark-bank',
    subscriptions: [ 'boleto', 'boleto-payment', 'transfer', 'utility-payment' ]
}
  

PHP

StarkBank\Webhook Object
(
    [id] => 6225875037061120
    [url] => https://winterfell.westeros.gov/events-from-stark-bank
    [subscriptions] => Array
        (
            [0] => boleto
            [1] => boleto-payment
            [2] => transfer
            [3] => utility-payment
        )

)
  

Java

Webhook({
    "id": "6225875037061120",
    "url": "https://winterfell.westeros.gov/events-from-stark-bank",
    "subscriptions": ["boleto", "boleto-payment", "transfer", "utility-payment"]
})
  

Ruby

webhook(
  id: 6225875037061120,
  url: https://winterfell.westeros.gov/events-from-stark-bank,
  subscriptions: ["boleto", "boleto-payment", "transfer", "utility-payment"]
)
  

Elixir

%StarkBank.Webhook{
    id: "6225875037061120",
    url: "https://winterfell.westeros.gov/events-from-stark-bank",
    subscriptions: [
        "boleto",
        "boleto-payment",
        "transfer",
        "utility-payment"
    ]
}
  

C#

Webhook(
    Url: https://webhook.site/60e9c18e-4b5c-4369-bda1-ab5fcd8e1b29,
    Subscriptions: { transfer, boleto, boleto-payment, utility-payment },
    ID: 6225875037061120
)
  

Go

{
    Url:https://winterfell.westeros.gov/events-from-stark-bank
    Subscriptions:[boleto boleto-payment transfer utility-payment]
    Id:6225875037061120
}
  

Clojure

{:id "6225875037061120",
 :url "https://winterfell.westeros.gov/events-from-stark-bank",
 :subscriptions
 ["boleto" "boleto-payment" "transfer" "utility-payment"]}
  

Curl

{
    "webhook": {
        "id": "6225875037061120",
        "url": "https://winterfell.westeros.gov/events-from-stark-bank",
        "subscriptions": [
            "boleto",
            "boleto-payment",
            "transfer",
            "utility-payment"
        ]
    }
}
  

Delete a Webhook

Delete a single Webhook subscription.

NOTE: This action cannot be undone.

Parameters

id REQUIRED

Id of the Webhook to be canceled.

ENDPOINT
DELETE /v2/webhook/:id
REQUEST

Python

import starkbank

webhook = starkbank.webhook.delete("6225875037061120")

print(webhook)
  

Javascript

const starkbank = require('starkbank');

(async() => {
    let webhook = await starkbank.webhook.delete('6225875037061120');
    console.log(webhook);
})();
  

PHP

$webhook = StarkBank\Webhook::delete("6225875037061120");

print_r($webhook);
  

Java

import com.starkbank.*;

Webhook webhook = Webhook.delete("6225875037061120");

System.out.println(webhook);
  

Ruby

require('starkbank')

webhook = StarkBank::Webhook.delete('6225875037061120')

puts webhook
  

Elixir

webhook = StarkBank.Webhook.delete!("6225875037061120")

webhook |> IO.inspect
  

C#

using System;

StarkBank.Webhook webhook = StarkBank.Webhook.Delete("6225875037061120");

Console.WriteLine(webhook);
  

Go

package main

import (
    "fmt"
    "github.com/starkbank/sdk-go/starkbank/webhook"
)

func main() {

    webhook, err := webhook.Delete("6225875037061120", nil)
    if err.Errors != nil {
        for _, e := range err.Errors {
            fmt.Printf("code: %s, message: %s", e.Code, e.Message)
        }
    }

    fmt.Printf("%+v", webhook)
}
  

Clojure

(def webhook (starkbank.webhook/delete "6225875037061120"))
(println webhook)
  

Curl

curl --location --request DELETE '{{baseUrl}}/v2/webhook/6225875037061120' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}'
  
RESPONSE

Python

Webhook(
    id=6225875037061120,
    subscriptions=['boleto', 'boleto-payment', 'transfer', 'utility-payment'],
    url=https://winterfell.westeros.gov/events-from-stark-bank
)
  

Javascript

Webhook {
    id: '6225875037061120',
    url: 'https://winterfell.westeros.gov/events-from-stark-bank',
    subscriptions: [ 'boleto', 'boleto-payment', 'transfer', 'utility-payment' ]
}
  

PHP

StarkBank\Webhook Object
(
    [id] => 6225875037061120
    [url] => https://winterfell.westeros.gov/events-from-stark-bank
    [subscriptions] => Array
        (
            [0] => boleto
            [1] => boleto-payment
            [2] => transfer
            [3] => utility-payment
        )

)
  

Java

Webhook({
    "id": "6225875037061120",
    "url": "https://winterfell.westeros.gov/events-from-stark-bank",
    "subscriptions": ["boleto", "boleto-payment", "transfer", "utility-payment"]
})
  

Ruby

webhook(
  id: 6225875037061120,
  url: https://winterfell.westeros.gov/events-from-stark-bank,
  subscriptions: ["boleto", "boleto-payment", "transfer", "utility-payment"]
)
  

Elixir

%StarkBank.Webhook{
    id: "6225875037061120",
    url: "https://winterfell.westeros.gov/events-from-stark-bank",
    subscriptions: [
        "boleto",
        "boleto-payment",
        "transfer",
        "utility-payment"
    ]
}
  

C#

Webhook(
    Url: https://webhook.site/60e9c18e-4b5c-4369-bda1-ab5fcd8e1b29,
    Subscriptions: { transfer, boleto, boleto-payment, utility-payment },
    ID: 6225875037061120
)
  

Go

{
    Url:https://winterfell.westeros.gov/events-from-stark-bank
    Subscriptions:[boleto boleto-payment transfer utility-payment]
    Id:6225875037061120
}
  

Clojure

{:id "6225875037061120",
 :url "https://winterfell.westeros.gov/events-from-stark-bank",
 :subscriptions
 ["boleto" "boleto-payment" "transfer" "utility-payment"]}
  

Curl

{
    "message": "Webhook successfully deleted",
    "webhook": {
        "id": "6225875037061120",
        "url": "https://winterfell.westeros.gov/events-from-stark-bank",
        "subscriptions": [
            "boleto",
            "boleto-payment",
            "transfer",
            "utility-payment"
        ]
    }
}
  

Event

Every time a log is created, a corresponding event will be generated and sent to you by webhook, if the appropriate subscription was set. Therefore, the event represents an occurrence in your workspace.

NOTE: All the events have a log property containing an entity log. The nature of the log, however, may change according to the subscription that triggered the event. For example, if the subscription is transfer, the log in the event will be a TransferLog. If the subscription is boleto, the log in the event will be a BoletoLog, and so on.

The Event object

Attributes

id STRING

Unique id for the event.

created STRING

Creation datetime. Example: "2020-04-23T23:00:00.000000+00:00".

isDelivered STRING

Whether the event has been successfully delivered. Options: "true", "false".

subscription STRING

Subscription that triggered the event.

workspaceId STRING

ID of the workspace the event belongs to.

List Events

Get a list of non-deleted events in chunks of at most 100. If you need smaller chunks, use the limit parameter.

Parameters

after OPTIONAL

Date filter for Events created only after a specific date. Example: "2022-01-20"

before OPTIONAL

Date filter for Events created only before a specific date. Example: "2022-02-20"

cursor OPTIONAL

String used to get the next batch of results. Our SDKs handle this for you.

fields OPTIONAL

List of strings to filter response JSON keys. Not available in the SDKs.

isDelivered OPTIONAL

If false, only gets Events that haven't been delivered. If true, only gets Events that have already been delivered.

limit OPTIONAL

Maximum number of Events to be retrieved. Max = 100.

ENDPOINT
GET /v2/event
REQUEST

Python

import starkbank

events = starkbank.event.query(
    is_delivered=False,
    after="2020-04-01",
    before="2020-04-30"
)

for event in events:
    print(event)
  

Javascript

const starkbank = require('starkbank');

(async() => {
    let events = await starkbank.event.query({
        isDelivered: false,
        after: '2020-04-01',
        before: '2020-04-30',
    });

    for await (let event of events) {
        console.log(event);
    }
})();
  

PHP

$events = StarkBank\Event::query([
    "isDelivered" => false,
    "after" => "2020-04-01",
    "before" => "2020-04-30"
]);

foreach($events as $event){
    print_r($event);
}
  

Java

import com.starkbank.*;
import com.starkbank.utils.Generator;
import java.util.HashMap;

HashMap<String, Object> params = new HashMap<>();
params.put("isDelivered", false);
params.put("after", "2020-04-01");
params.put("before", "2020-04-30");
Generator<Event> events = Event.query(params);

for (Event event : events){
    System.out.println(event);
}
  

Ruby

require('starkbank')

events = StarkBank::Event.query(
    after: '2020-04-01',
    before: '2020-04-30',
    is_delivered: false
)

events.each do |event|
    puts event
end
  

Elixir

events = StarkBank.Event.query!(
    after: "2020-04-01",
    before: "2020-04-30",
    is_delivered: false
)

for event <- events do
    event |> IO.inspect
end
  

C#

using System;
using System.Collections.Generic;

IEnumerable<StarkBank.Event> events = StarkBank.Event.Query(
    after: new DateTime(2020, 4, 1),
    before: new DateTime(2020, 4, 30),
    isDelivered: false
);

foreach(StarkBank.Event eventObject in events)
{
    Console.WriteLine(eventObject);
}
  

Go

package main

import (
    "fmt"
    "time"
    "github.com/starkbank/sdk-go/starkbank/event"
)

func main() {

    var params = map[string]interface{}{}
    params["isDelivered"] = false
    params["after"] = time.Date(2020, 4, 1, 0, 0, 0, 0, time.UTC)
    params["before"] = time.Date(2020, 4, 30, 0, 0, 0, 0, time.UTC)

    events, errorChannel := event.Query(params, nil)

    loop:
    for {
        select {
        case err := <-errorChannel:
            if err.Errors != nil {
                for _, e := range err.Errors {
                    fmt.Printf("code: %s, message: %s", e.Code, e.Message)
                }
            }
        case event, ok := <-events:
            if !ok {
                break loop
            }
            fmt.Printf("%+v", event)
        }
    }
}
  

Clojure

(def events
  (starkbank.event/query
    {
      :after "2020-03-20"
      :before "2020-04-30"
      :is-delivered false
    }))
(dorun (map println events))
  

Curl

curl --location --request GET '{{baseUrl}}/v2/event' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}'
  
RESPONSE

Python

Event(
    id=4537025176797184,
    is_delivered=False,
    subscription=transfer,
    created=2020-04-24 17:49:10.181589,
    log=Log(
        id=5662318377566208,
        created=2020-04-24 17:49:09.348444,
        errors=[],
        type=sending,
        transfer=Transfer(
            id=5950134772826112,
            account_number=76543-8,
            amount=100000000,
            bank_code=665,
            branch_code=2201,
            created=2020-04-24 17:49:08.748893,
            fee=200,
            name=Daenerys Targaryen Stormborn,
            status=processing,
            tags=['daenerys', 'invoice/1234'],
            tax_id=594.739.480-42,
            transaction_ids=['5991715760504832'],
            updated=2020-04-24 17:49:09.632271
        )
    ),
    workspace_id=1231231231231231
)
  

Javascript

Event {
    id: '4537025176797184',
    created: '2020-04-24T17:49:10.847726+00:00',
    isDelivered: false,
    subscription: 'transfer',
    log: {
        id: '5662318377566208',
        errors: [],
        type: 'sending',
        created: '2020-04-24T17:49:09.884128+00:00',
        payment: {
            id: '5950134772826112'
            accountNumber: '76543-8',
            amount: 10785,
            bankCode: '665',
            branchCode: '2201',
            created: '2020-04-24T17:49:08.038706+00:00',
            fee: 200,
            name: 'Daenerys Targaryen Stormborn',
            status: 'processing',
            tags: ['daenerys', 'invoice/1234'],
            taxId: '594.739.480-42',
            transactionIds: ['5991715760504832'],
            updated: '2020-04-24T17:49:09.038706+00:00',
        }
    },
    workspaceId='1231231231231231'
}
  

PHP

StarkBank\Event Object
(
    [id] => 4537025176797184
    [isDelivered] => false
    [subscription] => transfer
    [created] => DateTime Object
        (
            [date] => 2020-04-24 17:49:10.616917
            [timezone_type] => 1
            [timezone] => +00:00
        )

    [log] => StarkBank\Transfer\Log Object
        (
            [id] => 5662318377566208
            [created] => DateTime Object
                (
                    [date] => 2020-04-24 17:49:09.844960
                    [timezone_type] => 1
                    [timezone] => +00:00
                )

            [type] => sending
            [errors] => Array
                (
                )

            [transfer] => StarkBank\Transfer Object
                (
                    [id] => 5950134772826112
                    [amount] => 100000000
                    [name] => Daenerys Targaryen Stormborn
                    [taxId] => 594.739.480-42
                    [bankCode] => 665
                    [branchCode] => 2201
                    [accountNumber] => 76543-8
                    [tags] => Array
                        (
                            [0] => daenerys
                            [1] => invoice/1234
                        )

                    [fee] => 200
                    [status] => processing
                    [transactionIds] => Array
                        (
                            [0] => 5991715760504832
                        )

                    [created] => DateTime Object
                        (
                            [date] => 2020-04-24 17:49:08.277606
                            [timezone_type] => 1
                            [timezone] => +00:00
                        )

                    [updated] => DateTime Object
                        (
                            [date] => 2020-04-24 17:49:09.090932
                            [timezone_type] => 1
                            [timezone] => +00:00
                        )

                )

        )

    [workspaceId] => 1231231231231231

)
  

Java

Event({
    "id": "4537025176797184",
    "created": "2020-04-24T17:49:10+00:00",
    "isDelivered": false,
    "subscription": "transfer",
    "log": {
        "id": "5662318377566208",
        "created": "2020-04-24T17:49:13+00:00",
        "type": "registered",
        "errors": [],
        "transfer": {
            "id": "5429309233692672",
            "accountNumber": "76543-8",
            "amount": 100000000,
            "bankCode": "665",
            "branchCode": "2201",
            "created": "2020-04-24T17:49:13+00:00"
            "fee": 200,
            "name": "Daenerys Targaryen Stormborn",
            "status": "processing",
            "tags": ["daenerys", "invoice/1234"],
            "taxId": "594.739.480-42",
            "transactionIds": ["5991715760504832"],
            "updated": "2020-04-24T17:49:13+00:00"
        }
    },
    "workspaceId": 1231231231231231
})
  

Ruby

event(
    id: 4537025176797184,
    created: 2020-04-24T17:49:10+00:00,
    is_delivered: false,
    subscription: transfer,
    log: log(
        id: 5662318377566208,
        created: 2020-04-24T17:49:09+00:00,
        type: sending,
        errors: [],
        transfer: transfer(
            id: 5950134772826112,
            account_number: 76543-8,
            amount: 100000000,
            bank_code: 665,
            branch_code: 2201,
            created: 2020-04-24T17:49:09+00:00
            fee: 200,
            name: Daenerys Targaryen Stormborn,
            status: processing,
            tags: ["daenerys", "invoice/1234"],
            tax_id: 594.739.480-42,
            transaction_ids: ["5991715760504832"],
            updated: 2020-04-24T17:49:09+00:00
        )
    ),
    workspace_id: 1231231231231231
)
  

Elixir

%StarkBank.Event{
    id: "4537025176797184",
    is_delivered: false,
    subscription: "transfer",
    created: ~U[2020-04-24 17:49:09.594656Z],
    log: %StarkBank.Transfer.Log{
        id: "5662318377566208",
        created: ~U[2020-04-24 17:49:09.049096Z],
        errors: [],
        type: "sending",
        payment: %StarkBank.Transfer{
            id: "5950134772826112",
            account_number: 76543-8,
            amount: 11631,
            bank_code: "665",
            branch_code: "2201",
            created: ~U[2020-04-24 17:49:09.713657Z],
            fee: 200,
            name: "Daenerys Targaryen Stormborn",
            status: "processing",
            tags: ["daenerys", "invoice/1234"],
            tax_id: "594.739.480-42"
            transaction_ids: ["5991715760504832"],
            updated: ~U[2020-04-24 17:49:09.713657Z]
        }
    },
    workspace_id: "1231231231231231"
}
  

C#

Event(
    ID: 4537025176797184,
    IsDelivered: False,
    Subscription: transfer,
    Created: 04/24/2020 17:49:09,
    Log: Log(
        ID: 5662318377566208,
        Created: 04/24/2020 17:49:09,
        Type: sending,
        Errors: {  },
        Transfer: Transfer(
            ID: 5950134772826112
            AccountNumber: 76543-8,
            Amount: 100000000,
            BankCode: 665,
            BranchCode: 2201,
            Created: 04/24/2020 17:49:09,
            Fee: 200,
            Name: Daenerys Targaryen Stormborn,
            Status: processing,
            Tags: { daenerys, invoice/1234 },
            TaxID: 594.739.480-42,
            TransactionIds: { 5991715760504832 },
            Updated: 04/24/2020 17:49:09
        )
    ),
    WorkspaceId: 1231231231231231
)
  

Go

{
    Id:4537025176797184
    Log:{
        Id:5662318377566208
        Transfer:{
            Id:5950134772826112
            AccountNumber:76543-8
            Amount:1000000
            BankCode:665
            BranchCode:2201
            Created:2020-04-24 17:49:10.38386 +0000 +0000
            Fine:200
            Name:Daenerys Targaryen Stormborn
            Status:processing
            Tags:[daenerys invoice/1234]
            TaxId:594.739.480-42
            TransactionIds:[5991715760504832]
            Created:2020-04-24 17:49:09.38386 +0000 +0000
        }
        Errors:[]
        Type:sending
        Created:2020-04-24 17:49:09.126413 +0000 +0000
    }
    Created:2020-04-24 17:49:09.464471 +0000 +0000
    IsDelivered:false
    Subscription:transfer
    WorkspaceId:1231231231231231
}
  

Clojure

{:id "4537025176797184",
 :created "2020-04-24T17:49:09.359338+00:00",
 :is-delivered false,
 :subscription "transfer",
 :log
 {:id "5662318377566208",
  :created "2020-04-24T17:49:09.703951+00:00",
  :errors [],
  :type "sending",
  :transfer
  {:id "5950134772826112",
   :account-number 76543-8,
   :amount 100000000,
   :bank-code "665",
   :branch-code "2201",
   :created "2020-04-24T17:49:09.128124+00:00",
   :fee 200,
   :name "Daenerys Targaryen Stormborn",
   :status "processing",
   :tags ["daenerys" "invoice/1234"],
   :transaction-ids ["5991715760504832"],
   :updated "2020-04-24T17:49:09.128124+00:00"}}
 :workspace-id "1231231231231231"}
  

Curl

{
    "cursor": null,
    "events": [
        {
            "id": "4537025176797184",
            "isDelivered": false,
            "subscription": "transfer",
            "created": "2020-04-24T17:49:00.201602+00:00",
            "log": {
                "id": "5662318377566208",
                "errors": [],
                "type": "sending",
                "created": "2020-04-24T17:49:09.751122+00:00",
                "transfer": {
                    "id": "5950134772826112",
                    "accountNumber": "76543-8",
                    "amount": 100000000,
                    "bankCode": "665",
                    "branchCode": "2201",
                    "created": "2020-04-24T17:49:09.130246+00:00",
                    "fee": 200,
                    "name": "Daenerys Targaryen Stormborn",
                    "status": "processing",
                    "taxId": "594.739.480-42",
                    "tags": ["daenerys", "invoice/1234"],
                    "transactionIds": ["5991715760504832"],
                    "updated": "2020-04-24T17:49:02.130255+00:00",
                }
            },
            "workspaceId": "1231231231231231"
        }
    ]
}
  

Get an Event

Get a single Event by its id.

Parameters

id REQUIRED

Unique id of the event entity.

fields OPTIONAL

List of strings to filter response JSON keys. Not available in the SDKs.

ENDPOINT
GET /v2/event/:id
REQUEST

Python

import starkbank

event = starkbank.event.get("4537025176797184")

print(event)
  

Javascript

const starkbank = require('starkbank');

(async() => {
    let event = await starkbank.event.get('4537025176797184');
    console.log(event);
})();
  

PHP

$event = StarkBank\Event::get("4537025176797184");

print_r($event);
  

Java

import com.starkbank.*;

Event event = Event.get("4537025176797184");

System.out.println(event);
  

Ruby

require('starkbank')

event = StarkBank::Event.get('4537025176797184')

puts event
  

Elixir

event = StarkBank.Event.get!("4537025176797184")

event |> IO.inspect
  

C#

using System;

StarkBank.Event eventObject = StarkBank.Event.Get("4537025176797184");

Console.WriteLine(eventObject);
  

Go

package main

import (
    "fmt"
    "github.com/starkbank/sdk-go/starkbank/event"
)

func main() {

    event, err := event.Get("4537025176797184", nil)
    if err.Errors != nil {
        for _, e := range err.Errors {
            fmt.Printf("code: %s, message: %s", e.Code, e.Message)
        }
    }

    fmt.Printf("%+v", event)
}
  

Clojure

(def event (starkbank.event/get "4537025176797184"))
(println event)
  

Curl

curl --location --request GET '{{baseUrl}}/v2/event/4537025176797184' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}'
  
RESPONSE

Python

Event(
    id=4537025176797184,
    is_delivered=False,
    subscription=transfer,
    created=2020-04-24 17:49:10.181589,
    log=Log(
        id=5662318377566208,
        created=2020-04-24 17:49:09.348444,
        errors=[],
        type=sending,
        transfer=Transfer(
            id=5950134772826112,
            account_number=76543-8,
            amount=100000000,
            bank_code=665,
            branch_code=2201,
            created=2020-04-24 17:49:08.748893,
            fee=200,
            name=Daenerys Targaryen Stormborn,
            status=processing,
            tags=['daenerys', 'invoice/1234'],
            tax_id=594.739.480-42,
            transaction_ids=['5991715760504832'],
            updated=2020-04-24 17:49:09.632271
        )
    ),
    workspace_id=1231231231231231
)
  

Javascript

Event {
    id: '4537025176797184',
    created: '2020-04-24T17:49:10.847726+00:00',
    isDelivered: false,
    subscription: 'transfer',
    log: {
        id: '5662318377566208',
        errors: [],
        type: 'sending',
        created: '2020-04-24T17:49:09.884128+00:00',
        payment: {
            id: '5950134772826112'
            accountNumber: '76543-8',
            amount: 10785,
            bankCode: '665',
            branchCode: '2201',
            created: '2020-04-24T17:49:08.038706+00:00',
            fee: 200,
            name: 'Daenerys Targaryen Stormborn',
            status: 'processing',
            tags: ['daenerys', 'invoice/1234'],
            taxId: '594.739.480-42',
            transactionIds: ['5991715760504832'],
            updated: '2020-04-24T17:49:09.038706+00:00',
        }
    },
    workspaceId='1231231231231231'
}
  

PHP

StarkBank\Event Object
(
    [id] => 4537025176797184
    [isDelivered] => false
    [subscription] => transfer
    [created] => DateTime Object
        (
            [date] => 2020-04-24 17:49:10.616917
            [timezone_type] => 1
            [timezone] => +00:00
        )

    [log] => StarkBank\Transfer\Log Object
        (
            [id] => 5662318377566208
            [created] => DateTime Object
                (
                    [date] => 2020-04-24 17:49:09.844960
                    [timezone_type] => 1
                    [timezone] => +00:00
                )

            [type] => sending
            [errors] => Array
                (
                )

            [transfer] => StarkBankTransfer Object
                (
                    [id] => 5950134772826112
                    [amount] => 100000000
                    [name] => Daenerys Targaryen Stormborn
                    [taxId] => 594.739.480-42
                    [bankCode] => 665
                    [branchCode] => 2201
                    [accountNumber] => 76543-8
                    [tags] => Array
                        (
                            [0] => daenerys
                            [1] => invoice/1234
                        )

                    [fee] => 200
                    [status] => processing
                    [transactionIds] => Array
                        (
                            [0] => 5991715760504832
                        )

                    [created] => DateTime Object
                        (
                            [date] => 2020-04-24 17:49:08.277606
                            [timezone_type] => 1
                            [timezone] => +00:00
                        )

                    [updated] => DateTime Object
                        (
                            [date] => 2020-04-24 17:49:09.090932
                            [timezone_type] => 1
                            [timezone] => +00:00
                        )

                )

        )

    [workspaceId] => 1231231231231231

)
  

Java

Event({
    "id": "4537025176797184",
    "created": "2020-04-24T17:49:10+00:00",
    "isDelivered": false,
    "subscription": "transfer",
    "log": {
        "id": "5662318377566208",
        "created": "2020-04-24T17:49:13+00:00",
        "type": "registered",
        "errors": [],
        "transfer": {
            "id": "5429309233692672",
            "accountNumber": "76543-8",
            "amount": 100000000,
            "bankCode": "665",
            "branchCode": "2201",
            "created": "2020-04-24T17:49:13+00:00"
            "fee": 200,
            "name": "Daenerys Targaryen Stormborn",
            "status": "processing",
            "tags": ["daenerys", "invoice/1234"],
            "taxId": "594.739.480-42",
            "transactionIds": ["5991715760504832"],
            "updated": "2020-04-24T17:49:13+00:00"
        }
    },
    "workspaceId": 1231231231231231
})
  

Ruby

event(
    id: 4537025176797184,
    created: 2020-04-24T17:49:10+00:00,
    is_delivered: false,
    subscription: transfer,
    log: log(
        id: 5662318377566208,
        created: 2020-04-24T17:49:09+00:00,
        type: sending,
        errors: [],
        transfer: transfer(
            id: 5950134772826112,
            account_number: 76543-8,
            amount: 100000000,
            bank_code: 665,
            branch_code: 2201,
            created: 2020-04-24T17:49:09+00:00
            fee: 200,
            name: Daenerys Targaryen Stormborn,
            status: processing,
            tags: ["daenerys", "invoice/1234"],
            tax_id: 594.739.480-42,
            transaction_ids: ["5991715760504832"],
            updated: 2020-04-24T17:49:09+00:00
        )
    ),
    workspace_id: 1231231231231231
)
  

Elixir

%StarkBank.Event{
    id: "4537025176797184",
    is_delivered: false,
    subscription: "transfer",
    created: ~U[2020-04-24 17:49:09.594656Z],
    log: %StarkBank.Transfer.Log{
        id: "5662318377566208",
        created: ~U[2020-04-24 17:49:09.049096Z],
        errors: [],
        type: "sending",
        payment: %StarkBank.Transfer{
            id: "5950134772826112",
            account_number: 76543-8,
            amount: 11631,
            bank_code: "665",
            branch_code: "2201",
            created: ~U[2020-04-24 17:49:09.713657Z],
            fee: 200,
            name: "Daenerys Targaryen Stormborn",
            status: "processing",
            tags: ["daenerys", "invoice/1234"],
            tax_id: "594.739.480-42"
            transaction_ids: ["5991715760504832"],
            updated: ~U[2020-04-24 17:49:09.713657Z]
        }
    },
    workspace_id: "1231231231231231"
}
  

C#

Event(
    ID: 4537025176797184,
    IsDelivered: False,
    Subscription: transfer,
    Created: 04/24/2020 17:49:09,
    Log: Log(
        ID: 5662318377566208,
        Created: 04/24/2020 17:49:09,
        Type: sending,
        Errors: {  },
        Transfer: Transfer(
            ID: 5950134772826112
            AccountNumber: 76543-8,
            Amount: 100000000,
            BankCode: 665,
            BranchCode: 2201,
            Created: 04/24/2020 17:49:09,
            Fee: 200,
            Name: Daenerys Targaryen Stormborn,
            Status: processing,
            Tags: { daenerys, invoice/1234 },
            TaxID: 594.739.480-42,
            TransactionIds: { 5991715760504832 },
            Updated: 04/24/2020 17:49:09
        )
    ),
    WorkspaceId: 1231231231231231
)
  

Go

{
    Id:4537025176797184
    Log:{
        Id:5662318377566208
        Transfer:{
            Id:5950134772826112
            AccountNumber:76543-8
            Amount:1000000
            BankCode:665
            BranchCode:2201
            Created:2020-04-24 17:49:10.38386 +0000 +0000
            Fine:200
            Name:Daenerys Targaryen Stormborn
            Status:processing
            Tags:[daenerys invoice/1234]
            TaxId:594.739.480-42
            TransactionIds:[5991715760504832]
            Created:2020-04-24 17:49:09.38386 +0000 +0000
        }
        Errors:[]
        Type:sending
        Created:2020-04-24 17:49:09.126413 +0000 +0000
    }
    Created:2020-04-24 17:49:09.464471 +0000 +0000
    IsDelivered:false
    Subscription:transfer
    WorkspaceId:1231231231231231
}
  

Clojure

{:id "4537025176797184",
 :created "2020-04-24T17:49:09.359338+00:00",
 :is-delivered false,
 :subscription "transfer",
 :log
 {:id "5662318377566208",
  :created "2020-04-24T17:49:09.703951+00:00",
  :errors [],
  :type "sending",
  :transfer
  {:id "5950134772826112",
   :account-number 76543-8,
   :amount 100000000,
   :bank-code "665",
   :branch-code "2201",
   :created "2020-04-24T17:49:09.128124+00:00",
   :fee 200,
   :name "Daenerys Targaryen Stormborn",
   :status "processing",
   :tags ["daenerys" "invoice/1234"],
   :transaction-ids ["5991715760504832"],
   :updated "2020-04-24T17:49:09.128124+00:00"}}
 :workspace-id "1231231231231231"}
  

Curl

{
    "message": "Event successfully deleted",
    "event": {
        "id": "4537025176797184",
        "isDelivered": false,
        "subscription": "transfer",
        "created": "2020-04-24T17:49:00.201602+00:00",
        "log": {
            "id": "5662318377566208",
            "errors": [],
            "type": "sending",
            "created": "2020-04-24T17:49:09.751122+00:00",
            "transfer": {
                "id": "5950134772826112",
                "accountNumber": "76543-8",
                "amount": 100000000,
                "bankCode": "665",
                "branchCode": "2201",
                "created": "2020-04-24T17:49:09.130246+00:00",
                "fee": 200,
                "name": "Daenerys Targaryen Stormborn",
                "status": "processing",
                "taxId": "594.739.480-42",
                "tags": ["daenerys", "invoice/1234"],
                "transactionIds": ["5991715760504832"],
                "updated": "2020-04-24T17:49:02.130255+00:00",
            }
        },
        "workspaceId": "1231231231231231"
    }
}
  

Delete an Event

Delete a single Event from the event list.

Note: This action cannot be undone.

Parameters

id REQUIRED

Id of the Event entity to be canceled.

ENDPOINT
DELETE /v2/event/:id
REQUEST

Python

import starkbank

event = starkbank.event.delete("4537025176797184")

print(event)
  

Javascript

const starkbank = require('starkbank');

(async() => {
    let event = await starkbank.event.delete('4537025176797184');
    console.log(event);
})();
  

PHP

$event = StarkBank\Event::delete("4537025176797184");

print_r($event);
  

Java

import com.starkbank.*;

Event event = Event.delete("4537025176797184");

System.out.println(event);
  

Ruby

require('starkbank')

event = StarkBank::Event.delete('4537025176797184')

puts event
  

Elixir

event = StarkBank.Event.delete!("4537025176797184")

event |> IO.inspect
  

C#

using System;

StarkBank.Event eventObject = StarkBank.Event.Delete("4537025176797184");

Console.WriteLine(eventObject);
  

Go

package main

import (
    "fmt"
    "github.com/starkbank/sdk-go/starkbank/event"
)

func main() {

    event, err := event.Delete("4537025176797184", nil)
    if err.Errors != nil {
        for _, e := range err.Errors {
            fmt.Printf("code: %s, message: %s", e.Code, e.Message)
        }
    }

    fmt.Printf("%+v", event)
}
  

Clojure

(def event (starkbank.event/delete "4537025176797184"))
(println event)
  

Curl

curl --location --request DELETE '{{baseUrl}}/v2/event/4537025176797184' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}'
  
RESPONSE

Python

Event(
    id=4537025176797184,
    is_delivered=False,
    subscription=transfer,
    created=2020-04-24 17:49:10.181589,
    log=Log(
        id=5662318377566208,
        created=2020-04-24 17:49:09.348444,
        errors=[],
        type=sending,
        transfer=Transfer(
            id=5950134772826112,
            account_number=76543-8,
            amount=100000000,
            bank_code=665,
            branch_code=2201,
            created=2020-04-24 17:49:08.748893,
            fee=200,
            name=Daenerys Targaryen Stormborn,
            status=processing,
            tags=['daenerys', 'invoice/1234'],
            tax_id=594.739.480-42,
            transaction_ids=['5991715760504832'],
            updated=2020-04-24 17:49:09.632271
        )
    ),
    workspace_id=1231231231231231
)
  

Javascript

Event {
    id: '4537025176797184',
    created: '2020-04-24T17:49:10.847726+00:00',
    isDelivered: false,
    subscription: 'transfer',
    log: {
        id: '5662318377566208',
        errors: [],
        type: 'sending',
        created: '2020-04-24T17:49:09.884128+00:00',
        payment: {
            id: '5950134772826112'
            accountNumber: '76543-8',
            amount: 10785,
            bankCode: '665',
            branchCode: '2201',
            created: '2020-04-24T17:49:08.038706+00:00',
            fee: 200,
            name: 'Daenerys Targaryen Stormborn',
            status: 'processing',
            tags: ['daenerys', 'invoice/1234'],
            taxId: '594.739.480-42',
            transactionIds: ['5991715760504832'],
            updated: '2020-04-24T17:49:09.038706+00:00',
        }
    },
    workspaceId='1231231231231231'
}
  

PHP

StarkBank\Event Object
(
    [id] => 4537025176797184
    [isDelivered] => false
    [subscription] => transfer
    [created] => DateTime Object
        (
            [date] => 2020-04-24 17:49:10.616917
            [timezone_type] => 1
            [timezone] => +00:00
        )

    [log] => StarkBank\Transfer\Log Object
        (
            [id] => 5662318377566208
            [created] => DateTime Object
                (
                    [date] => 2020-04-24 17:49:09.844960
                    [timezone_type] => 1
                    [timezone] => +00:00
                )

            [type] => sending
            [errors] => Array
                (
                )

            [transfer] => StarkBank\Transfer Object
                (
                    [id] => 5950134772826112
                    [amount] => 100000000
                    [name] => Daenerys Targaryen Stormborn
                    [taxId] => 594.739.480-42
                    [bankCode] => 665
                    [branchCode] => 2201
                    [accountNumber] => 76543-8
                    [tags] => Array
                        (
                            [0] => daenerys
                            [1] => invoice/1234
                        )

                    [fee] => 200
                    [status] => processing
                    [transactionIds] => Array
                        (
                            [0] => 5991715760504832
                        )

                    [created] => DateTime Object
                        (
                            [date] => 2020-04-24 17:49:08.277606
                            [timezone_type] => 1
                            [timezone] => +00:00
                        )

                    [updated] => DateTime Object
                        (
                            [date] => 2020-04-24 17:49:09.090932
                            [timezone_type] => 1
                            [timezone] => +00:00
                        )

                )

        )

    [workspaceId] => 1231231231231231
)
  

Java

Event({
    "id": "4537025176797184",
    "created": "2020-04-24T17:49:10+00:00",
    "isDelivered": false,
    "subscription": "transfer",
    "log": {
        "id": "5662318377566208",
        "created": "2020-04-24T17:49:13+00:00",
        "type": "registered",
        "errors": [],
        "transfer": {
            "id": "5429309233692672",
            "accountNumber": "76543-8",
            "amount": 100000000,
            "bankCode": "665",
            "branchCode": "2201",
            "created": "2020-04-24T17:49:13+00:00"
            "fee": 200,
            "name": "Daenerys Targaryen Stormborn",
            "status": "processing",
            "tags": ["daenerys", "invoice/1234"],
            "taxId": "594.739.480-42",
            "transactionIds": ["5991715760504832"],
            "updated": "2020-04-24T17:49:13+00:00"
        }
    },
    "workspaceId": 1231231231231231
})
  

Ruby

event(
    id: 4537025176797184,
    created: 2020-04-24T17:49:10+00:00,
    is_delivered: false,
    subscription: transfer,
    log: log(
        id: 5662318377566208,
        created: 2020-04-24T17:49:09+00:00,
        type: sending,
        errors: [],
        transfer: transfer(
            id: 5950134772826112,
            account_number: 76543-8,
            amount: 100000000,
            bank_code: 665,
            branch_code: 2201,
            created: 2020-04-24T17:49:09+00:00
            fee: 200,
            name: Daenerys Targaryen Stormborn,
            status: processing,
            tags: ["daenerys", "invoice/1234"],
            tax_id: 594.739.480-42,
            transaction_ids: ["5991715760504832"],
            updated: 2020-04-24T17:49:09+00:00
        )
    ),
    workspace_id: 1231231231231231
)
  

Elixir

%StarkBank.Event{
    id: "4537025176797184",
    is_delivered: false,
    subscription: "transfer",
    created: ~U[2020-04-24 17:49:09.594656Z],
    log: %StarkBank.Transfer.Log{
        id: "5662318377566208",
        created: ~U[2020-04-24 17:49:09.049096Z],
        errors: [],
        type: "sending",
        payment: %StarkBank.Transfer{
            id: "5950134772826112",
            account_number: 76543-8,
            amount: 11631,
            bank_code: "665",
            branch_code: "2201",
            created: ~U[2020-04-24 17:49:09.713657Z],
            fee: 200,
            name: "Daenerys Targaryen Stormborn",
            status: "processing",
            tags: ["daenerys", "invoice/1234"],
            tax_id: "594.739.480-42"
            transaction_ids: ["5991715760504832"],
            updated: ~U[2020-04-24 17:49:09.713657Z]
        }
    },
    workspace_id: "1231231231231231"
}
  

C#

Event(
    ID: 4537025176797184,
    IsDelivered: False,
    Subscription: transfer,
    Created: 04/24/2020 17:49:09,
    Log: Log(
        ID: 5662318377566208,
        Created: 04/24/2020 17:49:09,
        Type: sending,
        Errors: {  },
        Transfer: Transfer(
            ID: 5950134772826112
            AccountNumber: 76543-8,
            Amount: 100000000,
            BankCode: 665,
            BranchCode: 2201,
            Created: 04/24/2020 17:49:09,
            Fee: 200,
            Name: Daenerys Targaryen Stormborn,
            Status: processing,
            Tags: { daenerys, invoice/1234 },
            TaxID: 594.739.480-42,
            TransactionIds: { 5991715760504832 },
            Updated: 04/24/2020 17:49:09
        )
    ),
    WorkspaceId: 1231231231231231
)
  

Go

{
    Id:4537025176797184
    Log:{
        Id:5662318377566208
        Transfer:{
            Id:5950134772826112
            AccountNumber:76543-8
            Amount:1000000
            BankCode:665
            BranchCode:2201
            Created:2020-04-24 17:49:10.38386 +0000 +0000
            Fine:200
            Name:Daenerys Targaryen Stormborn
            Status:processing
            Tags:[daenerys invoice/1234]
            TaxId:594.739.480-42
            TransactionIds:[5991715760504832]
            Created:2020-04-24 17:49:09.38386 +0000 +0000
        }
        Errors:[]
        Type:sending
        Created:2020-04-24 17:49:09.126413 +0000 +0000
    }
    Created:2020-04-24 17:49:09.464471 +0000 +0000
    IsDelivered:false
    Subscription:transfer
    WorkspaceId:1231231231231231
}
  

Clojure

{:id "4537025176797184",
 :created "2020-04-24T17:49:09.359338+00:00",
 :is-delivered false,
 :subscription "transfer",
 :log
 {:id "5662318377566208",
  :created "2020-04-24T17:49:09.703951+00:00",
  :errors [],
  :type "sending",
  :transfer
  {:id "5950134772826112",
   :account-number 76543-8,
   :amount 100000000,
   :bank-code "665",
   :branch-code "2201",
   :created "2020-04-24T17:49:09.128124+00:00",
   :fee 200,
   :name "Daenerys Targaryen Stormborn",
   :status "processing",
   :tags ["daenerys" "invoice/1234"],
   :transaction-ids ["5991715760504832"],
   :updated "2020-04-24T17:49:09.128124+00:00"}}
 :workspace-id "1231231231231231"}
  

Curl

{
    "message": "Event successfully deleted",
    "event": {
        "id": "4537025176797184",
        "isDelivered": false,
        "subscription": "transfer",
        "created": "2020-04-24T17:49:00.201602+00:00",
        "log": {
            "id": "5662318377566208",
            "errors": [],
            "type": "sending",
            "created": "2020-04-24T17:49:09.751122+00:00",
            "transfer": {
                "id": "5950134772826112",
                "accountNumber": "76543-8",
                "amount": 100000000,
                "bankCode": "665",
                "branchCode": "2201",
                "created": "2020-04-24T17:49:09.130246+00:00",
                "fee": 200,
                "name": "Daenerys Targaryen Stormborn",
                "status": "processing",
                "taxId": "594.739.480-42",
                "tags": ["daenerys", "invoice/1234"],
                "transactionIds": ["5991715760504832"],
                "updated": "2020-04-24T17:49:02.130255+00:00",
            }
        },
        "workspaceId": "1231231231231231"
    }
}
  

Update an event

The only information you can update in an Event is the isDelivered property. This can be useful when, after experiencing server downtime on your side, you list all events with isDelivered=false, process them, and then set them as delivered to stabilize your operations.

Parameters

id REQUIRED

Id of the event entity. Example: "5719405850615809"

isDelivered REQUIRED

Bool signaling if the Event has or hasn't been successfully delivered.

ENDPOINT
PATCH /v2/event/:id
REQUEST

Python

import starkbank

event = starkbank.event.update("4537025176797184", is_delivered=True)

print(event)
  

Javascript

const starkbank = require('starkbank');

(async() => {
    let event = await starkbank.event.update('4537025176797184', {isDelivered: true});
    console.log(event);
})();
  

PHP

$event = StarkBank\Event::update(
    "4537025176797184",
    ["isDelivered" => true]
);

print_r($event);
  

Java

import com.starkbank.*;
import java.util.HashMap;

HashMap<String, Object> params = new HashMap<>();
params.put("isDelivered", true);
Event event = Event.update("4537025176797184", params);

System.out.println(event);
  

Ruby

require('starkbank')

event = StarkBank::Event.update(
    '4537025176797184',
    is_delivered: true
)

puts event
  

Elixir

event = StarkBank.Event.update!("4537025176797184", is_delivered: true)

event |> IO.inspect
  

C#

using System;

StarkBank.Event eventObject = StarkBank.Event.Update(
    "4537025176797184",
    isDelivered: true
);

Console.WriteLine(eventObject);
  

Go

package main

import (
    "fmt"
    "github.com/starkbank/sdk-go/starkbank/event"
)

func main() {

    patchData := map[string]interface{}{}
    patchData["isDelivered"] = true

    event, err := event.Update("4537025176797184", patchData, nil)
    if err.Errors != nil {
        for _, e := range err.Errors {
            fmt.Printf("code: %s, message: %s", e.Code, e.Message)
        }
    }

    fmt.Printf("%+v", event)
}
  

Clojure

(def event (starkbank.event/update "4537025176797184" {:is-delivered true}))
(println event)
  

Curl

curl --location --request PATCH '{{baseUrl}}/v2/event/4537025176797184' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}' 
--header 'Content-Type: application/json' 
--data-raw '{
    "isDelivered": true
}'
  
RESPONSE

Python

Event(
    id=4537025176797184,
    is_delivered=True,
    subscription=transfer,
    created=2020-04-24 17:49:10.181589,
    log=Log(
        id=5662318377566208,
        created=2020-04-24 17:49:09.348444,
        errors=[],
        type=sending,
        transfer=Transfer(
            id=5950134772826112,
            account_number=76543-8,
            amount=100000000,
            bank_code=665,
            branch_code=2201,
            created=2020-04-24 17:49:08.748893,
            fee=200,
            name=Daenerys Targaryen Stormborn,
            status=processing,
            tags=['daenerys', 'invoice/1234'],
            tax_id=594.739.480-42,
            transaction_ids=['5991715760504832'],
            updated=2020-04-24 17:49:09.632271
        )
    ),
    workspace_id=1231231231231231
)
  

Javascript

Event {
    id: '4537025176797184',
    created: '2020-04-24T17:49:10.847726+00:00',
    isDelivered: true,
    subscription: 'transfer',
    log: {
        id: '5662318377566208',
        errors: [],
        type: 'sending',
        created: '2020-04-24T17:49:09.884128+00:00',
        payment: {
            id: '5950134772826112'
            accountNumber: '76543-8',
            amount: 10785,
            bankCode: '665',
            branchCode: '2201',
            created: '2020-04-24T17:49:08.038706+00:00',
            fee: 200,
            name: 'Daenerys Targaryen Stormborn',
            status: 'processing',
            tags: ['daenerys', 'invoice/1234'],
            taxId: '594.739.480-42',
            transactionIds: ['5991715760504832'],
            updated: '2020-04-24T17:49:09.038706+00:00',
        }
    },
    workspaceId='1231231231231231'
}
  

PHP

StarkBank\Event Object
(
    [id] => 4537025176797184
    [isDelivered] => true
    [subscription] => transfer
    [created] => DateTime Object
        (
            [date] => 2020-04-24 17:49:10.616917
            [timezone_type] => 1
            [timezone] => +00:00
        )

    [log] => StarkBankTransferLog Object
        (
            [id] => 5662318377566208
            [created] => DateTime Object
                (
                    [date] => 2020-04-24 17:49:09.844960
                    [timezone_type] => 1
                    [timezone] => +00:00
                )

            [type] => sending
            [errors] => Array
                (
                )

            [transfer] => StarkBankTransfer Object
                (
                    [id] => 5950134772826112
                    [amount] => 100000000
                    [name] => Daenerys Targaryen Stormborn
                    [taxId] => 594.739.480-42
                    [bankCode] => 665
                    [branchCode] => 2201
                    [accountNumber] => 76543-8
                    [tags] => Array
                        (
                            [0] => daenerys
                            [1] => invoice/1234
                        )

                    [fee] => 200
                    [status] => processing
                    [transactionIds] => Array
                        (
                            [0] => 5991715760504832
                        )

                    [created] => DateTime Object
                        (
                            [date] => 2020-04-24 17:49:08.277606
                            [timezone_type] => 1
                            [timezone] => +00:00
                        )

                    [updated] => DateTime Object
                        (
                            [date] => 2020-04-24 17:49:09.090932
                            [timezone_type] => 1
                            [timezone] => +00:00
                        )

                )

        )

    [workspaceId] => 1231231231231231
)
  

Java

Event({
    "id": "4537025176797184",
    "created": "2020-04-24T17:49:10+00:00",
    "isDelivered": true,
    "subscription": "transfer",
    "log": {
        "id": "5662318377566208",
        "created": "2020-04-24T17:49:13+00:00",
        "type": "registered",
        "errors": [],
        "transfer": {
            "id": "5429309233692672",
            "accountNumber": "76543-8",
            "amount": 100000000,
            "bankCode": "665",
            "branchCode": "2201",
            "created": "2020-04-24T17:49:13+00:00"
            "fee": 200,
            "name": "Daenerys Targaryen Stormborn",
            "status": "processing",
            "tags": ["daenerys", "invoice/1234"],
            "taxId": "594.739.480-42",
            "transactionIds": ["5991715760504832"],
            "updated": "2020-04-24T17:49:13+00:00"
        }
    },
    "workspaceId": 1231231231231231
})
  

Ruby

event(
    id: 4537025176797184,
    created: 2020-04-24T17:49:10+00:00,
    is_delivered: true,
    subscription: transfer,
    log: log(
        id: 5662318377566208,
        created: 2020-04-24T17:49:09+00:00,
        type: sending,
        errors: [],
        transfer: transfer(
            id: 5950134772826112,
            account_number: 76543-8,
            amount: 100000000,
            bank_code: 665,
            branch_code: 2201,
            created: 2020-04-24T17:49:09+00:00
            fee: 200,
            name: Daenerys Targaryen Stormborn,
            status: processing,
            tags: ["daenerys", "invoice/1234"],
            tax_id: 594.739.480-42,
            transaction_ids: ["5991715760504832"],
            updated: 2020-04-24T17:49:09+00:00
        )
    ),
    workspace_id: 1231231231231231
)
  

Elixir

%StarkBank.Event{
    id: "4537025176797184",
    is_delivered: true,
    subscription: "transfer",
    created: ~U[2020-04-24 17:49:09.594656Z],
    log: %StarkBank.Transfer.Log{
        id: "5662318377566208",
        created: ~U[2020-04-24 17:49:09.049096Z],
        errors: [],
        type: "sending",
        payment: %StarkBank.Transfer{
            id: "5950134772826112",
            account_number: 76543-8,
            amount: 11631,
            bank_code: "665",
            branch_code: "2201",
            created: ~U[2020-04-24 17:49:09.713657Z],
            fee: 200,
            name: "Daenerys Targaryen Stormborn",
            status: "processing",
            tags: ["daenerys", "invoice/1234"],
            tax_id: "594.739.480-42"
            transaction_ids: ["5991715760504832"],
            updated: ~U[2020-04-24 17:49:09.713657Z]
        }
    },
    workspace_id: "1231231231231231"
}
  

C#

Event(
    ID: 4537025176797184,
    IsDelivered: true,
    Subscription: transfer,
    Created: 04/24/2020 17:49:09,
    Log: Log(
        ID: 5662318377566208,
        Created: 04/24/2020 17:49:09,
        Type: sending,
        Errors: {  },
        Transfer: Transfer(
            ID: 5950134772826112
            AccountNumber: 76543-8,
            Amount: 100000000,
            BankCode: 665,
            BranchCode: 2201,
            Created: 04/24/2020 17:49:09,
            Fee: 200,
            Name: Daenerys Targaryen Stormborn,
            Status: processing,
            Tags: { daenerys, invoice/1234 },
            TaxID: 594.739.480-42,
            TransactionIds: { 5991715760504832 },
            Updated: 04/24/2020 17:49:09
        )
    ),
    WorkspaceId: 1231231231231231
)
  

Go

{
    Id:4537025176797184
    Log:{
        Id:5662318377566208
        Transfer:{
            Id:5950134772826112
            AccountNumber:76543-8
            Amount:1000000
            BankCode:665
            BranchCode:2201
            Created:2020-04-24 17:49:10.38386 +0000 +0000
            Fine:200
            Name:Daenerys Targaryen Stormborn
            Status:processing
            Tags:[daenerys invoice/1234]
            TaxId:594.739.480-42
            TransactionIds:[5991715760504832]
            Created:2020-04-24 17:49:09.38386 +0000 +0000
        }
        Errors:[]
        Type:sending
        Created:2020-04-24 17:49:09.126413 +0000 +0000
    }
    Created:2020-04-24 17:49:09.464471 +0000 +0000
    IsDelivered:true
    Subscription:transfer
    WorkspaceId:1231231231231231
}
  

Clojure

{:id "4537025176797184",
 :created "2020-04-24T17:49:09.359338+00:00",
 :is-delivered true,
 :subscription "transfer",
 :log
 {:id "5662318377566208",
  :created "2020-04-24T17:49:09.703951+00:00",
  :errors [],
  :type "sending",
  :transfer
  {:id "5950134772826112",
   :account-number 76543-8,
   :amount 100000000,
   :bank-code "665",
   :branch-code "2201",
   :created "2020-04-24T17:49:09.128124+00:00",
   :fee 200,
   :name "Daenerys Targaryen Stormborn",
   :status "processing",
   :tags ["daenerys" "invoice/1234"],
   :transaction-ids ["5991715760504832"],
   :updated "2020-04-24T17:49:09.128124+00:00"}}
 :workspace-id "1231231231231231"}
  

Curl

{
    "message": "Event successfully patched",
    "event": {
        "id": "4537025176797184",
        "isDelivered": true,
        "subscription": "transfer",
        "created": "2020-04-24T17:49:00.201602+00:00",
        "log": {
            "id": "5662318377566208",
            "errors": [],
            "type": "sending",
            "created": "2020-04-24T17:49:09.751122+00:00",
            "transfer": {
                "id": "5950134772826112",
                "accountNumber": "76543-8",
                "amount": 100000000,
                "bankCode": "665",
                "branchCode": "2201",
                "created": "2020-04-24T17:49:09.130246+00:00",
                "fee": 200,
                "name": "Daenerys Targaryen Stormborn",
                "status": "processing",
                "taxId": "594.739.480-42",
                "tags": ["daenerys", "invoice/1234"],
                "transactionIds": ["5991715760504832"],
                "updated": "2020-04-24T17:49:02.130255+00:00",
            }
        },
        "workspaceId": "1231231231231231
    }
}

Event Attempt

When an Event delivery fails, an event attempt will be registered. It carries information meant to help you debug event reception issues.

The Event Attempt object

Attributes

id STRING

Unique id for the event attempt.

code STRING

Delivery error code.

created STRING

Creation datetime. Example: "2020-04-23T23:00:00.000000+00:00".

eventId STRING

ID of the associated Event.

message STRING

Delivery error description.

webhookId STRING

ID of the associated Webhook.

List failed Webhook Event delivery attempts

Get information on failed webhook event delivery attempts.

Parameters

after OPTIONAL

Filter entities created after this date.

before OPTIONAL

Filter entities created before this date.

cursor OPTIONAL

String used to get the next batch of results. Our SDKs handle this for you.

eventIds OPTIONAL

List of Event ids to filter attempts. Example: ["5656565656565656", "4545454545454545"]

fields OPTIONAL

List of strings to filter response JSON keys. Not available in the SDKs.

limit OPTIONAL

Number of results per cursor. Max = 100.

webhookIds OPTIONAL

list of Webhook ids to filter attempts. Example: ["5656565656565656", "4545454545454545"]

ENDPOINT
GET /v2/event/attempt
REQUEST

Python

import starkbank

attempts = starkbank.event.attempt.query(after="2020-01-30")

for attempt in attempts:
    print(attempt)
  

Javascript

const starkbank = require('starkbank');

(async() => {
    let attempts = await starkbank.event.attempt.query(after="2020-01-30");

    for await (let attempt of attempts) {
        console.log(attempt);
    }
})();
  

PHP

use StarkBank\Event\Attempt;

$attempts = Attempt::query(["after" => "2020-01-30"]);

foreach($attempts as $attempt){
    print_r($attempt);
}
  

Java

import com.starkbank.*;
import java.util.HashMap;

HashMap<String, Object> params = new HashMap<>();
params.put("after", "2020-01-30");
Generator<Event.Attempt> attempts = Event.Attempt.query(params);

for (Event.Attempt attempt: attempts) {
    System.out.println(attempt);
}
  

Ruby

require('starkbank')

event attempts = StarkBank::Event Attempt.query(
    after: '2020-01-30'
)

event attempts.each do |event attempt|
    puts event attempt
end
  

Elixir

for attempt <- StarkBank.Event.Attempt.query!(after: "2020-01-30") do
  attempt |> IO.inspect
end
  

C#

using System;

List<StarkBank.Event.Attempt> attempts = StarkBank.Event.Attempt.Query(after: "2020-01-30").ToList();

foreach(StarkBank.Event.Attempt attempt in attempts) {
    Console.WriteLine(attempt);
}
  

Go

package main

import (
    "fmt"
    "time"
    "github.com/starkbank/sdk-go/starkbank/event/attempt"
)

func main() {

    var params = map[string]interface{}{}
    params["after"] = time.Date(2020, 1, 30, 0, 0, 0, 0, time.UTC)

    attempts, errorChannel := attempt.Query(params, nil)

    loop:
    for {
        select {
        case err := <-errorChannel:
            if err.Errors != nil {
                for _, e := range err.Errors {
                    fmt.Printf("code: %s, message: %s", e.Code, e.Message)
                }
            }
        case attempt, ok := <-attempts:
            if !ok {
                break loop
            }
            fmt.Printf("%+v", attempt)
        }
    }
}
  

Clojure

(def attempts (starkbank.event.attempt/query {:after ["2020-01-30"]}))

(printn attempts)
  

Curl

curl --location --request GET '{{baseUrl}}/v2/event/attempt?after=2020-01-30' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}'
  
RESPONSE

Python

Attempt(
    id=4737439230853120,
    code=invalidHttpStatus,
    message=HTTP POST request returned status 404,
    webhook_id=5187231165710336
    event_id=6488144706797568,
    created=2020-01-30 12:35:59.322499,
)
  

Javascript

Attempt {
    id: '4737439230853120',
    code: 'invalidHttpStatus',
    message: 'HTTP POST request returned status 404',
    webhookId: '5187231165710336',
    eventId: '6488144706797568',
    created: '2020-01-30T12:35:59.482776+00:00'
}
  

PHP

StarkBank\Event\Attempt Object
(
    [id] => 4737439230853120
    [code] => invalidHttpStatus
    [message] => HTTP POST request returned status 404
    [webhookId] => 5187231165710336
    [eventId] => 6488144706797568
    [created] => DateTime Object
        (
            [date] => 2020-01-30 12:35:56.363127
            [timezone_type] => 1
            [timezone] => +00:00
        )

)
  

Java

Attempt({
    "id": "4737439230853120"
    "code": "invalidHttpStatus",
    "message": "HTTP POST request returned status 404",
    "webhookId": "5187231165710336",
    "eventId": "6488144706797568",
    "created": "2020-01-30T16:26:05.589545+00:00",
})
  

Ruby

attempt(
    id: 4737439230853120,
    code: invalidHttpStatus,
    message: HTTP POST request returned status 404,
    event_id: 6488144706797568,
    webhook_id: 5187231165710336,
    created: 2020-01-30T12:00:48+00:00
)
  

Elixir

%StarkBank.Event.Attempt{
    id: "4737439230853120",
    code: "invalidHttpStatus",
    message: "HTTP POST request returned status 404",
    webhook_id: "5187231165710336",
    event_id: "6488144706797568",
    created: ~U[2020-01-30 16:26:05.589545Z]
}
  

C#

Attempt(
    Code: invalidHttpStatus,
    Message: HTTP POST request returned status 404,
    EventId: 6488144706797568,
    WebhookId: 5187231165710336,
    Created: 30/01/2020 16:26:05,
    ID: 4737439230853120
)
  

Go

{
    Id:4737439230853120
    Code:invalidHttpStatus
    Message:HTTP POST request returned status 404
    EventId:6488144706797568
    WebhookId:5187231165710336
    Created:2020-01-30 22:20:08.047237 +0000 +0000
}
  

Clojure

{
    :code invalidHttpStatus,
    :message HTTP POST request returned status 404,
    :eventId 6488144706797568,
    :webhookId 5187231165710336,
    :created 2020-01-30T16:26:05.589545+00:00,
    :id 4737439230853120
}
  

Curl

{
    "attempts": [
        {
            "code": "invalidHttpStatus",
            "created": "2020-01-30T16:26:05.589545+00:00",
            "eventId": "6488144706797568",
            "id": "4737439230853120",
            "message": "HTTP POST request returned status 404",
            "webhookId": "5187231165710336"
        }
    ],
    "cursor": "CkgKFAoHY3JlYXRlZBIJCJmQ-5LC7_wCEixqFGl-YXBpLW1zLXdlYmhvb2stc2J4chQLEgdBdHRlbXB0GICAgLTx4oIJDBgAIAE="
}
  

Get an Event Attempt

Get a single event attempt by its id.

Parameters

id REQUIRED

Unique id of the event attempt entity.

fields OPTIONAL

List of strings to filter response JSON keys. Not available in the SDKs.

ENDPOINT
GET /v2/event/attempt/:id
REQUEST

Python

import starkbank

attempt = starkbank.event.attempt.get("4737439230853120")

print(attempt)
  

Javascript

const starkbank = require('starkbank');

(async() => {
    let attempt = await starkbank.event.attempt.get("4737439230853120")
    console.log(attempt);
})();
  

PHP

use StarkBank\Event\Attempt;

$attempt = Attempt::get("4737439230853120");

print_r($attempt);
  

Java

import com.starkbank.*;

Event.Attempt attempt = Event.Attempt.get("4737439230853120");

System.out.println(attempt);
  

Ruby

require('starkbank')

attempt = StarkBank::Event::Attempt.get('4737439230853120')

puts attempt
  

Elixir

StarkBank.Event.Attempt.get("4737439230853120") |> IO.inspect
  

C#

using System;

StarkBank.Event.Attempt attempt = Starkbank.Event.Attempt.Get("4737439230853120");

Console.WriteLine(attempt);
  

Go

package main

import (
    "fmt"
    "github.com/starkbank/sdk-go/starkbank/event/attempt"
)

func main() {

    attempt, err := attempt.Get("4737439230853120", nil)
    if err.Errors != nil {
        for _, e := range err.Errors {
            fmt.Printf("code: %s, message: %s", e.Code, e.Message)
        }
    }

    fmt.Printf("%+v", attempt)
}
  

Clojure

(def attempt (starkbank.event.attempt/get "4737439230853120"))

(print attempt)
  

Curl

curl --location --request GET '{{baseUrl}}/v2/event/attempt/4737439230853120' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}'
  
RESPONSE

Python

Attempt(
    id=4737439230853120,
    code=invalidHttpStatus,
    message=HTTP POST request returned status 404,
    webhook_id=5187231165710336
    event_id=6488144706797568,
    created=2020-01-30 12:35:59.322499,
)
  

Javascript

Attempt {
    id: '4737439230853120',
    code: 'invalidHttpStatus',
    message: 'HTTP POST request returned status 404',
    webhookId: '5187231165710336',
    eventId: '6488144706797568',
    created: '2020-01-30T12:35:59.482776+00:00'
}
  

PHP

StarkBank\Event\Attempt Object
(
    [id] => 4737439230853120
    [code] => invalidHttpStatus
    [message] => HTTP POST request returned status 404
    [webhookId] => 5187231165710336
    [eventId] => 6488144706797568
    [created] => DateTime Object
        (
            [date] => 2020-01-30 12:35:56.363127
            [timezone_type] => 1
            [timezone] => +00:00
        )

)
  

Java

Attempt({
    "id": "4737439230853120"
    "code": "invalidHttpStatus",
    "message": "HTTP POST request returned status 404",
    "webhookId": "5187231165710336",
    "eventId": "6488144706797568",
    "created": "2020-01-30T16:26:05.589545+00:00",
})
  

Ruby

attempt(
    id: 4737439230853120,
    code: invalidHttpStatus,
    message: HTTP POST request returned status 404,
    event_id: 6488144706797568,
    webhook_id: 5187231165710336,
    created: 2020-01-30T12:00:48+00:00
)
  

Elixir

%StarkBank.Event.Attempt{
    id: "4737439230853120",
    code: "invalidHttpStatus",
    message: "HTTP POST request returned status 404",
    webhook_id: "5187231165710336",
    event_id: "6488144706797568",
    created: ~U[2020-01-30 16:26:05.589545Z]
}
  

C#

Attempt(
    Code: invalidHttpStatus,
    Message: HTTP POST request returned status 404,
    EventId: 6488144706797568,
    WebhookId: 5187231165710336,
    Created: 30/01/2020 16:26:05,
    ID: 4737439230853120
)
  

Go

{
    Id:4737439230853120
    Code:invalidHttpStatus
    Message:HTTP POST request returned status 404
    EventId:6488144706797568
    WebhookId:5187231165710336
    Created:2020-01-30 22:20:08.047237 +0000 +0000
}
  

Clojure

{
    :code invalidHttpStatus,
    :message HTTP POST request returned status 404,
    :eventId 6488144706797568,
    :webhookId 5187231165710336,
    :created 2020-01-30T16:26:05.589545+00:00,
    :id 4737439230853120
}
  

Curl

{
    "attempt": {
        "code": "invalidHttpStatus",
        "created": "2020-01-30T16:26:05.589545+00:00",
        "eventId": "6488144706797568",
        "id": "4737439230853120",
        "message": "HTTP POST request returned status 404",
        "webhookId": "5187231165710336"
    }
}
  

Pix Key

The Pix keys are saved in the DICT (Diretório de Identificadores de Contas Transacionais), the centralized Pix service managed by Bacen (Brazilian Central Bank) that allows you to search for transactional accounts with convenient addressing keys.

The types of keys currently available are CPF, CNPJ, phone number, e-mail and EVP (random UUID). In this section, we will teach you how to manage DICT keys.

Note: Whenever a Workspace is created, an EVP (random) DICT key is created and associated with it. This is done in order to ensure the safety of the Invoice service, since it requires an active DICT Key to work.

The Pix Key object

Attributes

id STRING

Unique id for the Pix key (CPF, CNPJ, phone, email or EVP).

accountNumber STRING

Account number.

accountType STRING

Account type. Options: "checking", "savings", "salary", "payment".

bankName STRING

Bank name.

branchCode STRING

Account branch code.

ispb STRING

Bank ISPB code.

name STRING

Account owner full name.

ownerType STRING

Account owner type. Options: "business", "personal".

status STRING

Current key status.

taxId STRING

Account owner CPF or CNPJ.

type STRING

Key type. Options: "cpf", "cnpj", "phone", "email", "evp".

List your DICT Keys

Get a list of the DICT Keys you own (or have owned) in chunks of at most 100. If you need smaller chunks, use the limit parameter.

Parameters

after OPTIONAL

Filter entities created after this date.

before OPTIONAL

Filter entities created before this date.

cursor OPTIONAL

String used to get the next batch of results. Our SDKs handle this for you.

fields OPTIONAL

List of strings to filter response JSON keys. Not available in the SDKs.

ids OPTIONAL

List of strings to get specific entities by ids.

limit OPTIONAL

Number of results per cursor. Max = 100.

status OPTIONAL

Filter dicts by the specified status.

type OPTIONAL

DICT Key type. Options are: "cpf", "cnpj", "phone", "email" or "evp".

ENDPOINT
GET /v2/dict-key
REQUEST

Python

import starkbank

dict_keys = starkbank.dictkey.query(
    status="registered",
    limit= 1,
    type= "evp"
)

for dict_key in dict_keys:
    print(dict_key)
  

Javascript

const starkbank = require('starkbank');

(async() => {
    let dictKeys = await starkbank.dictKey.query({
        limit: 1,
        type: 'evp',
        status: 'registered',
    });

    for await (let dictKey of dictKeys) {
        console.log(dictKey);
    }
})();
  

PHP

use StarkBank\DictKey;

$dictKeys = iterator_to_array(
    DictKey::query([
    "limit" => 1,
    "type" => "evp",
    "status" => "registered"
    ])
);

foreach($dictKeys as $dictKey) {
    print_r($dictKey);
}
  

Java

import com.starkbank.*;
import com.starkbank.utils.Generator;
import java.util.HashMap;

HashMap<String, Object> params = new HashMap<>();
params.put("status", "registered");
params.put("limit", 1);
params.put("type", "evp");

Generator<DictKey> dictKeys = DictKey.query(params);
for (DictKey dictKey : dictKeys) {
    System.out.println(dictKey);
}
  

Ruby

require('starkbank')

dict_keys = StarkBank::DictKey.query(
  status: 'registered',
  type: 'evp',
  limit: 1
)

dict_keys.each do |dict_key|
  puts dict_key
end
  

Elixir

dict_key = StarkBank.DictKey.query!(
    limit: 1,
    status: "registered",
    type: "evp"
) |> Enum.take(1) |> IO.inspect
  

C#

using System;
using System.Collections.Generic;

IEnumerable<StarkBank.DictKey> dictKeys = StarkBank.DictKey.Query(
    status: "registered",
    type: "evp",
    limit: 1
);

foreach(StarkBank.DictKey dictKey in dictKeys) {
    Console.WriteLine(dictKey);
}
  

Go

package main

import (
    "fmt"
    "github.com/starkbank/sdk-go/starkbank/dictkey"
)

func main() {

    var params = map[string]interface{}{}
    params["status"] = "registered"
    params["limit"] = 1
    params["type"] = "evp"

    keys, errorChannel := dictkey.Query(params, nil)

    loop:
    for {
        select {
        case err := <-errorChannel:
            if err.Errors != nil {
                for _, e := range err.Errors {
                    fmt.Printf("code: %s, message: %s", e.Code, e.Message)
                }
            }
        case key, ok := <-keys:
            if !ok {
                break loop
            }
            fmt.Printf("%+v", key)
        }
    }
}
  

Clojure

(def dict-keys (starkbank.dict-key/query {:limit 1, :status ["registered"] :type "evp"}))

(doseq [dict-key dict-keys]
    (println dict-key))
  

Curl

curl --location --request GET '{{baseUrl}}/v2/dict-key?limit=1&status=registered&type=evp' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}'
  
RESPONSE

Python

DictKey(
    account_number=*ZW5jcnlwdGVkLWFjY291bnQtbnVtYmVy,
    account_type=checking,
    branch_code=*ZW5jcnlwdGVkLWJyYW5jaC1jb2Rl,
    id=1aa1aaaa-a11a-1111-a111-1a1aa111aaaa,
    ispb=67372284,
    name=Jon Snow,
    owner_type=naturalPerson,
    status=registered,
    tax_id=***.456.789-**,
    type=evp
)
  

Javascript

DictKey {
    id: '1aa1aaaa-a11a-1111-a111-1a1aa111aaaa',
    type: 'evp',
    accountType: 'checking',
    name: 'Jon Snow',
    taxId: '***.456.789-**',
    ownerType: 'naturalPerson',
    ispb: '67372284',
    branchCode: '*ZW5jcnlwdGVkLWJyYW5jaC1jb2Rl',
    accountNumber: '*ZW5jcnlwdGVkLWFjY291bnQtbnVtYmVy',
    status: 'registered'
}
  

PHP

StarkBank\DictKey Object
(
    [id] => 1aa1aaaa-a11a-1111-a111-1a1aa111aaaa
    [type] => evp
    [accountType] => checking
    [name] => Jon Snow
    [taxId] => ***.456.789-**
    [ownerType] => naturalPerson
    [ispb] => 67372284
    [branchCode] => *ZW5jcnlwdGVkLWJyYW5jaC1jb2Rl
    [accountNumber] => *ZW5jcnlwdGVkLWFjY291bnQtbnVtYmVy
    [status] => registered
)
  

Java

DictKey({
    "type": "evp",
    "accountType": "checking",
    "name": "Jon Snow",
    "taxId": "***.456.789-**",
    "ownerType": "naturalPerson",
    "ispb": "67372284",
    "branchCode": "*ZW5jcnlwdGVkLWJyYW5jaC1jb2Rl",
    "accountNumber": "*ZW5jcnlwdGVkLWFjY291bnQtbnVtYmVy",
    "status": "registered",
    "id": "1aa1aaaa-a11a-1111-a111-1a1aa111aaaa"
})
  

Ruby

dictkey(
    id: 1aa1aaaa-a11a-1111-a111-1a1aa111aaaa,
    type: evp,
    account_type: checking,
    name: Jon Snow,
    tax_id: ***.456.789-**,
    owner_type: naturalPerson,
    ispb: 67372284,
    branch_code: *ZW5jcnlwdGVkLWJyYW5jaC1jb2Rl,
    account_number: *ZW5jcnlwdGVkLWFjY291bnQtbnVtYmVy,
    status: registered
)
  

Elixir

%StarkBank.DictKey{
    accountNumber: "*ZW5jcnlwdGVkLWFjY291bnQtbnVtYmVy",
    accountType: "checking",
    branchCode: "*ZW5jcnlwdGVkLWJyYW5jaC1jb2Rl",
    id: "1aa1aaaa-a11a-1111-a111-1a1aa111aaaa",
    ispb: "67372284",
    name: "Jon Snow",
    ownerType: "naturalPerson",
    status: "registered",
    taxId: "***.456.789-**",
    type: "evp"
}
  

C#

DictKey(
    Type: evp,
    AccountType: cheking,
    Name: Jon Snow,
    TaxId: ***.456.789-**,
    OwnerType: naturalPerson,
    Ispb: 67372284,
    BranchCode: *ZW5jcnlwdGVkLWJyYW5jaC1jb2Rl,
    AccountNumber: *ZW5jcnlwdGVkLWFjY291bnQtbnVtYmVy,
    Status: registered,
    ID: 1aa1aaaa-a11a-1111-a111-1a1aa111aaaa
)
  

Go

{
    Id:1aa1aaaa-a11a-1111-a111-1a1aa111aaaa
    Type:evp
    Name:Jon Snow
    TaxId:***.456.789-**
    OwnerType:naturalPerson
    Ispb:67372284
    BranchCode:*ZW5jcnlwdGVkLWJyYW5jaC1jb2Rl
    AccountNumber:*ZW5jcnlwdGVkLWFjY291bnQtbnVtYmVy
    AccountType:checking
    Status:registered
}
  

Clojure

{
    :branch-code *ZW5jcnlwdGVkLWJyYW5jaC1jb2Rl,
    :owner-type naturalPerson,
    :name Jon Snow,
    :tax-id ***.456.789-**,
    :type evp,
    :status registered,
    :account-type checking,
    :id 1aa1aaaa-a11a-1111-a111-1a1aa111aaaa,
    :ispb 67372284,
    :account-number *ZW5jcnlwdGVkLWFjY291bnQtbnVtYmVy
}
  

Curl

{
    "key": {
        "status": "registered",
        "accountNumber": "*ZW5jcnlwdGVkLWFjY291bnQtbnVtYmVy",
        "ownerType": "naturalPerson",
        "taxId": "***.456.789-***",
        "accountType": "checking",
        "branchCode": "*ZW5jcnlwdGVkLWJyYW5jaC1jb2Rl",
        "ispb": "67372284",
        "name": "Jon Snow",
        "id": "1aa1aaaa-a11a-1111-a111-1a1aa111aaaa",
        "type": "evp"
    }
}
  

Get a DICT Key

Get a single DICT key by its id. This method includes keys you do not own. You can use it to retrieve a key's information before creating Transfers.

Note: Try to avoid looking up DICT keys without sending transfers afterwards, since Bacen's system will block users making too many standalone requests in a short timespan. Invalid key searches also count towards this block.

Note: The encrypted parameters can be used to create a transfer without the need to decrypt.

Parameters

id REQUIRED

Id of the dict key. Examples: "jon.snow@starkbank.com", "012.345.678-90"

ENDPOINT
GET /v2/dict-key/:id
REQUEST

Python

import starkbank

dictkey = starkbank.dictkey.get("jon.snow@starkbank.com")

print(dictkey)
  

Javascript

const starkbank = require('starkbank');

(async() => {
    let dictKey = await starkbank.dictKey.get('jon.snow@starkbank.com');
    console.log(dictKey);
})();
  

PHP

$dictKey = DictKey::get('jon.snow@starkbank.com');

print_r($dictKey);
  

Java

import com.starkbank.*;

DictKey dictKey = DictKey.get("jon.snow@starkbank.com");

System.out.println(dictKey);
  

Ruby

require('starkbank')

dict_key = StarkBank::DictKey.get('jon.snow@starkbank.com')

puts dict_key
  

Elixir

dict_key = StarkBank.DictKey.get!("jon.snow@starkbank.com")
dict_key |> IO.inspect
  

C#

using System;

StarkBank.DictKey dictKey = StarkBank.DictKey.Get("jon.snow@starkbank.com");

Console.WriteLine(dictKey);
  

Go

package main

import (
    "fmt"
    "github.com/starkbank/sdk-go/starkbank/dictkey"
)

func main() {

    key, err := dictkey.Get("jon.snow@starkbank.com", nil)
    if err.Errors != nil {
        for _, e := range err.Errors {
            fmt.Printf("code: %s, message: %s", e.Code, e.Message)
        }
    }

    fmt.Printf("%+v", key)
}
  

Clojure

(def dict-key (starkbank.dict-key/get "tony@starkbank.com"))

(println dict-key)
  

Curl

curl --location --request GET '{{baseUrl}}/v2/dict-key/jon.snow@starkbank.com' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}'
  
RESPONSE

Python

DictKey(
    account_number=*ZW5jcnlwdGVkLWFjY291bnQtbnVtYmVy,
    account_type=checking,
    branch_code=*ZW5jcnlwdGVkLWJyYW5jaC1jb2Rl,
    id=jon.snow@starkbank.com,
    ispb=67372284,
    name=Jon Snow,
    owner_type=naturalPerson,
    status=registered,
    tax_id=***.456.789-**,
    type=email
)
  

Javascript

DictKey {
    id: 'jon.snow@starkbank.com',
    type: 'email',
    accountType: 'checking',
    name: 'Jon Snow',
    taxId: '***.456.789-**',
    ownerType: 'naturalPerson',
    ispb: '67372284',
    branchCode: '*ZW5jcnlwdGVkLWJyYW5jaC1jb2Rl',
    accountNumber: '*ZW5jcnlwdGVkLWFjY291bnQtbnVtYmVy',
    status: 'registered'
}
  

PHP

StarkBank\DictKey Object
(
    [id] => jon.snow@starkbank.com
    [type] => email
    [accountType] => checking
    [name] => Jon Snow
    [taxId] => ***.456.789-**
    [ownerType] => naturalPerson
    [ispb] => 67372284
    [branchCode] => *ZW5jcnlwdGVkLWJyYW5jaC1jb2Rl
    [accountNumber] => *ZW5jcnlwdGVkLWFjY291bnQtbnVtYmVy
    [status] => registered
)
  

Java

DictKey({
    "type": "email",
    "accountType": "checking",
    "name": "Jon Snow",
    "taxId": "***.456.789-**",
    "ownerType": "naturalPerson",
    "ispb": "67372284",
    "branchCode": "*ZW5jcnlwdGVkLWJyYW5jaC1jb2Rl",
    "accountNumber": "*ZW5jcnlwdGVkLWFjY291bnQtbnVtYmVy",
    "status": "registered",
    "id": "jon.snow@starkbank.com"
})
  

Ruby

dictkey(
    id: jon.snow@starkbank.com,
    type: email,
    account_type: checking,
    name: Jon Snow,
    tax_id: ***.456.789-**,
    owner_type: naturalPerson,
    ispb: 67372284,
    branch_code: *ZW5jcnlwdGVkLWJyYW5jaC1jb2Rl,
    account_number: *ZW5jcnlwdGVkLWFjY291bnQtbnVtYmVy,
    status: registered
)
  

Elixir

%StarkBank.DictKey{
    accountNumber: "*ZW5jcnlwdGVkLWFjY291bnQtbnVtYmVy",
    accountType: "checking",
    branchCode: "*ZW5jcnlwdGVkLWJyYW5jaC1jb2Rl",
    id: "jon.snow@starkbank.com",
    ispb: "67372284",
    name: "Jon Snow",
    ownerType: "naturalPerson",
    status: "registered",
    taxId: "***.456.789-**",
    type: "email"
}
  

C#

DictKey(
    Type: email,
    AccountType: checking,
    Name: Jon Snow,
    TaxId: ***.456.789-**,
    OwnerType: naturalPerson,
    Ispb: 67372284,
    BranchCode: *ZW5jcnlwdGVkLWJyYW5jaC1jb2Rl,
    AccountNumber: *ZW5jcnlwdGVkLWFjY291bnQtbnVtYmVy,
    Status: registered,
    ID: jon.snow@starkbank.com
)
  

Go

{
    Id:jon.snow@starkbank.com
    Type:email
    Name:Jon Snow
    TaxId:***.456.789-**
    OwnerType:naturalPerson
    Ispb:67372284
    BranchCode:*ZW5jcnlwdGVkLWJyYW5jaC1jb2Rl
    AccountNumber:*ZW5jcnlwdGVkLWFjY291bnQtbnVtYmVy
    AccountType:checking
    Status:registered
}
  

Clojure

{
    :branch-code *ZW5jcnlwdGVkLWJyYW5jaC1jb2Rl,
    :owner-type naturalPerson,
    :name Jon Snow,
    :tax-id ***.201.821-**,
    :type email,
    :status registered,
    :account-type checking,
    :id jon.snow@starkbank.com,
    :ispb 67372284,
    :account-number *ZW5jcnlwdGVkLWFjY291bnQtbnVtYmVy
}
  

Curl

{
    "key": {
        "status": "registered",
        "accountNumber": "*ZW5jcnlwdGVkLWFjY291bnQtbnVtYmVy",
        "ownerType": "naturalPerson",
        "taxId": "***.456.789-**",
        "accountType": "checking",
        "branchCode": "*ZW5jcnlwdGVkLWJyYW5jaC1jb2Rl",
        "ispb": "67372284",
        "name": "Jon Snow",
        "id": "jon.snow@starkbank.com",
        "type": "email"
    }
}
  

Institutions

An Institution is used to query institutions registered by the Brazilian Central Bank for Pix and Ted transactions.

The Institution object

Attributes

displayName STRING

Short version of the institution name for display.

name STRING

Full version of the institution name.

spiCode STRING

SPI code used to identify the institution on Pix transactions.

strCode STRING

STR code used to identify the institution on Ted transactions.

List Institutions

Get a list of institutions.

Parameters

limit OPTIONAL

Number of results per cursor. Max = 100.

search OPTIONAL

Part of the institution name to be searched. Example: "stark"

spiCodes OPTIONAL

List of SPI (Pix) codes to be searched. Example: ["20018183"]

strCodes OPTIONAL

List of STR (Ted) codes to be searched. Example: ["260"]

ENDPOINT
GET /v2/institution
REQUEST

Python

import starkbank

institutions = starkbank.institution.query(search="stark")

for institution in institutions:
    print(institution)
  

Javascript

const starkbank = require('starkbank');

(async() => {
    let institutions = await starkbank.institution.query({ search: 'stark' });
    for (let institution of institutions) {
        console.log(institution);
    }
})();
  

PHP

use StarkBank\Institution;

$institutions = Institution::query(["search" => "stark"]);

foreach($institutions as $institution){
    print_r($institution);
}
  

Java

import com.starkbank.*;
import java.util.HashMap;

HashMap<String, Object> params = new HashMap<>();
params.put("search", "stark");

List<Institution> institutions = Institution.query(params);

for (Institution institution : institutions) {
    System.out.println(institution);
}
  

Ruby

require('starkbank')

institutions = StarkBank::Institution.query(search: 'stark').to_a

institutions.each do |institution|
    puts institution
end
  

Elixir

institutions = StarkBank.Institution.query(search: "stark") |> IO.inspect
  

C#

using System;
using System.Collections.Generic;

List<StarkBank.Institution> institutions = StarkBank.Institution.Query(search: "stark");

foreach(StarkBank.Institution.Log institution in institutions) {
    Console.WriteLine(institution);
}
  

Go

package main

import (
    "fmt"
    "github.com/starkbank/sdk-go/starkbank/institution"
)

func main() {

    var params = map[string]interface{}{}
    params["search"] = "stark"

    institutions, errorChannel := institution.Query(params, nil)

    loop:
    for {
        select {
        case err := <-errorChannel:
            if err.Errors != nil {
                for _, e := range err.Errors {
                    fmt.Printf("code: %s, message: %s", e.Code, e.Message)
                }
            }
        case institution, ok := <-institutions:
            if !ok {
                break loop
            }
            fmt.Printf("%+v", institution)
        }
    }
}
  

Clojure

(def institutions (institution/query {:search "stark"}))
(println institutions)
  

Curl

curl --location --request GET '{{baseUrl}}/v2/institution?search=stark' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}'
  
RESPONSE

Python

Institution(
    display_name=Stark Bank,
    name=Stark Bank S.A.,
    spi_code=20018183,
    str_code=
)
  

Javascript

Institution {
    displayName: 'Stark Bank',
    name: 'Stark Bank S.A.',
    spiCode: '20018183',
    strCode: ''
}
  

PHP

StarkBank\Institution Object
(
    [displayName] => Stark Bank
    [name] => Stark Bank S.A.
    [spiCode] => 20018183
    [strCode] =>
)
  

Java

Institution({
    "displayName": "Stark Bank",
    "name": "Stark Bank S.A.",
    "spiCode": "20018183",
    "strCode": ""
})
  

Ruby

institution(
    display_name: Stark Bank,
    name: Stark Bank S.A.,
    spi_code: 20018183,
    str_code:
)
  

Elixir

%StarkBank.Institution{
    display_name: "Stark Bank",
    name: "Stark Bank S.A.",
    spi_code: "20018183",
    str_code: ""
}
  

C#

Institution(
    DisplayName: Stark Bank,
    Name: Stark Bank S.A.,
    SpiCode: 20018183,
    StrCode:
)
  

Go

{
    DisplayName:Stark Bank
    Name:Stark Bank S.A.
    SpiCode:20018183
    StrCode:
}
  

Clojure

{:display-name "Stark Bank",
 :name "Stark Bank S.A.",
 :spi-code "20018183",
 :str-code ""
}
  

Curl

{
    "cursor": null,
    "institutions": [
        {
            "displayName": "Stark Bank",
            "name": "Stark Bank S.A.",
            "spiCode": "20018183",
            "strCode": ""
        }
    ]
}
  

Public Key

Some of our responses will be signed using our own private key, such as the messages we send by webhook. In order to verify that it was really us that generated the message, you can get our public key and verify the provided signature and content.

The Public Key object

Attributes

content STRING

PEM-encoded public key content.

created STRING

Creation datetime. Example: "2020-04-23T23:00:00.000000+00:00".

List Public Keys

Get a list of the Stark Bank public keys ordered by creation date from newest to oldest. The most recent public key is the one currently in use by the API. The older keys can be used to verify older messages.

ENDPOINT
GET /v2/public-key
REQUEST

Python

import starkbank

public_keys = starkbank.key.get()

for public_key in public_keys:
    print(public_key)
  

Javascript

Not yet available. Please contact us if you need this SDK.
  

PHP

Not yet available. Please contact us if you need this SDK.
  

Java

Not yet available. Please contact us if you need this SDK.
  

Ruby

Not yet available. Please contact us if you need this SDK.
  

Elixir

Not yet available. Please contact us if you need this SDK.
  

C#

Not yet available. Please contact us if you need this SDK.
  

Go

Not yet available. Please contact us if you need this SDK.
  

Clojure

Not yet available. Please contact us if you need this SDK.
  

Curl

curl --location --request GET '{{baseUrl}}/v2/public-key' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}'
  
RESPONSE

Python

PublicKey(
    content=-----BEGIN PUBLIC KEY-----
MFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEQA+bOEY57yQGYdcF0q7Ia/JPc0Hr8Il0
/pbETwvDSM+7yCkqTPDRsdptMMaoK9UEXILOaXq9Ot5azrgQEcTetg==
-----END PUBLIC KEY-----,
    created=2020-03-27 03:31:00.000000
)
  

Javascript

Not yet available. Please contact us if you need this SDK.
  

PHP

Not yet available. Please contact us if you need this SDK.
  

Java

Not yet available. Please contact us if you need this SDK.
  

Ruby

Not yet available. Please contact us if you need this SDK.
  

Elixir

Not yet available. Please contact us if you need this SDK.
  

C#

Not yet available. Please contact us if you need this SDK.
  

Go

Not yet available. Please contact us if you need this SDK.
  

Clojure

Not yet available. Please contact us if you need this SDK.
  

Curl

{
    "cursor": null,
    "publicKeys": [
        {
            "content": "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEQA+bOEY57yQGYdcF0q7Ia/JPc0Hr8Il0\n/pbETwvDSM+7yCkqTPDRsdptMMaoK9UEXILOaXq9Ot5azrgQEcTetg==\n-----END PUBLIC KEY-----",
            "created": "2020-03-27T03:31:00+00:00"
        },
        {
            "content": "-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAE9QNcKNouU2iBpsVRTer9MA/nStS/KV44\nXQdqsO44BpKieHtAWrRRwz+czNZk0UUICGFRpWtgzs+FtvB/W31bfQ==\n-----END PUBLIC KEY-----",
            "created": "2020-01-01T03:04:00+00:00"
        }
    ]
}