Other Payments

At Stark Bank, we offer a variety of payment options tailored to your needs:  1. Boleto: pay registered boletos generated either through Stark Bank or other financial institutions.  2. Utility: payments for services like electricity and water bills.  3. Tax: handle taxes such as ISS and DAS.  4. DARF: payments without barcodes.  5. BR Codes: Pix standard QR code payment.With all these options, you have the flexibility to create, preview, delete, and generate PDF receipts for your payments.Payment StatusEach payment has a status that can change over time according to its life cycle:boleto-payment-statusPayment LogEvery time we modify a 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-logPayments with Approval FlowEach payment has a status that can change over time according to its life cycle:payment-request-status

RESOURCE SUMMARY
Payment Preview
Visualize payment before pay
Boleto Payment
Create Boleto payments
Utility Payment
Create Utility payments
Tax Payment
Create Tax payments
DARF Payment
Create Tax payments
BR Code Payment
Create BR Code payments
Payments with approval flow
Create paymeny requests

Setup in Sandbox/Production

For each environment:1. Create an account at Stark Bank.2. Create asynchronous Webhook subscriptions to receive update Events. Register an URL using the POST Webhook route to receive Events about the following resources:  2.1 BoletoPayment: Creation and updates of BoletoPayments  2.2 UtilityPayment: Creation and updates of UtilityPayment  2.3 TaxPayment: Creation and updates of TaxPayment  2.4 DarfPayment: Creation and updates of DarfPayment  2.5 BrcodePayment: Creation and updates of BrcodePayment  2.6 PaymentRequest: Creation and updates of PaymentRequest

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

Python


import starkbank

previews = starkbank.paymentpreview.create([
    starkbank.PaymentPreview(
        id="00020126580014br.gov.bcb.pix0136a629532e-7693-4846-852d-1bbff817b5a8520400005303986540510.005802BR5908T'Challa6009Sao Paulo62090505123456304B14A"
    )
])

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

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

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

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

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

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

Creating BoletoPayment

Using the BoletoPayment resource, it is possible to create payments for boletos by providing parameters such as Line or Brcode, description, and taxId.You can also include the 'tags' parameter for future reconciliations, the 'scheduled' parameter to schedule the payment, and the 'amount' parameter to pay a specific amount.If none are informed, the current boleto value will be used.

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",
        description="Payment for killing white walkers",
    )
])

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',
            line: '34191.09107 05447.947309 71544.640008 8 84660000011631'
        }
    ])

    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",
        "description" => "Payment for killing white walkers"
    ])
]);

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("description", "Payment for killing white walkers");
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',
            description: 'Payment for killing white walkers'
        )
    ]
)

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",
        description: "Payment for killing white walkers"
    }
])

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",
            description: "Payment for killing white walkers",
            taxID: "38.435.677/0001-25"
        )
    }
);

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"
            },
        }, 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"
        :description "Payment for killing white walkers"
      }
    ]))
(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",
            "description": "Payment for killing white walkers"
        },
    ]
}'
  
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=[],
    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: [ ],
    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
        (
        )

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

Creating Utility Payment

Using the UtilityPayment resource, it is possible to create payments for utilities such as electricity bills, water bills, and energy bills.To use this resource, some parameters are required, such as Line or Brcode and description.You can also include the 'tags' parameter for future reconciliations and the 'scheduled' parameter to schedule the payment.

Python


import starkbank

payments = starkbank.utilitypayment.create([
    starkbank.UtilityPayment(
        line="83640000001 1 08740138007 0 61053026111 0 08067159411 9",
        description="Electricity for the Long Night"
    )
])

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',
            description: 'Electricity for the Long Night'
        }
    ]);

    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",
        "description" => "Electricity for the Long Night",
    ])
]);

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("description", "Electricity for the Long Night");
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',
            description: 'Electricity for the Long Night',
        )
    ]
)

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

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

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"
            },
        }, 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"
      }
    ]))
(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",
            "description": "Electricity for the Long Night",
        }
    ]
}'
  
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=[],
    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: [ ],
    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
        (
        )

    [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": [],
    "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: [],
    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: [],
    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: {},
    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:[] 
    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 [],
 :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": [],
            "transactionIds": [],
            "status": "created",
            "type": "utility",
            "updated": "2020-04-24T15:22:25.096450+00:00",
        }
    ]
}
  

Creating Tax Payment

Using the TaxPayment resource, it is possible to create payments for your taxes, such as ISS (Service Tax) and DAS (Simples Nacional Collection Document).To use this resource, some parameters are required, such as Line or Brcode and description.You can also include the 'tags' parameter for future reconciliations and the 'scheduled' parameter to schedule the payment.

Python


import starkbank

payments = starkbank.taxpayment.create([
    starkbank.TaxPayment(
        bar_code="81660000005003657010074119002551100010601813",
        description="fix the road"
    )
])

for payment in payments:
    print(payment)
  

Javascript


const starkbank = require('starkbank');

(async() => {
    let payments = await starkbank.taxPayment.create([
        {
            barCode: '81660000005003657010074119002551100010601813',
            scheduled: '2023-08-02'
        },
    ]);

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

PHP


use StarkBank\TaxPayment;

$payments = TaxPayment::create([
    new TaxPayment([
        "barCode" => "81660000005003657010074119002551100010601813",
        "description" => "fix the road"
    ])
]);

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

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

payments.each do |payment|
    puts payment
end
  

Elixir


payments = StarkBank.TaxPayment.create!(
    [
        %StarkBank.TaxPayment{
            bar_code: "81660000005003657010074119002551100010601813",
            description: "fix the road"
        }
    ]
) |> 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"
        )
    }
);

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"
            },
        }, 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"
            :description "fix the road"
        }
    ]
))

(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",
            "description": "fix the road"
        }
    ]
}'
  
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=[],
    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: [ ],
    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
        (
        )

    [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": [ ],
    "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: [],
    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: [],
    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: { },
    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:[] 
    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: [ ],
    :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": [],
            "transactionIds": [],
            "type": "iss",
            "updated": "2023-01-24T18:03:18.662638+00:00"
        }
    ]
}
  

Creating DarfPayment

Using the DarfPayment resource, it is possible to create payments for your DARFs (Federal Revenue Collection Document).To use this resource, some parameters are required:Description: Text to be displayed in your statement (min. 10 characters).RevenueCode: 4-digit tax code assigned by Federal Revenue.TaxId: Payer CPF (11 digits formatted or unformatted) or CNPJ (14 digits formatted or unformatted).Competence: Competence month of the service.NominalAmount: Amount due in cents without fee or interest.FineAmount: Fixed amount due in cents for fines.InterestAmount: Amount due in cents for interest.Due: Due date for payment.You can also include the 'referenceNumber' parameter, the number assigned to the region of the tax, the 'scheduled' parameter to schedule the payment, and 'tags' parameter for future reconciliations.

Python


import starkbank

payments = starkbank.darfpayment.create([
    starkbank.DarfPayment(
        revenue_code="1240",
        tax_id="12.345.678/0001-95",
        competence="2021-03-01",
        nominal_amount=1234,
        fine_amount=12,
        interest_amount=34,
        due=datetime(2021, 5, 12, 15, 23, 26, 689377),
        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",
            nominalAmount: 1234,
            fineAmount: 12,
            interestAmount: 34,
            due: "2021-05-12",
            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",
        "due" => "2021-05-12",
        "competence" => "2021-03-01",
        "fineAmount" => 12,
        "interestAmount" => 34,
        "nominalAmount" => 1234,
        "revenueCode" => "1240",
        "taxId" => "12.345.678/0001-95"
    ])
]);

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("due", "2021-05-12");
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",
        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",
            nominal_amount: 1234,
            fine_amount: 12,
            interest_amount: 34,
            due: "2021-03-12",
            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),
            nominalAmount: 1234,
            fineAmount: 12,
            interestAmount: 34,
            due: new DateTime(2021, 05, 12),
            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)

    payments, err := darfpayment.Create(
        []darfpayment.DarfPayment{
            {
                RevenueCode:     "1240",
                TaxId:           "12.345.678/0001-95",
                Competence:      "2021-03-01",
                NominalAmount:   1234,
                FineAmount:      12,
                InterestAmount:  34,
                Due:             &due,
                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",
            :nominal-amount 1234,
            :fine-amount 12,
            :interest-amount 34,
            :due "2021-05-12",
            :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",
            "competence": "2021-03-01",
            "due": "2021-05-12",
            "fineAmount": 12,
            "interestAmount": 34,
            "nominalAmount": 1234,
            "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,
    revenue_code=1240,
    scheduled=2021-03-012 15:00:00,
    status=created,
    tags=[],
    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',
    fineAmount: 12,
    interestAmount: 34,
    due: '2021-05-12T02:59:59.999999+00:00',
    description: 'take my money',
    tags: [],
    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
        (y
        )

    [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": "",
    "scheduled": "2021-03-12T16:17:20.291274+00:00",
    "tags": [],
    "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,
    fine_amount: 12,
    interest_amount: 34,
    due: 2021-05-12T02:59:59+00:00,
    description: take my money,
    tags: [],
    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: "",
    fine_amount: 12,
    interest_amount: 34,
    due: ~U[2021-05-12 02:59:59.999999Z],
    description: "take my money",
    tags: [],
    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,
    NominalAmount: 1234,
    Tags: { },
    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
    FineAmount:12
    InterestAmount:34
    Due:2021-05-12 11:16:31.994675 +0000 +0000 
    Description:take my money
    Tags:[]
    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: '',
    :fine-amount: 12,
    :interest-amount: 34,
    :due: '2021-05-12T02:59:59.999999+00:00',
    :description: 'take my money',
    :tags: [ ],
    :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": "",
            "revenueCode": "1240",
            "scheduled": "2021-03-12T15:00:00+00:00",
            "status": "created",
            "tags": [],
            "taxId": "12.345.678/0001-95",
            "transactionIds": [],
            "updated": "2021-02-20T16:51:04.528650+00:00"
        }
    ]
}
  

Creating BrCodePayment

Using the BrCodePayment resource, it is possible to create payments using Qrcodes.To utilize this resource, certain parameters are required, including Brcode, taxId, description, and amount.If the Brcode does not provide an amount, this parameter becomes mandatory; otherwise, it is optional.Additionally, you can include the 'tags' parameter for future reconciliations, the 'scheduled' parameter to schedule the paymentand the 'rules' parameter to modify BrCodePayment behavior, as illustrated in the example below:

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

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

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

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<>();

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

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

(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"
        }
    ]
}'
  
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=[],
    scheduled=2021-01-13 10:00:00,
    status=creating,
    tags=[],
    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: [ ],
    rules: [ ],
    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
        (
        )

    [rules] => Array
        (
        )

    [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": [],
    "rules": [],
    "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: [],
    rules: [],
    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: []
    status: "creating",
    tags: [],
    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: { },
    Scheduled: 13/01/2021 10:00:00,
    Name: null,
    TaxID: ***.345.678-**,
    Amount: 0,
    Rules: Rule()
    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:[]
    Tags:[] 
    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 [],
    :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": [],
            "scheduled": "2021-01-13T10:00:00.000000+00:00",
            "status": "creating",
            "tags": [],
            "taxId": "***.345.678-**",
            "transactionIds": [],
            "type": "dynamic",
            "updated": "2021-01-03T18:36:00.369028+00:00"
        }
    ]
}
  

Creating Payment Request

Using the PaymentRequest resource, it is possible to submit payments for approval.The requests are bound to their respective cost centers and represent requests to execute specific payments, which can be transfers, boleto payments, etc.To use this resource some parameters are required such as type, centerId and payment.You can also include the 'tags' parameter for future reconciliations and the 'due' parameter to set a due payment date

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

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

(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",
        ])
    ])
]);

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

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

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

(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"
            }
        }
    ]
}'
  
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=[],
    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: [],
    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
        (
        )

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