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.0 specification? You can download our yaml file right here.

Take a look at our Postman collection:

BASE URL - Production
https://api.starkbank.com
BASE URL - Sandbox
https://sandbox.api.starkbank.com
CLIENT LIBRARIES
pip install starkbank
npm install starkbank
composer require starkbank/sdk
compile "com.starkbank:sdk:{latest-version}"
gem install starkbank
{:starkbank, "~> {latest-version}"}
Install-Package starkbank
go get -u github.com/starkbank/sdk-go
[starkbank/sdk "{latest-version}"]

Tech Support

If you have any questions about our API or SDKs, feel free to email us.We will respond 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 changelogWe 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

Security

We don't use any static strings such as API KEYS and ACCESS TOKENS to connect to our API. Those methods are easy to use, but make it easier for people to steal from your bank account. To make your account as safe as possible, we use the Elliptic Curve Digital Signature Algorithm (ECDSA) Private/Public key pairs (see image to the right) with SECP256k1 curve and SHA256 digest.These are the same algorithms and curve used by Bitcoin, Ethereum, Litecoin and other famous cryptocurrencies to verify transactions and are way more resilient than usual online banking security methods.While it would take about 10.000 to 1.000.000 tries to break any password in your usual banking service (which is pretty easy for a computer), to break our private key you would need about 10⁷⁷ attempts, which means billions of billions of years of processing using the computational capacity of the entire planet.Also, this method allows you to generate your private key locally, exactly where it will be used, avoiding risky internet transmissions of your private key. You also don't have to worry about managing sessions.Our SDKs will handle the ECDSA for you, though, so you can rest easy if you plan on using any of them on your integrations.Feeling adventurous? Check out our Digital Signature libraries.

ECDSA Key Pair
ecdsa-key-pair

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

Authentication

There are two types of user that you might need to create API integrations:- Projects are workspace-specific users, that is, they are bound to the Workspace they are created in and cannot operate outside them. One Workspace can have multiple Projects.- Organizations are master users that are bound to your company's tax ID only. They can control all your Workspaces and even create new ones. Since this user is unique to your entire organization, only one credential can be linked to it, which can only be done by one of its legal representatives.Also, we use ECDSA to authenticate requests. That means you need to generate a secp256k1 private key to sign your requests to our API, and register the corresponding public key with us so we can validate those requests.
Step 1 - Create your private and public keys
To generate a new key pair, follow this tutorial.
Step 2 - Register your credentials
To register your credentials, first log into your Sandbox Web Banking or Production Web Banking:
2.1 - For Projects, follow these steps:2.1.1 - Go to Menu > Integrations2.1.2 - Click on the "New Project" button2.1.3 - Create a Project: Give it a name and upload the public key you created in Step 1.2.1.4 - After creating the Project, get its Project ID2.1.5 - Input the Project ID and corresponding private key you created in Step 1 into our SDKs and you're good to go (see examples to the right).
2.2 - For an Organization, follow these steps:2.2.1 - Go to Menu > Integrations2.2.2 - Click on the "Organization public key" button2.2.3 - Upload the public key you created in Step 1 (only a legal representative of the organization can upload the public key)2.2.4 - Click on your profile picture and then on the "Organization" menu to get the Organization ID2.2.5 - Input the Organization ID and corresponding private key you created in Step 1 into our SDKs and you're good to go (see examples to the right).
NOTE: You must always keep your private key safe and sound. Never share it with anyone, not even with us. Also, you also should never hard-code it. Prefer saving it as an environment variable or in an encrypted database, for example.

Python


import starkbank

# This is only an example of a private key content. You should use your own key.
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');

// This is only an example of a private key content. You should use your own key.
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;

// This is only an example of a private key content. You should use your own key.
$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.*;

// This is only an example of a private key content. You should use your own key.
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')

# This is only an example of a private key content. You should use your own key.
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

# This is only an example of a private key content. You should use your own key.
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#


// This is only an example of a private key content. You should use your own key.
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"
)

// This is only an example of a private key content. You should use your own key.
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))

; This is only an example of a private key content. You should use your own key.
(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
    }
)
            

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

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
200
Everything went right
400
Your input is incorrect. We will send you a json explaining what went wrong.
500
Something went wrong on our side. Our engineering team will be notified and act to fix the problem ASAP.
418
Geek 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
en-US
US English (default)
pt-BR
Brazilian 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.

ENDPOINTS
POST /v2/workspaceGET /v2/workspaceGET /v2/workspace/:idPATCH /v2/workspace/:id

Create a Workspace

Here you can create a brand new Workspace.Note: Only Organization credentials are able to create Workspaces.

Parameters

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"

name REQUIRED

This string will show up to identify your Workspace when you log into it at our Web Banking. Example: 'My 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']

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 {
            panic(fmt.Sprintf("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' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}' 
--header 'Content-Type: application/json' 
--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.

limit OPTIONAL

Number of results per cursor. Max = 100.

username OPTIONAL

Workspace username to be searched.

ids OPTIONAL

List of IDs of the Workspaces to be retrieved.

fields OPTIONAL

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

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 := workspace.Query(nil, nil)

    for workspace := range workspaces {
        fmt.Printf("%+v", workspace)
    }
}
  

Clojure


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

Curl


curl --location --request GET '{{baseUrl}}/v2/workspace' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--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 wokspace 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 {
            panic(fmt.Sprintf("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' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--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.

pictureType CONDITIONALLY REQUIRED

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

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'

username OPTIONAL

Simplified name to define the workspace URL. This name must be unique across all Stark Bank Workspaces. Example: 'starkbank-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']

status OPTIONAL

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

picture OPTIONAL

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

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 {
            panic(fmt.Sprintf("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' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}' 
--header 'Content-Type: application/json' 
--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.

ENDPOINTS
GET /v2/balance

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 := balance.Get(nil)

    fmt.Println(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.

ENDPOINTS
GET /v2/transactionGET /v2/transaction/:id

List Transactions

Your bank statement is the list of all transactions registered in your private ledger.We return it paged.

Parameters

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.

after OPTIONAL

Filter entities created after this date.

before OPTIONAL

Filter entities created before this date.

tags OPTIONAL

Filter entities that contain the specified tags.

externalIds OPTIONAL

Filter transactions that carry the specified external IDs.

ids OPTIONAL

List of strings to get specific entities by ids.

fields OPTIONAL

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

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"
    "github.com/starkbank/sdk-go/starkbank/transaction"
)

func main() {
    
    var params = map[string]interface{}{}
    params["after"] = "2020-04-01"
    params["before"] = "2020-04-30"

    transactions := transaction.Query(params, nil)

    for transaction := range transactions {
        fmt.Println(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 {
            panic(fmt.Sprintf("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 expirations 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.

ENDPOINTS
POST /v2/invoiceGET /v2/invoiceGET /v2/invoice/:idPATCH /v2/invoice/:idGET /v2/invoice/:id/qrcodeGET /v2/invoice/:id/pdfGET /v2/invoice/logGET /v2/invoice/log/:idGET /v2/invoice/log/:id/pdfGET /v2/invoice/:id/payment

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

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.

Body 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)

taxId REQUIRED

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

name REQUIRED

Payer full name. Example: "Anthony Edward Stark"

due OPTIONAL

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

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%)

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)

splits OPTIONAL

Array of Split objects to indicate payment receivers. Example:

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

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"
        }
    ]
                

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"
        }
    ]
                

tags OPTIONAL

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

rules OPTIONAL

List of rules for modifying invoice behavior. Example:

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

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 {
            panic(fmt.Sprintf("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.

Query Parameters

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.

after OPTIONAL

Filter entities created after this date.

before OPTIONAL

Filter entities created before this date.

transactionIds OPTIONAL

List of transaction IDs linked to the desired transfers.

status OPTIONAL

Filter transfers by the specified status.

tags OPTIONAL

Filter entities that contain the specified tags.

ids OPTIONAL

List of strings to get specific entities by ids.

fields OPTIONAL

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

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"
    "github.com/starkbank/sdk-go/starkbank/invoice"
)

func main() {

    var params = map[string]interface{}{}
    params["after"] = "2020-10-01"
    params["before"] = "2020-10-30"

    invoices := invoice.Query(params, nil)

    for invoice := range invoices {
        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 {
            panic(fmt.Sprintf("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 {
            panic(fmt.Sprintf("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


Invoice({
    "amount": 12345,
    "due": "2021-05-12T15:23:26.000000+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,
    "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": "canceled",
    "created": "2020-10-26T17:32:00.997116+00:00",
    "updated": "2020-10-26T17:32:00.997126+00:00",
    "id": "4600131349381120"
})
  

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 {
            panic(fmt.Sprintf("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.*;

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

java.nio.file.Files.copy(
    png,
    new File("qrcode.png").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 {
            panic(fmt.Sprintf("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.

Query Parameters

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.

after OPTIONAL

Filter entities created after this date.

before OPTIONAL

Filter entities created before this date.

types OPTIONAL

Filters logs by log types.

invoiceIds OPTIONAL

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

fields OPTIONAL

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

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 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')

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"
    "github.com/starkbank/sdk-go/starkbank/invoice/log"
)

func main() {

    var params = map[string]interface{}{}
    params["after"] = "2020-10-01"
    params["before"] = "2020-10-30"
    
    logs := log.Query(params, nil)

    for log := range logs {
        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 {
            panic(fmt.Sprintf("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


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')

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 {
            panic(fmt.Sprintf("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 {
			panic(fmt.Sprintf("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.

ENDPOINTS
POST /v2/dynamic-brcodeGET /v2/dynamic-brcodeGET /v2/dynamic-brcode/:uuid

Create Dynamic Brcodes

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

Body Parameters

amount REQUIRED

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

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).

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
from datetime import datetime

brcodes = starkbank.dynamicbrcode.create([
    starkbank.DynamicBrcode(
        amount=4000,
        expiration=123456789,
        tags=['New sword', 'DynamicBrcode #1234']
    )
])

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']
    }]);

    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'
        ]
    ])
]);

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<>();
HashMap<String, Object> data = new HashMap<>();
data.put("amount", 4000);
data.put("expiration", 123456789);

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,
        )
    ]
)

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"
    "time"
)

func main() {

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

    brcodes, err := dynamicbrcode.Create(
        []dynamicbrcode.DynamicBrcode{
            {
                Amount:     4000,
                Expiration: 123456789,
                Tags:       []string{"New sword", "DynamicBrcode #1234"},
            },
        }, nil)
    if err.Errors != nil {
        for _, e := range err.Errors {
            panic(fmt.Sprintf("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"
            ]
        }
    ]
}'
  
RESPONSE

Python


DynamicBrcode(
    amount=4000,
    created=2023-02-06 21:15:00.118056,
    expiration=1428 days, 21:33:09,
    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'],
    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' ],
    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
        )

    [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"],
    "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"],
    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] 
    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"
            ],
            "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.

Query Parameters

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.

after OPTIONAL

Filter entities created after this date.

before OPTIONAL

Filter entities created before this date.

uuids OPTIONAL

list of uuids to filter retrieved objects.

tags OPTIONAL

Filter entities that contain the specified tags.

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"
    "github.com/starkbank/sdk-go/starkbank/brcode"
)

func main() {

    var params = map[string]interface{}{}
    params["after"] = "2023-02-01"
    params["before"] = "2023-02-28"

    brcodes := brcode.Query(params, nil)

    for brcode := range brcodes {
        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=1428 days, 21:33:09,
    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'],
    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' ],
    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
        )

    [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"],
    "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"],
    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] 
    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"
            ],
            "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 {
            panic(fmt.Sprintf("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=1428 days, 21:33:09,
    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'],
    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' ],
    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
        )

    [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"],
    "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"],
    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] 
    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"
        ],
        "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.

ENDPOINTS
GET /v2/depositGET /v2/deposit/:idPATCH /v2/deposit/:idGET /v2/deposit/logGET /v2/deposit/log/:idGET /v2/deposit/log/:id/pdf

Deposit Status

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

List Deposits

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

Parameters

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.

after OPTIONAL

Filter entities created after this date.

before OPTIONAL

Filter entities created before this date.

ids OPTIONAL

List of strings to get specific entities by ids.

status OPTIONAL

Filter deposits by the specified status.

sort OPTIONAL

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

tags OPTIONAL

Filter entities that contain the specified tags.

fields OPTIONAL

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

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"
    "github.com/starkbank/sdk-go/starkbank/deposit"
)

func main() {

    var params = map[string]interface{}{}
    params["after"] = "2020-11-01"
    params["before"] = "2020-11-30"
    
    deposits := deposit.Query(params, nil)

    for deposit := range deposits {
        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 {
            panic(fmt.Sprintf("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

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.

after OPTIONAL

Filter entities created after this date.

before OPTIONAL

Filter entities created before this date.

types OPTIONAL

Filters logs by log types.

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.

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"
    "github.com/starkbank/sdk-go/starkbank/deposit/log"
)

func main() {

    var params = map[string]interface{}{}
    params["after"] = "2020-11-01"
    params["before"] = "2020-11-30"
    
    logs := log.Query(params, nil)

    for log := range logs {
        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 {
            panic(fmt.Sprintf("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


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/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.

ENDPOINTS
POST /v2/boletoGET /v2/boletoGET /v2/boleto/:idDELETE /v2/boleto/:idGET /v2/boleto/:id/pdfGET /v2/boleto/logGET /v2/boleto/log/:id

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

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).

name REQUIRED

Customer full name. Example: "Anthony Edward Stark".

taxId REQUIRED

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

streetLine1 REQUIRED

Customer street address. Example: "Av. Faria Lima, 1844".

streetLine2 REQUIRED

Customer street address complement. Example: "CJ 13".

disctrict REQUIRED

Customer district name. Example: "Itaim Bibi".

city REQUIRED

Customer city name. Example: "São Paulo".

stateCode REQUIRED

Customer state code. Example: "SP".

zipCode REQUIRED

Customer zip code. Example: 01500-000.

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.

tags OPTIONAL

Filter entities that contain the specified tags.

splits OPTIONAL

Array of Split objects to indicate payment receivers. Example:

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

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"
        }
    ]                
                

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 {
            panic(fmt.Sprintf("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

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.

after OPTIONAL

Filter entities created after this date.

before OPTIONAL

Filter entities created before this date.

status OPTIONAL

Filter boletos by the specified status.

tags OPTIONAL

Filter entities that contain the specified tags.

ids OPTIONAL

List of strings to get specific entities by ids.

fields OPTIONAL

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

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"
    "github.com/starkbank/sdk-go/starkbank/boleto"
)

func main() {

    var params = map[string]interface{}{}
    params["after"] = "2020-04-01"
    params["before"] = "2020-04-30"
    
    boletos := boleto.Query(params, nil)

    for boleto := range boletos {
        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 {
            panic(fmt.Sprintf("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 {
            panic(fmt.Sprintf("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

layout OPTIONAL

PDF layout. Available options are "default" (full page) and "booklet" ("carnê").

hiddenFields OPTIONAL

List of fields to be hidden in Boleto pdf. Example: ["customerAddress"].

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 {
            panic(fmt.Sprintf("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

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.

after OPTIONAL

Filter entities created after this date.

before OPTIONAL

Filter entities created before this date.

types OPTIONAL

Filters logs by log types.

boletoIds OPTIONAL

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

fields OPTIONAL

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

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"
    "github.com/starkbank/sdk-go/starkbank/boleto/log"
)

func main() {

    var params = map[string]interface{}{}
    params["after"] = "2020-04-01"
    params["before"] = "2020-04-30"
    
    logs := log.Query(params, nil)

    for log := range logs {
        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 {
            panic(fmt.Sprintf("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.

ENDPOINTS
POST /v2/boleto-holmesGET /v2/boleto-holmesGET /v2/boleto-holmes/:idGET /v2/boleto-holmes/logGET /v2/boleto-holmes/log/:id

Holmes Status

Each boleto has a status that can change over time according to its life cycle: boleto-holmes-status

Payment 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

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 {
            panic(fmt.Sprintf("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

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.

after OPTIONAL

Filter entities created after this date.

before OPTIONAL

Filter entities created before this date.

tags OPTIONAL

Filter entities that contain the specified tags.

ids OPTIONAL

List of ids to filter retrieved objects. ex: ['5656565656565656', '4545454545454545']

boletoId OPTIONAL

String to get boletos holmes that refer to a specific boleto ID.

status OPTIONAL

Filter holmes by the specified status.

fields OPTIONAL

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

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"
    "github.com/starkbank/sdk-go/starkbank/boletoholmes"
)

func main() {

    var params = map[string]interface{}{}
    params["after"] = "2020-07-01"
    params["before"] = "2020-07-30"
    
    holmes := boletoholmes.Query(params, nil)

    for sherlock := range holmes {
        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-homes/: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 {
            panic(fmt.Sprintf("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

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.

after OPTIONAL

Filter entities created after this date.

before OPTIONAL

Filter entities created before this date.

types OPTIONAL

Filters logs by log types.

holmesIds OPTIONAL

Filter logs by Holmes IDs

fields OPTIONAL

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

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"
    "github.com/starkbank/sdk-go/starkbank/boletoholmes/log"
)

func main() {

    var params = map[string]interface{}{}
    params["after"] = "2020-07-01"
    params["before"] = "2020-07-30"
    
    logs := log.Query(params, nil)

    for log := range logs {
        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 {
            panic(fmt.Sprintf("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.

ENDPOINTS
GET /v2/splitGET /v2/split/:idGET /v2/split/logGET /v2/split/log/:id

List Splits

Get a list of Splits 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.

limit OPTIONAL

Number of results per cursor. Max = 100.

after OPTIONAL

Filter entities created after this date.

before OPTIONAL

Filter entities created before this date.

status OPTIONAL

Filter transfers by the specified status.

tags OPTIONAL

Filter entities that contain the specified tags.

ids OPTIONAL

List of strings to get specific entities by ids.

receiverIds OPTIONAL

list of receiver ids to filter retrieved objects. ex: ['5656565656565656', '4545454545454545'].

fields OPTIONAL

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

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

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.

after OPTIONAL

Filter entities created after this date.

before OPTIONAL

Filter entities created before this date.

types OPTIONAL

Filters logs by log types.

splitIds OPTIONAL

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

fields OPTIONAL

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

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.

ENDPOINTS
POST /v2/split-receiverGET /v2/split-receiverGET /v2/split-receiver/:idGET /v2/split-receiver/logGET /v2/split-receiver/log/:id

Create Split Receiver

Send a list of Split Receiver objects for creation in the Stark Bank API

Parameters

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'

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'

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'

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="341",
        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", "341");
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": "341",
            "branchCode": "2201",
            "accountNumber": "76543-8",
            "accountType": "salary"
        }
    ]
}'
  
RESPONSE

Python

SplitReceiver(
	account_number=76543-8,
	account_type=salary,
	bank_code=341,
	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": 341,
	"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": "341",
            "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

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.

after OPTIONAL

Filter entities created after this date.

before OPTIONAL

Filter entities created before this date.

transactionIds OPTIONAL

List of transaction IDs linked to the desired splitReceivers. ex: ['5656565656565656', '4545454545454545']

status OPTIONAL

Filter transfers by the specified status.

tags OPTIONAL

Filter entities that contain the specified tags.

ids OPTIONAL

List of strings to get specific entities by ids.

taxId OPTIONAL

filter for splitReceivers sent to the specified tax ID. ex: '012.345.678-90'

receiverIds OPTIONAL

List of receiver ids to filter retrieved objects. ex: ['5656565656565656', '4545454545454545'].

fields OPTIONAL

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

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": "341",
    "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": "341",
            "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": "341",
    "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": "341",
        "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

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.

after OPTIONAL

Filter entities created after this date.

before OPTIONAL

Filter entities created before this date.

types OPTIONAL

filter retrieved objects by event types. ex: 'processing' or 'success'

receiverIds OPTIONAL

List of Split Receiver ids to filter retrieved objects. ex: ['5656565656565656', '4545454545454545'].

fields OPTIONAL

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

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": "341",
      "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": "341",
                "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": "341",
      "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": "341",
            "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.

ENDPOINTS
PUT /v2/split-profileGET /v2/split-profileGET /v2/split-profile/:idGET /v2/split-profile/logGET /v2/split-profile/log/:id

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

interval OPTIONAL

Frequency of transfer, default "week". Options: "day", "week", "month"

delay OPTIONAL

How long the amount will stay at the workspace in milliseconds

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

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.

after OPTIONAL

Filter entities created after this date.

before OPTIONAL

Filter entities created before this date.

tags OPTIONAL

Filter entities that contain the specified tags.

ids OPTIONAL

List of strings to get specific entities by ids.

status OPTIONAL

Filter transfers by the specified status.

fields OPTIONAL

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

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

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.

after OPTIONAL

Filter entities created after this date.

before OPTIONAL

Filter entities created before this date.

types OPTIONAL

filter retrieved objects by event types. ex: 'processing' or 'success'

profileIds OPTIONAL

List of Split Profile ids to filter retrieved objects. ex: ['5656565656565656', '4545454545454545'].

fields OPTIONAL

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

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"
  }
}
  

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.

ENDPOINTS
POST /v2/merchant-sessionPOST /v2/merchant-session/:uuid/purchaseGET /v2/merchant-sessionGET /v2/merchant-session/:idGET /v2/merchant-session/logGET /v2/merchant-session/log/:id

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). Ex:

    {
        "allowedInstallments": [
            {
                "totalAmount": 5000,
                "count": 1
            },
            {
                "totalAmount": 5500,
                "count": 2
            }
        ]
    }
    

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).

challengeMode OPTIONAL

Defines whether or not a holder verification (3DS) will be used when authorizing the purchase.
Options are “enabled“ and “disabled“. Default: “enabled“

allowedIps OPTIONAL

The IP addresses that are allowed to create a purchase using the session.

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

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

Javascript

const starkbank = require('starkbank');

let merchantSession = await starkbank.merchantSession.create(
    {
        allowedFundingTypes: [
            'debit',
            'credit'
        ],
        allowedInstallments: [
            {
                totalAmount: 5000,
                count: 1
            },
            {
                totalAmount: 5500,
                count: 2
            }
        ],
        expiration: 3600,
        challengeMode: 'disabled',
        tags: ['purchase_1234']
    }
);

console.log(merchantSession)
    

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 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": ["purchase_1234"]
}'
    
RESPONSE

Python

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

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: [],
    updated: '2024-09-06T20:34:10.611544+00:00',
    uuid: 'b559350884674b31926abb5a8f3d5f31'
}
    

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

{
    "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": [],
        "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

uuid REQUIRED

The UUID of the Merchant Session created by the merchant to process the purchase.

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”.

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 associed 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.

metadata CONDITIONALLY REQUIRED

An object containing additional related to the purchase.
If 3DS is enabled, the following fields related to the payer's device are required:

    {
        "userAgent": "Mozilla/5.0 (X11; Linux x86_64) Chrome/51.0.2704.103 Safari/537.36",
        "timezoneOffset": 3,
        "userIp": "184.82.170.183",
        "language": "pt-BR"
    }
    

installmentCount OPTIONAL

A non-negative integer that represents the number of purchase installments.
Default: 1

ENDPOINT
POST /v2/merchant-session/:uuid/purchase
REQUEST

Python

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

Javascript

const starkbank = require('starkbank');

let merchantSessionPurchase = await starkbank.merchantSession.purchase(
    {
        uuid: '0d46a95fa3be44e2b1abd50308df96a6',
        amount: 5000,
        installmentCount: 1,
        cardExpiration: '2035-01',
        cardNumber: '4235647728025682',
        cardSecurityCode: '123',
        fundingType: 'credit',
        holderName: 'Rhaenyra Targaryen',
        billingCity: 'Sao Paulo',
        billingCountryCode: 'BRA',
        billingStateCode: 'SP',
        billingStreetLine1: 'Av. Faria Lima, 1844',
        billingStreetLine2: 'CJ 13',
        billingZipCode: '01500-000',
        holderEmail: 'rhaenyra.targaryen@starkbank.com',
        holderPhone: '11985923451',
        metadata: {
            userAgent: 'Mozilla/5.0 (X11; Linux x86_64) Chrome/51.0.2704.103 Safari/537.36',
            timezoneOffset: 3,
            userIp: '184.82.170.183',
            language: 'pt-BR'
        },
        tags: ['purchase_1234']
    }
);

console.log(merchantSessionPurchase)
    

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 POST '{{baseUrl}}/v2/merchant-session/0bb894a2697d41d99fe02cad2c00c9bc/purchase' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}' 
--header 'Content-Type: application/json' 
--data-raw '
{
    "amount": 180,
    "installmentCount": 12,
    "cardExpiration": "2035-01",
    "cardNumber": "5448280000000007",
    "cardSecurityCode": "123",
    "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": "11111-111",
    "metadata": {
        "extraData": "extraData",
        "language": "pt-BR",
        "timezoneOffset": 3,
        "userAgent": "Postman",
        "userIp": "255.255.255.25"
    },
    "tags": [ "yourtags" ]
}
    
RESPONSE

Python

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

Javascript

MerchantPurchase {
    amount: 5000,
    billingCity: 'Sao Paulo',
    billingCountryCode: 'BRA',
    billingStateCode: 'SP',
    billingStreetLine1: 'Av. Faria Lima, 1844',
    billingStreetLine2: 'CJ 13',
    billingZipCode: '01500-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: 'rhaenyra.targaryen@starkbank.com',
    holderName: 'Rhaenyra Targaryen',
    holderPhone: '11985923451',
    id: '6237525488173056',
    installmentCount: 1,
    metadata: {
        language: 'pt-BR',
        timezoneOffset: 3,
        userAgent: 'Mozilla/5.0 (X11; Linux x86_64) Chrome/51.0.2704.103 Safari/537.36',
        userIp: '184.82.170.183'
    },
    network: 'mastercard',
    source: 'merchant-session/6012328071921664',
    status: 'approved',
    tags: [],
    updated: '2024-09-06T21:36:17.785121+00:00'
}
    

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

{
    "message": "Merchant Purchase successfully created",
    "purchase": {
        "amount": 5000,
        "billingCity": "Sao Paulo",
        "billingCountryCode": "BRA",
        "billingStateCode": "SP",
        "billingStreetLine1": "Av. Faria Lima, 1844",
        "billingStreetLine2": "CJ 13",
        "billingZipCode": "01500-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": "rhaenyra.targaryen@starkbank.com",
        "holderName": "Rhaenyra Targaryen",
        "holderPhone": "11985923451",
        "id": "6237525488173056",
        "installmentCount": 1,
        "metadata": {
            "language": "pt-BR",
            "timezoneOffset": 3,
            "userAgent": "Mozilla/5.0 (X11; Linux x86_64) Chrome/51.0.2704.103 Safari/537.36",
            "userIp": "184.82.170.183"
        },
        "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

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.

after OPTIONAL

Filter entities created after this date.

before OPTIONAL

Filter entities created before this date.

status OPTIONAL

Filter sessions by the specified status, such as: active, expired, success.

tags OPTIONAL

Filter entities that contain the specified tags.

ids OPTIONAL

List of strings to get specific entities by ids.

fields OPTIONAL

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

ENDPOINT
GET /v2/merchant-session
REQUEST

Python

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

Javascript

const starkbank = require('starkbank');

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

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

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/merchant-session' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}' 
--header 'Content-Type: application/json' 
    
RESPONSE

Python

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

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

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": "ClcKFAoHY3JlYXRlZBIJCKDD2tebqYcDEjtqGml-YXBpLW1zLWNhcmQtbWVyY2hhbnQtc2J4ch0LEhBNZXJjaGFudFB1cmNoYXNlGICAgNil4boIDBgAIAE=",
    "purchases": [
        {
            "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

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

Javascript

const starkbank = require('starkbank');

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

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/merchant-session/5950134772826112' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}' 
--header 'Content-Type: application/json' 
    
RESPONSE

Python

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

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

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

{
    "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

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.

after OPTIONAL

Filter entities created after this date.

before OPTIONAL

Filter entities created before this date.

sessionIds OPTIONAL

Filter the merchant session ids to only include its corresponding logs

types OPTIONAL

Filters logs by log types.

fields OPTIONAL

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

ENDPOINT
GET /v2/merchant-session/log
REQUEST

Python

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

Javascript

const starkbank = require('starkbank');

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

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

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/merchant-purchase/log' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}' 
--header 'Content-Type: application/json' 
    
RESPONSE

Python

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

Javascript

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

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": "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

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

Javascript

const starkbank = require('starkbank');

(async() => {
    let merchantSessionLog = await starkbank.merchantSession.log.get('5950134772826112');
    console.log(merchantSessionLog);
})();
    

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/merchant-session/log/5950134772826112' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}' 
--header 'Content-Type: application/json' 
    
RESPONSE

Python

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

Javascript

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

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

{
    "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"
    }
}
    

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.

ENDPOINTS
POST /v2/merchant-purchasePATCH /v2/merchant-purchase/:idGET /v2/merchant-purchaseGET /v2/merchant-purchase/:idGET /v2/merchant-purchase/logGET /v2/merchant-purchase/log/:id

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)

fundingType REQUIRED

The type of funding to be used for the purchase. Options are “credit” and “debit”.

cardId REQUIRED

The ID of the Merchant Card to be used for 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 associed 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.

metadata CONDITIONALLY REQUIRED

An object containing additional related to the purchase.
If 3DS is enabled, the following fields related to the buyer's device are required:

    {
        "userAgent": "Mozilla/5.0 (X11; Linux x86_64) Chrome/51.0.2704.103 Safari/537.36",
        "timezoneOffset": 3,
        "userIp": "184.82.170.183",
        "language": "pt-BR"
    }
    

installmentCount OPTIONAL

A non-negative integer that represents the number of purchase installments.
Default: 1

challengeMode OPTIONAL

Defines whether or not a holder verification (3DS) will be used when authorizing the purchase.
Options are “enabled“ and “disabled“. Default: “enabled“

ENDPOINT
POST /v2/merchant-purchase
REQUEST

Python

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

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 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": 5000,
    "installmentCount": 1,
    "cardId": "5920400605184000",
    "fundingType": "credit",
    "challengeMode": "disabled",
    "billingCity": "Sao Paulo",
    "billingCountryCode": "BRA",
    "billingStateCode": "SP",
    "billingStreetLine1": "Av. Faria Lima, 1844",
    "billingStreetLine2": "CJ 13",
    "billingZipCode": "01500-000",
    "holderEmail": "rhaenyra.targaryen@starkbank.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

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

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

{
    "message": "Merchant Purchase successfully created",
    "purchase": {
        "amount": 5000,
        "billingCity": "Sao Paulo",
        "billingCountryCode": "BRA",
        "billingStateCode": "SP",
        "billingStreetLine1": "Av. Faria Lima, 1844",
        "billingStreetLine2": "CJ 13",
        "billingZipCode": "01500-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": "rhaenyra.targaryen@starkbank.com",
        "holderName": "Rhaenyra Targaryen",
        "holderPhone": "11985923451",
        "id": "5898767995764736",
        "installmentCount": 1,
        "metadata": {
            "language": "pt-BR",
            "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"
        },
        "network": "mastercard",
        "source": "merchant-card/5920400605184000",
        "status": "approved",
        "tags": [],
        "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

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.

after OPTIONAL

Filter entities created after this date.

before OPTIONAL

Filter entities created before this date.

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.

ids OPTIONAL

List of strings to get specific entities by ids.

fields OPTIONAL

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

ENDPOINT
GET /v2/merchant-purchase
REQUEST

Python

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

Javascript

const starkbank = require('starkbank');

(async() => {
    let merchantPurchases = await starkbank.merchantPurchase.query({limit: 3});

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

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/merchant-purchase' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}' 
--header 'Content-Type: application/json' 
    
RESPONSE

Python

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

Javascript

Purchase {
    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: '11111-111',
    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

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": "ClcKFAoHY3JlYXRlZBIJCKDD2tebqYcDEjtqGml-YXBpLW1zLWNhcmQtbWVyY2hhbnQtc2J4ch0LEhBNZXJjaGFudFB1cmNoYXNlGICAgNil4boIDBgAIAE=",
    "purchases": [
        {
            "amount": 180,
            "billingCity": "São Paulo",
            "billingCountryCode": "BRA",
            "billingStateCode": "SP",
            "billingStreetLine1": "Rua do Holder Name, 123",
            "billingStreetLine2": "",
            "billingZipCode": "11111-111",
            "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"
        }
    ]
}
    

Update a Merchant Purchase

Update a single purchase. If the purchase is currently approved, the status can be updated to canceled and the amount to 0, this will cancel the authorization.If the purchase is currently confirmed, the status can be updated to reversed and the amount can be updated to a lower value. This will debit the difference reverse the purchaseThe amount can only be updated to 0 if the purchase was confirmed in less than 24 hours.

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

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

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 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": "reversed",
    "amount": 0
}'
    
RESPONSE

Python

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

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

{
    "message": "Merchant Purchase successfully patched",
    "purchase": {
        "amount": 5000,
        "billingCity": "Sao Paulo",
        "billingCountryCode": "BRA",
        "billingStateCode": "SP",
        "billingStreetLine1": "Av. Faria Lima, 1844",
        "billingStreetLine2": "CJ 13",
        "billingZipCode": "01500-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": "rhaenyra.targaryen@starkbank.com",
        "holderName": "Rhaenyra Targaryen",
        "holderPhone": "11985923451",
        "id": "5898767995764736",
        "installmentCount": 1,
        "metadata": {
            "language": "pt-BR",
            "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"
        },
        "network": "mastercard",
        "source": "merchant-card/5920400605184000",
        "status": "confirmed",
        "tags": [],
        "updated": "2024-09-06T16:58:27.743409+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

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

Javascript

const starkbank = require('starkbank');

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

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/merchant-purchase/5950134772826112' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}' 
--header 'Content-Type: application/json' 
    
RESPONSE

Python

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

Javascript

Purchase {
    amount: 5000,
    billingCity: 'Sao Paulo',
    billingCountryCode: 'BRA',
    billingStateCode: 'SP',
    billingStreetLine1: 'Av. Faria Lima, 1844',
    billingStreetLine2: 'CJ 13',
    billingZipCode: '01500-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: 100,
    fundingType: 'credit',
    holderEmail: 'rhaenyra.targaryen@starkbank.com',
    holderName: 'Rhaenyra Targaryen',
    holderPhone: '11985923451',
    id: '5704487431831552',
    installmentCount: 1,
    metadata: {},
    network: 'mastercard',
    source: 'merchant-session/5748908131090432',
    status: 'confirmed',
    tags: [],
    updated: '2024-09-04T20:23:03.226050+00:00'
}
    

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

{
    "purchase": {
        "amount": 5000,
        "billingCity": "Sao Paulo",
        "billingCountryCode": "BRA",
        "billingStateCode": "SP",
        "billingStreetLine1": "Av. Faria Lima, 1844",
        "billingStreetLine2": "CJ 13",
        "billingZipCode": "01500-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": 100,
        "fundingType": "credit",
        "holderEmail": "rhaenyra.targaryen@starkbank.com",
        "holderName": "Rhaenyra Targaryen",
        "holderPhone": "11985923451",
        "id": "5704487431831552",
        "installmentCount": 1,
        "metadata": {},
        "network": "mastercard",
        "source": "merchant-session/5748908131090432",
        "status": "confirmed",
        "tags": [],
        "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 session entity according to its life cycle.

Parameters

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.

after OPTIONAL

Filter entities created after this date.

before OPTIONAL

Filter entities created before this date.

purchaseIds OPTIONAL

Filter the merchant purchase ids to only include its corresponding logs

types OPTIONAL

Filters logs by log types.

fields OPTIONAL

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

ENDPOINT
GET /v2/merchant-purchase/log
REQUEST

Python

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

Javascript

const starkbank = require('starkbank');

(async() => {
    let merchantPurchases = await starkbank.merchantPurchase.log.query({limit: 3});

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

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/merchant-purchase/log' 
    --header 'Access-Id: {{accessId}}' 
    --header 'Access-Time: {{accessTime}}' 
    --header 'Access-Signature: {{accessSignature}}' 
    --header 'Content-Type: application/json' 
RESPONSE

Python

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

Javascript

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: '11111-111',
        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: null,
    updated: '2024-07-16T19:42:26.902432+00:00'
    }
    

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": "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": "11111-111",
                "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

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

Javascript

const starkbank = require('starkbank');

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

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/merchant-purchase/log/5950134772826112' 
    --header 'Access-Id: {{accessId}}' 
    --header 'Access-Time: {{accessTime}}' 
    --header 'Access-Signature: {{accessSignature}}' 
    --header 'Content-Type: application/json' 
RESPONSE

Python

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

Javascript

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: '11111-111',
        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: null,
    updated: '2024-07-16T19:42:26.902432+00:00'
    }
    

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

{
    "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": "11111-111",
            "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": null,
        "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.

ENDPOINTS
GET /v2/merchant-cardGET /v2/merchant-card/:idGET /v2/merchant-card/logGET /v2/merchant-card/log/:id

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

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.

after OPTIONAL

Filter entities created after this date.

before OPTIONAL

Filter entities created before this date.

status OPTIONAL

Filter cards by the specified status, such as: active, expired, canceled or blocked.

tags OPTIONAL

Filter entities that contain the specified tags.

ids OPTIONAL

List of strings to get specific entities by ids.

fields OPTIONAL

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

ENDPOINT
GET /v2/merchant-card
REQUEST

Python

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

Javascript

const starkbank = require('starkbank');

(async() => {
    let merchantCards = await starkbank.merchantCard.query({limit: 3});

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

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/merchant-card' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}' 
--header 'Content-Type: application/json' 
    
RESPONSE

Python

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

Javascript

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'
}
    

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": "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

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

Javascript

const starkbank = require('starkbank');

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

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/merchant-card/5950134772826112' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}' 
--header 'Content-Type: application/json' 
    
RESPONSE

Python

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

Javascript

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'
}
    

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

{
    "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

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.

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.

types OPTIONAL

Filters logs by log types.

fields OPTIONAL

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

ENDPOINT
GET /v2/merchant-card/log
REQUEST

Python

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

Javascript

const starkbank = require('starkbank');

(async() => {
    let merchantCards = await starkbank.merchantCard.log.query({limit: 3});

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

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/merchant-card/log' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}' 
--header 'Content-Type: application/json' 
    
RESPONSE

Python

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

Javascript

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

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": "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

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

Javascript

const starkbank = require('starkbank');

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

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/merchant-card/log/5950134772826112' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}' 
--header 'Content-Type: application/json' 
    
RESPONSE

Python

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

Javascript

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

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

{
    "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.

ENDPOINTS
GET /v2/merchant-installmentGET /v2/merchant-installment/:idGET /v2/merchant-installment/logGET /v2/merchant-installment/log/:id

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

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.

after OPTIONAL

Filter entities created after this date.

before OPTIONAL

Filter entities created before this date.

status OPTIONAL

Filter installments by the specified status, such as: created, paid, canceled, voided.

tags OPTIONAL

Filter entities that contain the specified tags.

ids OPTIONAL

List of strings to get specific entities by ids.

fields OPTIONAL

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

ENDPOINT
GET /v2/merchant-installment
REQUEST

Python

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

Javascript

const starkbank = require('starkbank');

(async() => {
    let merchantInstallments = await starkbank.merchantInstallment.query({limit: 3});

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

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/merchant-installment' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}' 
--header 'Content-Type: application/json' 
    
RESPONSE

Python

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

Javascript

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: '4584324594663424',
    network: 'mastercard',
    purchaseId: '6237525488173056',
    status: 'created',
    tags: [],
    transactionIds: '',
    updated: '2024-09-06T21:36:20.911595+00:00'
}
    

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": "ClcKFAoHY3JlYXRlZBIJCKDD2tebqYcDEjtqGml-YXBpLW1zLWNhcmQtbWVyY2hhbnQtc2J4ch0LEhBNZXJjaGFudFB1cmNoYXNlGICAgNil4boIDBgAIAE=",
        "installments": [
            {
                "amount": 5000,
                "created": "2024-09-06T21:36:20.489713+00:00",
                "due": "2024-10-07T03:00:00+00:00",
                "fee": 60,
                "fundingType": "credit",
                "id": "4584324594663424",
                "network": "mastercard",
                "purchaseId": "6237525488173056",
                "status": "created",
                "tags": [],
                "transactionIds": [],
                "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

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

Javascript

const starkbank = require('starkbank');

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

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/merchant-installment/4584324594663424' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}' 
--header 'Content-Type: application/json' 
    
RESPONSE

Python

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

Javascript

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: '4584324594663424',
    network: 'mastercard',
    purchaseId: '6237525488173056',
    status: 'created',
    tags: [],
    transactionIds: '',
    updated: '2024-09-06T21:36:20.911595+00:00'
}
    

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

{
    "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": "4584324594663424",
        "network": "mastercard",
        "purchaseId": "6237525488173056",
        "status": "created",
        "tags": [],
        "transactionIds": [],
        "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 session entity according to its life cycle.

Parameters

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.

after OPTIONAL

Filter entities created after this date.

before OPTIONAL

Filter entities created before this date.

installmentIds OPTIONAL

Filter the merchant installment ids to only include its corresponding logs

types OPTIONAL

Filters logs by log types.

fields OPTIONAL

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

ENDPOINT
GET /v2/merchant-installment/log
REQUEST

Python

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

Javascript

const starkbank = require('starkbank');

(async() => {
    let merchantInstallments = await starkbank.merchantInstallment.log.query({limit: 3});

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

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/merchant-installment/log' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}' 
--header 'Content-Type: application/json' 
    
RESPONSE

Python

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

Javascript

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'
}
    

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": "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

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

Javascript

const starkbank = require('starkbank');

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

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/merchant-installment/log/5177774721466368' 
--header 'Access-Id: {{accessId}}' 
--header 'Access-Time: {{accessTime}}' 
--header 'Access-Signature: {{accessSignature}}' 
--header 'Content-Type: application/json' 
    
RESPONSE

Python

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

Javascript

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'
}
    

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

{
    "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"
    }
}
    

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.

ENDPOINTS
POST /v2/transferGET /v2/transferGET /v2/transfer/:id/DELETE /v2/transfer/:idGET /v2/transfer/:id/pdfGET /v2/transfer/logGET /v2/transfer/log/:id

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

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

amount REQUIRED

A positive integer that represents the amount in cents to be transferred. Example: 100 (R$1.00)

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

bankCode REQUIRED

Besides informing the receiver bank, this parameter specifies wether 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: 341 = Itaú

branchCode REQUIRED

Receiver bank account branch. Use "-" in case there is a validation digit. Example: 1234-5

accountNumber REQUIRED

Receiver bank account number. Use "-" before the validation digit. Example: 876543-2.

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"

externalId OPTIONAL

Unique ID to avoid 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"

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"

displayDescription OPTIONAL

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

tags OPTIONAL

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

rules OPTIONAL

list of rules for modifying transfer behavior. Example:

    [
        {
            "key": "resendingLimit",
            "value": 5
        }
    ]
                

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 {
            panic(fmt.Sprintf("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

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.

after OPTIONAL

Filter entities created after this date.

before OPTIONAL

Filter entities created before this date.

transactionIds OPTIONAL

List of transaction IDs linked to the desired transfers.

status OPTIONAL

Filter transfers by the specified status.

taxId OPTIONAL

Filter transfers sent to the specified tax ID.

ids OPTIONAL

List of strings to get specific entities by ids.

sort OPTIONAL

Sort order considered in the response. Options are: "created", "-created", "updated" and "-updated". "-" means descending order. Default is "-created".

tags OPTIONAL

Filter entities that contain the specified tags.

fields OPTIONAL

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

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"
    "github.com/starkbank/sdk-go/starkbank/transfer"
)

func main() {
    
    var params = map[string]interface{}{}
    params["after"] = "2020-04-01"
    params["before"] = "2020-04-30"

    transfers := transfer.Query(params, nil)

    for transfer := range transfers {
        fmt.Println(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=341,
    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: '341',
    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] => 341
    [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": "341",
    "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: 341,
    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: "341",
    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: 341,
    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:341 
    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 "341",
 :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": "341",
            "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 {
            panic(fmt.Sprintf("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=341,
    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: '341',
    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] => 341
    [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": "341",
    "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: 341,
    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: "341",
    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: 341,
    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:341 
    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 "341",
 :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": "341",
        "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 {
            panic(fmt.Sprintf("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=341,
    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: '341',
    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] => 341
    [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": "341",
    "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: 341,
    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: "341",
    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: 341,
    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": "341",
        "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 {
            panic(fmt.Sprintf("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

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.

after OPTIONAL

Filter entities created after this date.

before OPTIONAL

Filter entities created before this date.

types OPTIONAL

Filters logs by log types.

transferIds OPTIONAL

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

fields OPTIONAL

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

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"
    "github.com/starkbank/sdk-go/starkbank/transfer/log"
)

func main() {

    var params = map[string]interface{}{}
    params["after"] = "2020-04-01"
    params["before"] = "2020-04-30"
    
    logs := log.Query(params, nil)

    for log := range logs {
        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=341,
        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: '341',
        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] => 341
            [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": "341",
        "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: 341,
        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: "341",
        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: 341,
        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 {
			panic(fmt.Sprintf("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 "341",
  :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": "341",
                "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 {
            panic(fmt.Sprintf("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=341,
        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: '341',
        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] => 341
            [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": "341",
        "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: 341,
        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: "341",
        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: 341,
        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:341 
            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 "341",
  :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": "341",
            "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,
        }
    }
}
  

Brcode Payment

Here we will teach you how to create and manage brcode payments.

ENDPOINTS
POST /v2/brcode-paymentGET /v2/brcode-paymentGET /v2/brcode-payment/:idPATCH /v2/brcode-payment/:idGET /v2/brcode-payment/:id/pdfGET /v2/brcode-payment/logGET /v2/brcode-payment/log/:id

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

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.

taxId REQUIRED

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

description REQUIRED

Text to be displayed in your statement. Min lenght = 10.

amount CONDITIONALLY REQUIRED

If the brcode does not provide an amount, this parameter is mandatory, else it is optional. Example: 23456 (R$ 234,56).

tags OPTIONAL

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

scheduled OPTIONAL

Schedule the payment for a specific date. Default value is the current day.

rules OPTIONAL

List of rules for modifying brcodePayment behavior. Example:

    [
        {
            "key": "resendingLimit",
            "value": 5
        }
    ]
                

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 {
            panic(fmt.Sprintf("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

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.

after OPTIONAL

Filter entities created after this date.

before OPTIONAL

Filter entities created before this date.

status OPTIONAL

Filter boletos by the specified status.

tags OPTIONAL

Filter entities that contain the specified tags.

ids OPTIONAL

List of strings to get specific entities by ids.

fields OPTIONAL

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

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"
    "github.com/starkbank/sdk-go/starkbank/brcodepayment"
)

func main() {

    var params = map[string]interface{}{}
    params["after"] = "2021-01-01"
    params["before"] = "2021-01-30"
    
    payments := brcodepayment.Query(params, nil)

    for payment := range payments {
        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 {
            panic(fmt.Sprintf("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 {
            panic(fmt.Sprintf("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 {
            panic(fmt.Sprintf("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

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.

after OPTIONAL

Filter entities created after this date.

before OPTIONAL

Filter entities created before this date.

types OPTIONAL

Filters logs by log types.

paymentIds OPTIONAL

Array of payment ids linked to the desired logs.

fields OPTIONAL

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

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"
    "github.com/starkbank/sdk-go/starkbank/brcodepayment/log"
)

func main() {

    var params = map[string]interface{}{}
    params["after"] = "2021-01-01"
    params["before"] = "2021-01-30"
    
    logs := log.Query(params, nil)

    for log := range logs {
        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 {
            panic(fmt.Sprintf("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"
        }
    ]
}
  

Boleto Payment

Here we will teach you how to create and manage boleto payments.

ENDPOINTS
POST /v2/boleto-paymentGET /v2/boleto-paymentGET /v2/boleto-payment/:idDELETE /v2/boleto-payment/:idGET /v2/boleto-payment/:id/pdfGET /v2/boleto-payment/logGET /v2/boleto-payment/log/:id

Payment Status

Each payment has a status that can change over time according to its life cycle: boleto-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: boleto-payment-log

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

line CONDITIONALLY REQUIRED

Number sequence that describes the payment. Either "line" or "barCode" parameters are required. If both are sent, they must match.

barCode CONDITIONALLY REQUIRED

Bar code number that describes the payment. Either "line" or "barCode" parameters are required. If both are sent, they must match.

taxId REQUIRED

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

description REQUIRED

Text to be displayed in your statement. Min lenght = 10.

tags OPTIONAL

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

scheduled OPTIONAL

Schedule the payment for a specific date. Default value is the current day.

amount OPTIONAL

Amount to be paid. If none is informed, the current boleto value will be used. Example: 23456 (= R$ 234.56)

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 {
            panic(fmt.Sprintf("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

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.

after OPTIONAL

Filter entities created after this date.

before OPTIONAL

Filter entities created before this date.

status OPTIONAL

Filter boletos by the specified status.

tags OPTIONAL

Filter entities that contain the specified tags.

ids OPTIONAL

List of strings to get specific entities by ids.

fields OPTIONAL

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

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"
    "github.com/starkbank/sdk-go/starkbank/boletopayment"
)

func main() {

    var params = map[string]interface{}{}
    params["after"] = "2020-04-01"
    params["before"] = "2020-04-30"
    
    payments := boletopayment.Query(params, nil)

    for payment := range payments {
        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 {
            panic(fmt.Sprintf("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 {
            panic(fmt.Sprintf("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 {
            panic(fmt.Sprintf("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

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.

after OPTIONAL

Filter entities created after this date.

before OPTIONAL

Filter entities created before this date.

types OPTIONAL

Filters logs by log types.

paymentIds OPTIONAL

Array of payment ids linked to the desired logs.

fields OPTIONAL

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

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 := log.Query(params, nil)

    for log := range logs {
        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 {
            panic(fmt.Sprintf("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",
        }
    }
}
  

Utility Payment

Here we will teach you how to create and manage utility payments, such as electricity and water bills.

ENDPOINTS
POST /v2/utility-paymentGET /v2/utility-paymentGET /v2/utility-payment/:idDELETE /v2/utility-payment/:idGET /v2/utility-payment/:id/pdfGET /v2/utility-payment/logGET /v2/utility-payment/log/:id

Payment Status

Each payment has a status that can change over time according to its life cycle: utility-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 events flow: utility-payment-log

Create Utility Payments

Use this route to pay utility bills using the available balance in your Stark Bank account.

Parameters

line CONDITIONALLY REQUIRED

Number sequence that describes the payment. Either "line" or "barCode" parameters are required. If both are sent, they must match.

barCode CONDITIONALLY REQUIRED

Bar code number that describes the payment. Either "line" or "barCode" parameters are required. If both are sent, they must match.

description REQUIRED

Text to be displayed in your statement. Min lenght = 10.

tags OPTIONAL

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

scheduled OPTIONAL

Schedule the payment for a specific date. Default value is the current day.

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 {
            panic(fmt.Sprintf("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

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.

after OPTIONAL

Filter entities created after this date.

before OPTIONAL

Filter entities created before this date.

status OPTIONAL

Filter utilitys by the specified status.

tags OPTIONAL

Filter entities that contain the specified tags.

ids OPTIONAL

List of strings to get specific entities by ids.

fields OPTIONAL

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

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"
    "github.com/starkbank/sdk-go/starkbank/utilitypayment"
)

func main() {

    var params = map[string]interface{}{}
    params["after"] = "2020-04-01"
    params["before"] = "2020-04-30"
    
    payments := utilitypayment.Query(params, nil)

    for payment := range payments {
        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 {
            panic(fmt.Sprintf("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 {
            panic(fmt.Sprintf("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 {
            panic(fmt.Sprintf("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

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.

after OPTIONAL

Filter entities created after this date.

before OPTIONAL

Filter entities created before this date.

types OPTIONAL

Filters logs by log types.

paymentIds OPTIONAL

Array of payment ids linked to the desired logs.

fields OPTIONAL

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

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 := log.Query(params, nil)

    for log := range logs {
        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 {
            panic(fmt.Sprintf("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",
      }   
  }
}
  

Tax Payment

Here we will explain how to create and manage tax payments, such as ISS and DAS.

ENDPOINTS
POST /v2/tax-paymentGET /v2/tax-paymentGET /v2/tax-payment/:idDELETE /v2/tax-payment/:idGET /v2/tax-payment/:id/pdfGET /v2/tax-payment/logGET /v2/tax-payment/log/:id

Payment Status

Each payment has a status that can change over time according to its life cycle: tax-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 events flow: tax-payment-log

Create Tax Payments

Use this route to pay taxes using the available balance in your Stark Bank account.

Parameters

line CONDITIONALLY REQUIRED

Number sequence that describes the payment. Either "line" or "barCode" parameters are required. If both are sent, they must match.

barCode CONDITIONALLY REQUIRED

Bar code number that describes the payment. Either "line" or "barCode" parameters are required. If both are sent, they must match.

description REQUIRED

Text to be displayed in your statement. Min lenght = 10.

tags OPTIONAL

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

scheduled OPTIONAL

Schedule the payment for a specific date. Default value is the current day.

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 {
            panic(fmt.Sprintf("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

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.

after OPTIONAL

Filter entities created after this date.

before OPTIONAL

Filter entities created before this date.

status OPTIONAL

Filter taxs by the specified status.

tags OPTIONAL

Filter entities that contain the specified tags.

ids OPTIONAL

List of strings to get specific entities by ids.

fields OPTIONAL

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

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"
    "github.com/starkbank/sdk-go/starkbank/taxpayment"
)

func main() {

    var params = map[string]interface{}{}
    params["after"] = "2021-04-01"
    params["before"] = "2021-04-30"
    
    payments := taxpayment.Query(params, nil)

    for payment := range payments {
        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 {
            panic(fmt.Sprintf("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 {
            panic(fmt.Sprintf("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 {
            panic(fmt.Sprintf("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

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.

after OPTIONAL

Filter entities created after this date.

before OPTIONAL

Filter entities created before this date.

types OPTIONAL

Filters logs by log types.

paymentIds OPTIONAL

Array of payment ids linked to the desired logs.

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 := log.Query(params, nil)

    for log := range logs {
        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 {
            panic(fmt.Sprintf("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"
    }
}
  

DARF Payment

Here we will explain how to manually pay DARFs without bar codes.

ENDPOINTS
POST /v2/darf-paymentGET /v2/darf-paymentGET /v2/darf-payment/:idDELETE /v2/darf-payment/:idGET /v2/darf-payment/:id/pdfGET /v2/darf-payment/logGET /v2/darf-payment/log/:id

Payment Status

Each payment has a status that can change over time according to its life cycle: darf-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 events flow: darf-payment-log

Create DARF payments

Use this route to pay DARFs using the available balance in your Stark Bank account.

Parameters

description REQUIRED

Text to be displayed in your statement (min. 10 characters). Example: "payment ABC"

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

competence REQUIRED

Competence month of the service. Example: '2020-03-10'

nominalAmount REQUIRED

Amount due in cents without fee or interest. Example: 23456 (= R$ 234.56)

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)

due REQUIRED

Due date for payment. Example: '2020-03-10'

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 {
            panic(fmt.Sprintf("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

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.

after OPTIONAL

Filter entities created after this date.

before OPTIONAL

Filter entities created before this date.

status OPTIONAL

Filter DARFs by the specified status.

tags OPTIONAL

Filter entities that contain the specified tags.

ids OPTIONAL

List of strings to get specific entities by ids.

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"
    "github.com/starkbank/sdk-go/starkbank/darfpayment"
)

func main() {

    var params = map[string]interface{}{}
    params["after"] = "2021-02-01"
    params["before"] = "2021-02-28"
    
    payments := darfpayment.Query(params, nil)

    for payment := range payments {
        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 {
            panic(fmt.Sprintf("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 {
            panic(fmt.Sprintf("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 {
            panic(fmt.Sprintf("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

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.

after OPTIONAL

Filter entities created after this date.

before OPTIONAL

Filter entities created before this date.

types OPTIONAL

Filters logs by log types.

paymentIds OPTIONAL

Array of payment ids linked to the desired logs.

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 := log.Query(params, nil)

    for log := range logs {
        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 {
            panic(fmt.Sprintf("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"

ENDPOINTS
POST /v2/payment-preview

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 {
            panic(fmt.Sprintf("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,
        discount_amount=0,
        fine_amount=0,
        interest_amount=0,
        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: '',
        discountAmount: 0,
        fineAmount: 0,
        interestAmount: 0,
        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
        (
            [status] => created
            [name] => Humberto EI
            [taxId] => 27.564.801/0001-36
            [bankCode] => 01705236
            [accountType] => savings
            [allowChange] => false
            [amount] => 1000
            [nominalAmount] => 1000
            [interestAmount] => 0
            [fineAmount] => 0
            [reductionAmount] => 0
            [discountAmount] => 0
            [reconciliationId] => 12345
        )

)
  

Java

PaymentPreview({
    "scheduled": "2023-01-29",
    "type": "brcode-payment",
    "payment": {
        "accountType": "savings",
        "allowChange": false,
        "amount": 1000.0,
        "bankCode": "01705236",
        "cashAmount": 0.0,
        "cashierBankCode": "",
        "cashierType": "",
        "discountAmount": 0.0,
        "fineAmount": 0.0,
        "interestAmount": 0.0,
        "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(
        status: created,
        name: Humberto EI,
        tax_id: 27.564.801/0001-36,
        bank_code: 01705236,
        account_type: savings,
        allow_change: false,
        amount: 1000,
        nominal_amount: 1000,
        interest_amount: 0,
        fine_amount: 0,
        reduction_amount: 0,
        discount_amount: 0,
        reconciliation_id: 12345
    )
)
  

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{
        status: "created",
        name: "Humberto EI",
        tax_id: "27.564.801/0001-36",
        bank_code: "01705236",
        account_type: "savings",
        allow_change: false,
        amount: 1000,
        nominal_amount: 1000,
        interest_amount: 0,
        fine_amount: 0,
        reduction_amount: 0,
        discount_amount: 0,
        reconciliation_id: "12345"
    }
}
  

C#

PaymentPreview(
    ID: 00020126580014br.gov.bcb.pix0136a629532e-7693-4846-852d-1bbff817b5a8520400005303986540510.005802BR5908T'Challa6009Sao Paulo62090505123456304B14A
    Scheduled: 29/01/2023
    Type: brcode-payment
    Payment: PaymentPreview.BrcodePreview(
        Status: created
        Name: Humberto EI
        TaxId: 27.564.801/0001-36
        BankCode: 01705236
        AccountType: savings
        AllowChange: false
        Amount: 1000
        NominalAmount: 1000
        InterestAmount: 0
        FineAmount: 0
        ReductionAmount: 0
        DiscountAmount: 0
        ReconciliationId: 12345
    )
)
  

Go

{
    Id:00020126580014br.gov.bcb.pix0136a629532e-7693-4846-852d-1bbff817b5a8520400005303986540510.005802BR5908T'Challa6009Sao Paulo62090505123456304B14A 
    Payment:{
        AccountType:savings
        AllowChange:false
        Amount:1000 
        BankCode:01705236 
        FineAmount:0 
        InterestAmount:31 
        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
    :scheduled 2023-01-29
    :type brcode-payment
    :payment {
        :status created
        :name Humberto EI
        :tax-id 27.564.801/0001-36
        :bank-code 01705236
        :account-type savings
        :allow-change false
        :amount 1000
        :nominal-amount 1000
        :interest-amount 0
        :fine-amount 0
        :reduction-amount 0
        :discount-amount 0
        :reconciliation-id 12345
    }
}
  

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": "",
                "discountAmount": 0,
                "fineAmount": 0,
                "interestAmount": 0,
                "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!

ENDPOINTS
POST /v2/payment-requestGET /v2/payment-request

Payment Request Status

Each payment has a status that can change over time according to its life cycle: payment-request-status

Create Payment Requests

Use this route to create new payment requests in our Web Banking approval flow.

Parameters

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".

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. Example:

    {
        "amount": 100000000,
        "taxId": "594.739.480-42",
        "name": "Daenerys Targaryen Stormborn",
        "bankCode": "341",
        "branchCode": "2201",
        "accountNumber": "76543-8"
    }
                

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.

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="341",
            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: "341",
    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" => "341",
            "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", "341");
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: '341',
        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: "341",
                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: "341",
                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:      "341",
                    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 {
            panic(fmt.Sprintf("code: %s, message: %s", e.Code, e.Message))
        }
    }

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

Clojure

(def payment {
    :amount 10000000000
    :bank-code "341"
    :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": "341",
                "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=341,
        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: '341',
        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] => 341
            [branchCode] => 2201
            [accountNumber] => 76543-8
        )

    [type] => transfer
)
  

Java

PaymentRequest({
    "centerId": "4762954029334528",
    "payment": {
        "amount": 100000000,
        "name": "Daenerys Targaryen Stormborn",
        "taxId": "594.739.480-42",
        "bankCode": "341",
        "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: 341,
        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: "341",
            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: 341,
        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:341 
        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 341,
        :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": "341",
                "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

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.

after OPTIONAL

Filter entities created after this date.

before OPTIONAL

Filter entities created before this date.

type OPTIONAL

Filters payment requests by the type inferred from the payment parameter, if it is not a dictionary. Example: boleto-payment

status OPTIONAL

Filter payment requests by the specified status. Example: success

sort OPTIONAL

Sort order considered in the response. Options are: "created", "-created", "updated" and "-updated". "-" means descending order. Default is "-created".

tags OPTIONAL

Filter entities that contain the specified tags.

ids OPTIONAL

List of strings to get specific entities by ids.

fields OPTIONAL

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

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 := paymentrequest.Query("4762954029334528", params, nil)

    for request := range requests {
        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=341,
        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: '341',
        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] => 341
            [branchCode] => 2201
            [accountNumber] => 76543-8
        )

    [type] => transfer
)
  

Java

PaymentRequest({
    "centerId": "4762954029334528",
    "payment": {
        "amount": 100000000,
        "name": "Daenerys Targaryen Stormborn",
        "taxId": "594.739.480-42",
        "bankCode": "341",
        "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: 341,
        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: "341",
            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: 341,
        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:341 
        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 341,
        :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": "341",
                "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.

ENDPOINTS
POST /v2/webhook

GET /v2/webhook

GET /v2/webhook/:id

DELETE /v2/webhook/:id

EVENT SAMPLE
{
    "event": {
        "id": "4816763241889792",
        "subscription": "boleto",
        "isDelivered": true,
        "created": "2020-03-26T18:00:00.363220+00:00"
        "log": {
            "id": "5096976731340800",
            "created": "2020-03-26T18:00:05.165485+00:00",
            "errors": [],
            "type": "paid",
            "boleto": {
                "taxId": "20.018.183/0001-80",
                "overdueLimit": 5,
                "fine": 2.5,
                "id": "5730174175805440",
                "city": "São Paulo",
                "fee": 0,
                "streetLine2": "CJ 13",
                "district": "Itaim Bibi",
                "streetLine1": "Av. Faria Lima, 1844",
                "due": "2020-06-21T02:59:59.999999+00:00",
                "workspaceId": "5155165527080960",
                "interest": 1.3,
                "status": "paid",
                "tags": ["war supply", "invoice #1234"],
                "zipCode": "01500-000",
                "line": "34191.09008 64410.047308 71444.640008 7 82920000400000",
                "name": "Iron Bank S.A.",
                "created": "2020-03-25T22:22:41.106321+00:00",
                "barCode": "34197829200004000001090064410047307144464000",
                "amount": 400000,
                "stateCode": "SP",
                "descriptions": []
            }
        },
    }
}

Create a Webhook

Here you can register a new webhook URL. The subscriptions refer to which kind of log will be notified 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

url REQUIRED

The server URL that will receive the Webhook Events.

subscriptions REQUIRED

Array of subscriptions. Possible values: "deposit", "invoice", "brcode-payment", "transfer", "utility-payment", "boleto", "boleto-payment", "darf-payment", "payment-request" or "boleto-holmes"

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 {
            panic(fmt.Sprintf("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.

limit OPTIONAL

Maximum number of Webhooks to be retrieved. Max = 100.

fields OPTIONAL

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

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 := webhook.Query(nil, nil)

    for webhook := range webhooks {
        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 {
            panic(fmt.Sprintf("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 {
            panic(fmt.Sprintf("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.

Python


if event.subscription == "transfer":
    print(event.log.transfer)

elif event.subscription == "boleto":
    print(event.log.boleto)

elif event.subscription == "boleto-payment":
    print(event.log.payment)

elif event.subscription == "utility-payment":
    print(event.log.payment)
  

Javascript


if (event.subscription === 'transfer') {
    console.log(event.log.transfer);
} else if (event.subscription === 'boleto') {
    console.log(event.log.boleto);
} else if (event.subscription === 'boleto-payment') {
    console.log(event.log.payment);
} else if (event.subscription === 'utility-payment') {
    console.log(event.log.payment);
}
  

PHP


if ($event->subscription == "transfer"){
    print_r($event->log->transfer);
} elseif ($event->subscription == "boleto"){
    print_r($event->log->boleto);
} elseif ($event->subscription == "boleto-payment"){
    print_r($event->log->payment);
} elseif ($event->subscription == "utility-payment"){
    print_r($event->log->payment);
}
  

Java


switch (event.subscription) {
    case "transfer": {
        Transfer.Log log = ((Event.TransferEvent) event).log;
        System.out.println(log.transfer);
        break;
    }
    case "boleto": {
        Boleto.Log log = ((Event.BoletoEvent) event).log;
        System.out.println(log.boleto);
        break;
    }
    case "boleto-payment": {
        BoletoPayment.Log log = ((Event.BoletoPaymentEvent) event).log;
        System.out.println(log.payment);
        break;
    }
    case "utility-payment": {
        UtilityPayment.Log log = ((Event.UtilityPaymentEvent) event).log;
        System.out.println(log.payment);
        break;
    }
}
  

Ruby


if event.subscription == 'transfer'
    puts event.log.transfer
elsif event.subscription == 'boleto'
    puts event.log.boleto
elsif event.subscription == 'boleto-payment'
    puts event.log.payment
elsif event.subscription == 'utility-payment'
    puts event.log.payment
end
  

Elixir


case event.subscription do
    "transfer" -> event.log.transfer
    "boleto" -> event.log.boleto
    "boleto-payment" -> event.log.payment
    "utility-payment" -> event.log.payment
end |> IO.inspect
  

C#


if (eventObject.Subscription == "transfer")  {
    StarkBank.Transfer.Log log = eventObject.Log as StarkBank.Transfer.Log;
    Console.WriteLine(log.Transfer);
} else if (eventObject.Subscription == "boleto")  {
    StarkBank.Boleto.Log log = eventObject.Log as StarkBank.Boleto.Log;
    Console.WriteLine(log.Boleto);
} else if (eventObject.Subscription == "boleto-payment")  {
    StarkBank.BoletoPayment.Log log = eventObject.Log as StarkBank.BoletoPayment.Log;
    Console.WriteLine(log.Payment);
} else if (eventObject.Subscription == "utility-payment")  {
    StarkBank.UtilityPayment.Log log = eventObject.Log as StarkBank.UtilityPayment.Log;
    Console.WriteLine(log.Payment);
}
  

Go

if event.Subscription == "transfer" {
fmt.Println(event.Log)
} else if event.Subscription == "boleto" {
fmt.Println(event.Log)
} else if event.Subscription == "boleto-payment" {
fmt.Println(event.Log)
}  else if event.Subscription == "utility-payment" {
fmt.Println(event.Log)
}
                    

Clojure


(case (:subscription event)
    "transfer" (println (:transfer (:log event)))
    "boleto" (println (:boleto (:log event)))
    "boleto-payment" (println (:payment (:log event)))
    "utility-payment" (println (:payment (:log event))))
  

ENDPOINTS
GET /v2/event

GET /v2/event/:id

DELETE /v2/event/:id

PATCH /v2/event/:id

EVENT SAMPLE
{
    "event": {
        "id": "5344245984526336",
        "isDelivered": false,
        "subscription": "transfer",
        "created": "2020-03-11T00:14:23.201602+00:00",
        "log": {
            "id": "5344245984526336",
            "errors": [],
            "type": "success",
            "created": "2020-03-11T00:14:22.104676+00:00",
            "transfer": {
                "id": "5907195937947648",
                "status": "success",
                "amount": 10000000,
                "name": "Jon Snow",
                "bankCode": "001",
                "branchCode": "5897"
                "accountNumber": "10000-0",
                "taxId": "580.822.679-17",
                "tags": ["jon", "snow", "knows-nothing"],
                "created": "2020-03-11T00:14:21.548876+00:00",
                "updated": "2020-03-11T00:14:22.104702+00:00",
                "transactionIds": ["6671637889941504"],
                "fee": 200,
            }
        }
    }
}

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

cursor OPTIONAL

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

limit OPTIONAL

Maximum number of Events to be retrieved. Max = 100.

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"

isDelivered OPTIONAL

If false, only gets Events that haven't been delivered. If true, only gets Events that have already been delivered.

fields OPTIONAL

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

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"
    "github.com/starkbank/sdk-go/starkbank/event"
)

func main() {
    
    var params = map[string]interface{}{}
    params["isDelivered"] = false
    params["after"] = "2020-04-01"
    params["before"] = "2020-04-30"

    events := event.Query(params, nil)

    for event := range events {
        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=341,
            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: '341',
            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] => 341
                    [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": "341",
            "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: 341,
            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: "341",
            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: 341,
            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:341
            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 "341",
   :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": "341",
                    "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 {
            panic(fmt.Sprintf("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=341,
            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: '341',
            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] => 341
                    [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": "341",
            "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: 341,
            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: "341",
            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: 341,
            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:341
            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 "341",
   :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": "341",
                "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 {
            panic(fmt.Sprintf("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=341,
            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: '341',
            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] => 341
                    [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": "341",
            "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: 341,
            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: "341",
            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: 341,
            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:341
            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 "341",
   :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": "341",
                "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 restabilize 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 {
            panic(fmt.Sprintf("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=341,
            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: '341',
            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] => 341
                    [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": "341",
            "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: 341,
            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: "341",
            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: 341,
            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:341
            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 "341",
   :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": "341",
                "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.

ENDPOINTS
GET /v2/eventGET /v2/event/attempt/:id

List failed Webhook Event delivery attempts

Get information on failed webhook event delivery attempts.

Parameters

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.

after OPTIONAL

Filter entities created after this date.

before OPTIONAL

Filter entities created before this date.

eventIds OPTIONAL

List of Event ids to filter attempts. Example: ["5656565656565656", "4545454545454545"]

webhookIds OPTIONAL

list of Webhook ids to filter attempts. Example: ["5656565656565656", "4545454545454545"]

fields OPTIONAL

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

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"
    "github.com/starkbank/sdk-go/starkbank/event/attempt"
)

func main() {
    
    var params = map[string]interface{}{}
    params["after"] = "2020-01-30"

    attempts := attempt.Query(params, nil)

    for attempt := range attempts {
        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 {
            panic(fmt.Sprintf("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.

ENDPOINTS
GET /v2/dict-keyGET /v2/dict-key/:id

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

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.

after OPTIONAL

Filter entities created after this date.

before OPTIONAL

Filter entities created before this date.

status OPTIONAL

Filter dicts by the specified status.

type OPTIONAL

DICT Key type. Options are: "cpf", "cnpj", "phone", "email" or "evp".

ids OPTIONAL

List of strings to get specific entities by ids.

fields OPTIONAL

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

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 := dictkey.Query(params, nil)

    for key := range keys {
        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 {
            panic(fmt.Sprintf("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

A Institution is used to query institutions registered by the Brazilian Central Bank for Pix and TED transactions.

ENDPOINTS
GET /v2/institution

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 := institution.Query(params, nil)

    for institution := range institutions {
        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.

ENDPOINTS
GET /v2/public-key

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 olders keys can be used to verify older messages.

ENDPOINTS
GET /v2/public-key

RESPONSE SAMPLE
{
    "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"
        }
    ]
}