Card Issuing
Issue your own branded credit and pre-paid cards through Stark Infra.
Define your card product, create card holders, issue virtual or physical cards, control spending rules, authorize purchases in real time, manage embossing and shipping, support tokenization for digital wallets, settle invoices and reconcile every transaction.
This guide covers every resource you need to launch and operate a card program — from product configuration to spending and settlement.
NOTE: Read Core Concepts before continuing this guide.
Setup
For each environment (Sandbox and Production):
1. Create an account at Stark Bank.
2. Get in touch with your account manager to define your Issuing Product: pre-paid or credit card — the product determines network (Visa/Mastercard), default rules and BIN.
3. Inform the sub-issuer parameters to help@starkbank.com:
- authorizationUrl: HTTPS URL to receive synchronous Issuing Purchase authorizations from your cards. If empty, the following parameters will dictate your authorizations.
- defaultAuthorizationMaxAmount: Maximum amount in Reais (R$) that the default authorization system will approve in case your system does not respond correctly. Minimum is R$0,00.
- defaultAuthorizationMinScore: Minimum score that the default authorization will approve. The score ranges from 0 (worst) to 1 (best).
4. Create a Webhook resource subscribing to issuing-card, issuing-holder, issuing-purchase, issuing-invoice, issuing-embossing-request events.
5. Fund the issuing balance with an Issuing Invoice before issuing your first card.
Issuing Card Overview
An Issuing Card is a credit or pre-paid card you issue to an Issuing Holder.
Virtual vs. physical. A virtual card is created instantly with status "active" and can be used for online purchases right away. A physical card is created with status "pending": it must be embossed and shipped through an Issuing Embossing Request, and then activated (set its status to "active" together with a PIN) before it can be used.
Getting a productId. Every card must reference a productId — the card product, which sets its BIN range. A product defines the card's network (Visa/Mastercard), funding type (credit or pre-paid), holder type (business or individual) and tier (e.g.: Black, Platinum). See the Issuing Product section to learn more.
Spending controls. Pass a "rules" list when creating or updating a card (or its holder) to cap how much can be spent per interval and to restrict categories, countries or methods. Each rule tracks how much was already spent in the current interval (counterAmount). See the Issuing Rule section for the full rule object and how to set or change it.
Card Statuses
Each Issuing Card has a status that reflects where it is in its life cycle:

| Status | Description |
|---|---|
| pending | A physical card was created but is not usable yet. Activate it by setting its status to "active" together with a PIN. Virtual cards skip this status. |
| active | The card is active and can be used for purchases. |
| blocked | The card is temporarily blocked. You can unblock it by setting its status back to "active". |
| expired | The card has passed its expiration date and can no longer be used. |
| canceled | The card was permanently canceled. This is irreversible. |
Card Logs
Every time you or Stark Infra change an Issuing Card, we create a Log entry. Logs let you audit a card's full history — each status change, rule update and so on.
Query the card logs with GET /v2/issuing-card/log (filter by cardIds, types, after / before), or fetch a single one with GET /v2/issuing-card/log/:id. Check the API reference for the full list of log fields and types.
Creating a Card
Create one or more cards by sending a "cards" list. Each card needs holderName, holderTaxId, holderExternalId and a productId.
Holder resolution. The card's holder is identified by its holderExternalId. If no holder with that external id exists under your sub-issuer yet, one is created from the holderName and holderTaxId you send; if a holder with that external id already exists, the card is attached to it. In that case the holderName and holderTaxId must match the existing holder — otherwise the request is rejected.
Set "type" to "virtual" (the default — instantly active) or "physical" (created as "pending", needs embossing, shipment and activation).
Billing address. If you omit the address, the card inherits your sub-issuer's registered address by default. The address is all-or-nothing: send the complete address (streetLine1, streetLine2, district, city, stateCode, zipCode) or none — a partial address is rejected.
Parameters
Python
import starkinfra
cards = starkinfra.issuingcard.create([
starkinfra.IssuingCard(
holder_name="Tony Stark",
holder_tax_id="012.345.678-90",
holder_external_id="my-holder-id-1234",
product_id="654321",
type="physical",
display_name="TONY STARK",
tags=["department: tech", "team: backend"]
)
])
for card in cards:
print(card)
Javascript
const starkinfra = require('starkinfra');
(async() => {
let cards = await starkinfra.issuingCard.create([
new starkinfra.IssuingCard({
holderName: 'Tony Stark',
holderTaxId: '012.345.678-90',
holderExternalId: 'my-holder-id-1234',
productId: '654321',
type: 'physical',
displayName: 'TONY STARK',
tags: ['department: tech', 'team: backend']
})
]);
for (let card of cards) {
console.log(card);
}
})();
PHP
$cards = StarkInfra\IssuingCard::create([
new StarkInfra\IssuingCard([
"holderName" => "Tony Stark",
"holderTaxId" => "012.345.678-90",
"holderExternalId" => "my-holder-id-1234",
"productId" => "654321",
"type" => "physical",
"displayName" => "TONY STARK",
"tags" => ["department: tech", "team: backend"]
])
]);
foreach ($cards as $card) {
print_r($card);
}
Java
import com.starkinfra.*; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; Mapdata = new HashMap<>(); data.put("holderName", "Tony Stark"); data.put("holderTaxId", "012.345.678-90"); data.put("holderExternalId", "my-holder-id-1234"); data.put("productId", "654321"); data.put("type", "physical"); data.put("displayName", "TONY STARK"); data.put("tags", new String[]{"department: tech", "team: backend"}); List cards = IssuingCard.create(new ArrayList<>(List.of(new IssuingCard(data)))); for (IssuingCard card : cards) { System.out.println(card); }
Ruby
require('starkinfra')
cards = StarkInfra::IssuingCard.create([
StarkInfra::IssuingCard.new(
holder_name: "Tony Stark",
holder_tax_id: "012.345.678-90",
holder_external_id: "my-holder-id-1234",
product_id: "654321",
type: "physical",
display_name: "TONY STARK",
tags: ["department: tech", "team: backend"]
)
])
cards.each do |card|
puts card
end
Elixir
cards = StarkInfra.IssuingCard.create!([
%StarkInfra.IssuingCard{
holder_name: "Tony Stark",
holder_tax_id: "012.345.678-90",
holder_external_id: "my-holder-id-1234",
product_id: "654321",
type: "physical",
display_name: "TONY STARK",
tags: ["department: tech", "team: backend"]
}
])
cards |> Enum.each(&IO.inspect/1)
C#
using System; using System.Collections.Generic; Listcards = StarkInfra.IssuingCard.Create( new List { new StarkInfra.IssuingCard( holderName: "Tony Stark", holderTaxID: "012.345.678-90", holderExternalID: "my-holder-id-1234", productID: "654321", type: "physical", displayName: "TONY STARK", tags: new List { "department: tech", "team: backend" } ) } ); foreach (StarkInfra.IssuingCard card in cards) { Console.WriteLine(card); }
Go
package main
import (
"fmt"
"github.com/starkinfra/sdk-go/starkinfra/issuingcard"
)
func main() {
cards, err := issuingcard.Create(
[]issuingcard.IssuingCard{
{
HolderName: "Tony Stark",
HolderTaxId: "012.345.678-90",
HolderExternalId: "my-holder-id-1234",
ProductId: "654321",
Type: "physical",
DisplayName: "TONY STARK",
Tags: []string{"department: tech", "team: backend"},
},
},
nil,
nil,
)
if err.Errors != nil {
for _, e := range err.Errors {
fmt.Printf("code: %s, message: %s", e.Code, e.Message)
}
}
for _, card := range cards {
fmt.Printf("%+v", card)
}
}
Clojure
Not yet available. Please contact us if you need this SDK.
Curl
curl --location --request POST '{{baseUrl}}/v2/issuing-card' \
--header 'Access-Id: {{accessId}}' \
--header 'Access-Time: {{accessTime}}' \
--header 'Access-Signature: {{accessSignature}}' \
--header 'Content-Type: application/json' \
--data-raw '{
"cards": [
{
"holderName": "Tony Stark",
"holderTaxId": "012.345.678-90",
"holderExternalId": "my-holder-id-1234",
"productId": "654321",
"type": "physical",
"displayName": "TONY STARK",
"tags": ["department: tech", "team: backend"]
}
]
}'
Python
IssuingCard(
id=5715709195239424,
holder_id=5155165527080960,
holder_name=Tony Stark,
holder_tax_id=012.345.678-90,
holder_external_id=my-holder-id-1234,
display_name=TONY STARK,
product_id=654321,
type=physical,
status=pending,
rules=[],
street_line_1=Av. Faria Lima, 1844,
street_line_2=10 andar,
district=Itaim Bibi,
city=Sao Paulo,
state_code=SP,
zip_code=01311-000,
tags=['department: tech', 'team: backend'],
number=**** **** **** 1234,
security_code=***,
expiration=****-**-**T**:**:**.******+00:00,
created=2022-01-01 00:00:00,
updated=2022-01-01 00:00:00
)
Javascript
IssuingCard {
id: '5715709195239424',
holderId: '5155165527080960',
holderName: 'Tony Stark',
holderTaxId: '012.345.678-90',
holderExternalId: 'my-holder-id-1234',
displayName: 'TONY STARK',
productId: '654321',
type: 'physical',
status: 'pending',
rules: [],
streetLine1: 'Av. Faria Lima, 1844',
streetLine2: '10 andar',
district: 'Itaim Bibi',
city: 'Sao Paulo',
stateCode: 'SP',
zipCode: '01311-000',
tags: [ 'department: tech', 'team: backend' ],
number: '**** **** **** 1234',
securityCode: '***',
expiration: '****-**-**T**:**:**.******+00:00',
created: '2022-01-01T00:00:00.000000+00:00',
updated: '2022-01-01T00:00:00.000000+00:00'
}
PHP
StarkInfra\IssuingCard Object
(
[id] => 5715709195239424
[productId] => 654321
[holderId] => 5155165527080960
[holderName] => Tony Stark
[holderTaxId] => 012.345.678-90
[holderExternalId] => my-holder-id-1234
[type] => physical
[displayName] => TONY STARK
[status] => pending
[rules] => Array ( )
[streetLine1] => Av. Faria Lima, 1844
[streetLine2] => 10 andar
[district] => Itaim Bibi
[city] => Sao Paulo
[stateCode] => SP
[zipCode] => 01311-000
[tags] => Array ( [0] => department: tech [1] => team: backend )
[created] => DateTime Object ( [date] => 2022-01-01 00:00:00.000000 )
[updated] => DateTime Object ( [date] => 2022-01-01 00:00:00.000000 )
[number] => **** **** **** 1234
[securityCode] => ***
[expiration] => ****-**-**T**:**:**.******+00:00
)
Java
IssuingCard({
"id": "5715709195239424",
"productId": "654321",
"holderId": "5155165527080960",
"holderName": "Tony Stark",
"holderTaxId": "012.345.678-90",
"holderExternalId": "my-holder-id-1234",
"type": "physical",
"displayName": "TONY STARK",
"status": "pending",
"rules": [],
"streetLine1": "Av. Faria Lima, 1844",
"streetLine2": "10 andar",
"district": "Itaim Bibi",
"city": "Sao Paulo",
"stateCode": "SP",
"zipCode": "01311-000",
"tags": ["department: tech", "team: backend"],
"created": "2022-01-01T00:00:00.000000+00:00",
"updated": "2022-01-01T00:00:00.000000+00:00",
"number": "**** **** **** 1234",
"securityCode": "***",
"expiration": "****-**-**T**:**:**.******+00:00"
})
Ruby
issuingcard(
id: 5715709195239424,
product_id: 654321,
holder_id: 5155165527080960,
holder_name: Tony Stark,
holder_tax_id: 012.345.678-90,
holder_external_id: my-holder-id-1234,
type: physical,
display_name: TONY STARK,
status: pending,
rules: [],
street_line_1: Av. Faria Lima, 1844,
street_line_2: 10 andar,
district: Itaim Bibi,
city: Sao Paulo,
state_code: SP,
zip_code: 01311-000,
tags: ["department: tech", "team: backend"],
created: 2022-01-01T00:00:00+00:00,
updated: 2022-01-01T00:00:00+00:00,
number: **** **** **** 1234,
security_code: ***,
expiration: ****-**-**T**:**:**.******+00:00
)
Elixir
%StarkInfra.IssuingCard{
id: "5715709195239424",
product_id: "654321",
holder_id: "5155165527080960",
holder_name: "Tony Stark",
holder_tax_id: "012.345.678-90",
holder_external_id: "my-holder-id-1234",
type: "physical",
display_name: "TONY STARK",
status: "pending",
rules: [],
street_line_1: "Av. Faria Lima, 1844",
street_line_2: "10 andar",
district: "Itaim Bibi",
city: "Sao Paulo",
state_code: "SP",
zip_code: "01311-000",
tags: ["department: tech", "team: backend"],
created: "2022-01-01T00:00:00.000000+00:00",
updated: "2022-01-01T00:00:00.000000+00:00",
number: "**** **** **** 1234",
security_code: "***",
expiration: "****-**-**T**:**:**.******+00:00"
}
C#
IssuingCard(
Id: 5715709195239424,
ProductId: 654321,
HolderId: 5155165527080960,
HolderName: Tony Stark,
HolderTaxId: 012.345.678-90,
HolderExternalId: my-holder-id-1234,
Type: physical,
DisplayName: TONY STARK,
Status: pending,
Rules: [],
StreetLine1: Av. Faria Lima, 1844,
StreetLine2: 10 andar,
District: Itaim Bibi,
City: Sao Paulo,
StateCode: SP,
ZipCode: 01311-000,
Tags: [department: tech, team: backend],
Created: 01/01/2022 00:00:00,
Updated: 01/01/2022 00:00:00,
Number: **** **** **** 1234,
SecurityCode: ***,
Expiration: ****-**-**T**:**:**.******+00:00
)
Go
{
HolderName:Tony Stark
HolderTaxId:012.345.678-90
HolderExternalId:my-holder-id-1234
DisplayName:TONY STARK
Rules:[]
ProductId:654321
Tags:[department: tech team: backend]
StreetLine1:Av. Faria Lima, 1844
StreetLine2:10 andar
District:Itaim Bibi
City:Sao Paulo
StateCode:SP
ZipCode:01311-000
Id:5715709195239424
HolderId:5155165527080960
Type:physical
Status:pending
Number:**** **** **** 1234
SecurityCode:***
Expiration:****-**-**T**:**:**.******+00:00
Updated:2022-01-01 00:00:00 +0000 +0000
Created:2022-01-01 00:00:00 +0000 +0000
}
Clojure
Not yet available. Please contact us if you need this SDK.
Curl
{
"message": "Card(s) successfully created.",
"cards": [
{
"id": "5715709195239424",
"productId": "654321",
"holderId": "5155165527080960",
"holderName": "Tony Stark",
"holderTaxId": "012.345.678-90",
"holderExternalId": "my-holder-id-1234",
"type": "physical",
"displayName": "TONY STARK",
"status": "pending",
"rules": [],
"streetLine1": "Av. Faria Lima, 1844",
"streetLine2": "10 andar",
"district": "Itaim Bibi",
"city": "Sao Paulo",
"stateCode": "SP",
"zipCode": "01311-000",
"tags": ["department: tech", "team: backend"],
"created": "2022-01-01T00:00:00.000000+00:00",
"updated": "2022-01-01T00:00:00.000000+00:00",
"number": "**** **** **** 1234",
"securityCode": "***",
"expiration": "****-**-**T**:**:**.******+00:00"
}
]
}
Unblocking (activating) a physical card
A physical card is created as "pending". To activate it, set its status to "active" together with a "pin" (a numeric string, 4 to 6 digits) — its first activation always requires a PIN.
NOTE: To unblock a card that was merely blocked (and had already been activated before), you can send "status": "active" on its own, without a PIN.
Parameters
Python
import starkinfra
card = starkinfra.issuingcard.update(
id="5715709195239424",
status="active",
pin="1234"
)
print(card)
Javascript
const starkinfra = require('starkinfra');
(async() => {
let card = await starkinfra.issuingCard.update('5715709195239424', {
status: 'active',
pin: '1234'
});
console.log(card);
})();
PHP
$card = StarkInfra\IssuingCard::update("5715709195239424", [
"status" => "active",
"pin" => "1234"
]);
print_r($card);
Java
import com.starkinfra.*; import java.util.HashMap; HashMappatchData = new HashMap<>(); patchData.put("status", "active"); patchData.put("pin", "1234"); IssuingCard card = IssuingCard.update("5715709195239424", patchData); System.out.println(card);
Ruby
require('starkinfra')
card = StarkInfra::IssuingCard.update(
"5715709195239424",
status: "active",
pin: "1234"
)
puts card
Elixir
card = StarkInfra.IssuingCard.update!(
"5715709195239424",
status: "active",
pin: "1234"
)
IO.inspect(card)
C#
using System;
StarkInfra.IssuingCard card = StarkInfra.IssuingCard.Update(
"5715709195239424",
status: "active",
pin: "1234"
);
Console.WriteLine(card);
Go
package main
import (
"fmt"
"github.com/starkinfra/sdk-go/starkinfra/issuingcard"
)
func main() {
card, err := issuingcard.Update(
"5715709195239424",
map[string]interface{}{
"status": "active",
"pin": "1234",
},
nil,
)
if err.Errors != nil {
for _, e := range err.Errors {
fmt.Printf("code: %s, message: %s", e.Code, e.Message)
}
}
fmt.Printf("%+v", card)
}
Clojure
Not yet available. Please contact us if you need this SDK.
Curl
curl --location --request PATCH '{{baseUrl}}/v2/issuing-card/5715709195239424' \
--header 'Access-Id: {{accessId}}' \
--header 'Access-Time: {{accessTime}}' \
--header 'Access-Signature: {{accessSignature}}' \
--header 'Content-Type: application/json' \
--data-raw '{
"status": "active",
"pin": "1234"
}'
Python
IssuingCard(
id=5715709195239424,
holder_id=5155165527080960,
holder_name=Tony Stark,
holder_tax_id=012.345.678-90,
holder_external_id=my-holder-id-1234,
display_name=TONY STARK,
product_id=654321,
type=physical,
status=active,
rules=[],
street_line_1=Av. Faria Lima, 1844,
street_line_2=10 andar,
district=Itaim Bibi,
city=Sao Paulo,
state_code=SP,
zip_code=01311-000,
tags=['department: tech', 'team: backend'],
number=**** **** **** 1234,
security_code=***,
expiration=****-**-**T**:**:**.******+00:00,
created=2022-01-01 00:00:00,
updated=2022-06-01 00:00:00
)
Javascript
IssuingCard {
id: '5715709195239424',
holderId: '5155165527080960',
holderName: 'Tony Stark',
holderTaxId: '012.345.678-90',
holderExternalId: 'my-holder-id-1234',
displayName: 'TONY STARK',
productId: '654321',
type: 'physical',
status: 'active',
rules: [],
streetLine1: 'Av. Faria Lima, 1844',
streetLine2: '10 andar',
district: 'Itaim Bibi',
city: 'Sao Paulo',
stateCode: 'SP',
zipCode: '01311-000',
tags: [ 'department: tech', 'team: backend' ],
number: '**** **** **** 1234',
securityCode: '***',
expiration: '****-**-**T**:**:**.******+00:00',
created: '2022-01-01T00:00:00.000000+00:00',
updated: '2022-06-01T00:00:00.000000+00:00'
}
PHP
StarkInfra\IssuingCard Object
(
[id] => 5715709195239424
[productId] => 654321
[holderId] => 5155165527080960
[holderName] => Tony Stark
[holderTaxId] => 012.345.678-90
[holderExternalId] => my-holder-id-1234
[type] => physical
[displayName] => TONY STARK
[status] => active
[rules] => Array ( )
[streetLine1] => Av. Faria Lima, 1844
[streetLine2] => 10 andar
[district] => Itaim Bibi
[city] => Sao Paulo
[stateCode] => SP
[zipCode] => 01311-000
[tags] => Array ( [0] => department: tech [1] => team: backend )
[created] => DateTime Object ( [date] => 2022-01-01 00:00:00.000000 )
[updated] => DateTime Object ( [date] => 2022-06-01 00:00:00.000000 )
[number] => **** **** **** 1234
[securityCode] => ***
[expiration] => ****-**-**T**:**:**.******+00:00
)
Java
IssuingCard({
"id": "5715709195239424",
"productId": "654321",
"holderId": "5155165527080960",
"holderName": "Tony Stark",
"holderTaxId": "012.345.678-90",
"holderExternalId": "my-holder-id-1234",
"type": "physical",
"displayName": "TONY STARK",
"status": "active",
"rules": [],
"streetLine1": "Av. Faria Lima, 1844",
"streetLine2": "10 andar",
"district": "Itaim Bibi",
"city": "Sao Paulo",
"stateCode": "SP",
"zipCode": "01311-000",
"tags": ["department: tech", "team: backend"],
"created": "2022-01-01T00:00:00.000000+00:00",
"updated": "2022-06-01T00:00:00.000000+00:00",
"number": "**** **** **** 1234",
"securityCode": "***",
"expiration": "****-**-**T**:**:**.******+00:00"
})
Ruby
issuingcard(
id: 5715709195239424,
product_id: 654321,
holder_id: 5155165527080960,
holder_name: Tony Stark,
holder_tax_id: 012.345.678-90,
holder_external_id: my-holder-id-1234,
type: physical,
display_name: TONY STARK,
status: active,
rules: [],
street_line_1: Av. Faria Lima, 1844,
street_line_2: 10 andar,
district: Itaim Bibi,
city: Sao Paulo,
state_code: SP,
zip_code: 01311-000,
tags: ["department: tech", "team: backend"],
created: 2022-01-01T00:00:00+00:00,
updated: 2022-06-01T00:00:00+00:00,
number: **** **** **** 1234,
security_code: ***,
expiration: ****-**-**T**:**:**.******+00:00
)
Elixir
%StarkInfra.IssuingCard{
id: "5715709195239424",
product_id: "654321",
holder_id: "5155165527080960",
holder_name: "Tony Stark",
holder_tax_id: "012.345.678-90",
holder_external_id: "my-holder-id-1234",
type: "physical",
display_name: "TONY STARK",
status: "active",
rules: [],
street_line_1: "Av. Faria Lima, 1844",
street_line_2: "10 andar",
district: "Itaim Bibi",
city: "Sao Paulo",
state_code: "SP",
zip_code: "01311-000",
tags: ["department: tech", "team: backend"],
created: "2022-01-01T00:00:00.000000+00:00",
updated: "2022-06-01T00:00:00.000000+00:00",
number: "**** **** **** 1234",
security_code: "***",
expiration: "****-**-**T**:**:**.******+00:00"
}
C#
IssuingCard(
Id: 5715709195239424,
ProductId: 654321,
HolderId: 5155165527080960,
HolderName: Tony Stark,
HolderTaxId: 012.345.678-90,
HolderExternalId: my-holder-id-1234,
Type: physical,
DisplayName: TONY STARK,
Status: active,
Rules: [],
StreetLine1: Av. Faria Lima, 1844,
StreetLine2: 10 andar,
District: Itaim Bibi,
City: Sao Paulo,
StateCode: SP,
ZipCode: 01311-000,
Tags: [department: tech, team: backend],
Created: 01/01/2022 00:00:00,
Updated: 06/01/2022 00:00:00,
Number: **** **** **** 1234,
SecurityCode: ***,
Expiration: ****-**-**T**:**:**.******+00:00
)
Go
{
HolderName:Tony Stark
HolderTaxId:012.345.678-90
HolderExternalId:my-holder-id-1234
DisplayName:TONY STARK
Rules:[]
ProductId:654321
Tags:[department: tech team: backend]
StreetLine1:Av. Faria Lima, 1844
StreetLine2:10 andar
District:Itaim Bibi
City:Sao Paulo
StateCode:SP
ZipCode:01311-000
Id:5715709195239424
HolderId:5155165527080960
Type:physical
Status:active
Number:**** **** **** 1234
SecurityCode:***
Expiration:****-**-**T**:**:**.******+00:00
Updated:2022-06-01 00:00:00 +0000 +0000
Created:2022-01-01 00:00:00 +0000 +0000
}
Clojure
Not yet available. Please contact us if you need this SDK.
Curl
{
"card": {
"id": "5715709195239424",
"productId": "654321",
"holderId": "5155165527080960",
"holderName": "Tony Stark",
"holderTaxId": "012.345.678-90",
"holderExternalId": "my-holder-id-1234",
"type": "physical",
"displayName": "TONY STARK",
"status": "active",
"rules": [],
"streetLine1": "Av. Faria Lima, 1844",
"streetLine2": "10 andar",
"district": "Itaim Bibi",
"city": "Sao Paulo",
"stateCode": "SP",
"zipCode": "01311-000",
"tags": ["department: tech", "team: backend"],
"created": "2022-01-01T00:00:00.000000+00:00",
"updated": "2022-06-01T00:00:00.000000+00:00",
"number": "**** **** **** 1234",
"securityCode": "***",
"expiration": "****-**-**T**:**:**.******+00:00"
}
}
Blocking a card
Temporarily block a card by setting its status to "blocked". A blocked card declines purchases until you unblock it.
Parameters
Python
import starkinfra
card = starkinfra.issuingcard.update(
id="5715709195239424",
status="blocked"
)
print(card)
Javascript
const starkinfra = require('starkinfra');
(async() => {
let card = await starkinfra.issuingCard.update('5715709195239424', {
status: 'blocked'
});
console.log(card);
})();
PHP
$card = StarkInfra\IssuingCard::update("5715709195239424", [
"status" => "blocked"
]);
print_r($card);
Java
import com.starkinfra.*; import java.util.HashMap; HashMappatchData = new HashMap<>(); patchData.put("status", "blocked"); IssuingCard card = IssuingCard.update("5715709195239424", patchData); System.out.println(card);
Ruby
require('starkinfra')
card = StarkInfra::IssuingCard.update(
"5715709195239424",
status: "blocked"
)
puts card
Elixir
card = StarkInfra.IssuingCard.update!(
"5715709195239424",
status: "blocked"
)
IO.inspect(card)
C#
using System;
StarkInfra.IssuingCard card = StarkInfra.IssuingCard.Update(
"5715709195239424",
status: "blocked"
);
Console.WriteLine(card);
Go
package main
import (
"fmt"
"github.com/starkinfra/sdk-go/starkinfra/issuingcard"
)
func main() {
card, err := issuingcard.Update(
"5715709195239424",
map[string]interface{}{
"status": "blocked",
},
nil,
)
if err.Errors != nil {
for _, e := range err.Errors {
fmt.Printf("code: %s, message: %s", e.Code, e.Message)
}
}
fmt.Printf("%+v", card)
}
Clojure
Not yet available. Please contact us if you need this SDK.
Curl
curl --location --request PATCH '{{baseUrl}}/v2/issuing-card/5715709195239424' \
--header 'Access-Id: {{accessId}}' \
--header 'Access-Time: {{accessTime}}' \
--header 'Access-Signature: {{accessSignature}}' \
--header 'Content-Type: application/json' \
--data-raw '{
"status": "blocked"
}'
Python
IssuingCard(
id=5715709195239424,
holder_id=5155165527080960,
holder_name=Tony Stark,
holder_tax_id=012.345.678-90,
holder_external_id=my-holder-id-1234,
display_name=TONY STARK,
product_id=654321,
type=physical,
status=blocked,
rules=[],
street_line_1=Av. Faria Lima, 1844,
street_line_2=10 andar,
district=Itaim Bibi,
city=Sao Paulo,
state_code=SP,
zip_code=01311-000,
tags=['department: tech', 'team: backend'],
number=**** **** **** 1234,
security_code=***,
expiration=****-**-**T**:**:**.******+00:00,
created=2022-01-01 00:00:00,
updated=2022-06-01 00:00:00
)
Javascript
IssuingCard {
id: '5715709195239424',
holderId: '5155165527080960',
holderName: 'Tony Stark',
holderTaxId: '012.345.678-90',
holderExternalId: 'my-holder-id-1234',
displayName: 'TONY STARK',
productId: '654321',
type: 'physical',
status: 'blocked',
rules: [],
streetLine1: 'Av. Faria Lima, 1844',
streetLine2: '10 andar',
district: 'Itaim Bibi',
city: 'Sao Paulo',
stateCode: 'SP',
zipCode: '01311-000',
tags: [ 'department: tech', 'team: backend' ],
number: '**** **** **** 1234',
securityCode: '***',
expiration: '****-**-**T**:**:**.******+00:00',
created: '2022-01-01T00:00:00.000000+00:00',
updated: '2022-06-01T00:00:00.000000+00:00'
}
PHP
StarkInfra\IssuingCard Object
(
[id] => 5715709195239424
[productId] => 654321
[holderId] => 5155165527080960
[holderName] => Tony Stark
[holderTaxId] => 012.345.678-90
[holderExternalId] => my-holder-id-1234
[type] => physical
[displayName] => TONY STARK
[status] => blocked
[rules] => Array ( )
[streetLine1] => Av. Faria Lima, 1844
[streetLine2] => 10 andar
[district] => Itaim Bibi
[city] => Sao Paulo
[stateCode] => SP
[zipCode] => 01311-000
[tags] => Array ( [0] => department: tech [1] => team: backend )
[created] => DateTime Object ( [date] => 2022-01-01 00:00:00.000000 )
[updated] => DateTime Object ( [date] => 2022-06-01 00:00:00.000000 )
[number] => **** **** **** 1234
[securityCode] => ***
[expiration] => ****-**-**T**:**:**.******+00:00
)
Java
IssuingCard({
"id": "5715709195239424",
"productId": "654321",
"holderId": "5155165527080960",
"holderName": "Tony Stark",
"holderTaxId": "012.345.678-90",
"holderExternalId": "my-holder-id-1234",
"type": "physical",
"displayName": "TONY STARK",
"status": "blocked",
"rules": [],
"streetLine1": "Av. Faria Lima, 1844",
"streetLine2": "10 andar",
"district": "Itaim Bibi",
"city": "Sao Paulo",
"stateCode": "SP",
"zipCode": "01311-000",
"tags": ["department: tech", "team: backend"],
"created": "2022-01-01T00:00:00.000000+00:00",
"updated": "2022-06-01T00:00:00.000000+00:00",
"number": "**** **** **** 1234",
"securityCode": "***",
"expiration": "****-**-**T**:**:**.******+00:00"
})
Ruby
issuingcard(
id: 5715709195239424,
product_id: 654321,
holder_id: 5155165527080960,
holder_name: Tony Stark,
holder_tax_id: 012.345.678-90,
holder_external_id: my-holder-id-1234,
type: physical,
display_name: TONY STARK,
status: blocked,
rules: [],
street_line_1: Av. Faria Lima, 1844,
street_line_2: 10 andar,
district: Itaim Bibi,
city: Sao Paulo,
state_code: SP,
zip_code: 01311-000,
tags: ["department: tech", "team: backend"],
created: 2022-01-01T00:00:00+00:00,
updated: 2022-06-01T00:00:00+00:00,
number: **** **** **** 1234,
security_code: ***,
expiration: ****-**-**T**:**:**.******+00:00
)
Elixir
%StarkInfra.IssuingCard{
id: "5715709195239424",
product_id: "654321",
holder_id: "5155165527080960",
holder_name: "Tony Stark",
holder_tax_id: "012.345.678-90",
holder_external_id: "my-holder-id-1234",
type: "physical",
display_name: "TONY STARK",
status: "blocked",
rules: [],
street_line_1: "Av. Faria Lima, 1844",
street_line_2: "10 andar",
district: "Itaim Bibi",
city: "Sao Paulo",
state_code: "SP",
zip_code: "01311-000",
tags: ["department: tech", "team: backend"],
created: "2022-01-01T00:00:00.000000+00:00",
updated: "2022-06-01T00:00:00.000000+00:00",
number: "**** **** **** 1234",
security_code: "***",
expiration: "****-**-**T**:**:**.******+00:00"
}
C#
IssuingCard(
Id: 5715709195239424,
ProductId: 654321,
HolderId: 5155165527080960,
HolderName: Tony Stark,
HolderTaxId: 012.345.678-90,
HolderExternalId: my-holder-id-1234,
Type: physical,
DisplayName: TONY STARK,
Status: blocked,
Rules: [],
StreetLine1: Av. Faria Lima, 1844,
StreetLine2: 10 andar,
District: Itaim Bibi,
City: Sao Paulo,
StateCode: SP,
ZipCode: 01311-000,
Tags: [department: tech, team: backend],
Created: 01/01/2022 00:00:00,
Updated: 06/01/2022 00:00:00,
Number: **** **** **** 1234,
SecurityCode: ***,
Expiration: ****-**-**T**:**:**.******+00:00
)
Go
{
HolderName:Tony Stark
HolderTaxId:012.345.678-90
HolderExternalId:my-holder-id-1234
DisplayName:TONY STARK
Rules:[]
ProductId:654321
Tags:[department: tech team: backend]
StreetLine1:Av. Faria Lima, 1844
StreetLine2:10 andar
District:Itaim Bibi
City:Sao Paulo
StateCode:SP
ZipCode:01311-000
Id:5715709195239424
HolderId:5155165527080960
Type:physical
Status:blocked
Number:**** **** **** 1234
SecurityCode:***
Expiration:****-**-**T**:**:**.******+00:00
Updated:2022-06-01 00:00:00 +0000 +0000
Created:2022-01-01 00:00:00 +0000 +0000
}
Clojure
Not yet available. Please contact us if you need this SDK.
Curl
{
"card": {
"id": "5715709195239424",
"productId": "654321",
"holderId": "5155165527080960",
"holderName": "Tony Stark",
"holderTaxId": "012.345.678-90",
"holderExternalId": "my-holder-id-1234",
"type": "physical",
"displayName": "TONY STARK",
"status": "blocked",
"rules": [],
"streetLine1": "Av. Faria Lima, 1844",
"streetLine2": "10 andar",
"district": "Itaim Bibi",
"city": "Sao Paulo",
"stateCode": "SP",
"zipCode": "01311-000",
"tags": ["department: tech", "team: backend"],
"created": "2022-01-01T00:00:00.000000+00:00",
"updated": "2022-06-01T00:00:00.000000+00:00",
"number": "**** **** **** 1234",
"securityCode": "***",
"expiration": "****-**-**T**:**:**.******+00:00"
}
}
Updating the Card PIN
Set or change a card's PIN by sending "pin" (a numeric string, 4 to 6 digits) on update.
The PIN is write-only and is never returned — inform "expand=isPinDefined" when fetching the card to check whether a PIN is set.
Parameters
Python
import starkinfra
card = starkinfra.issuingcard.update(
id="5715709195239424",
pin="5678"
)
print(card)
Javascript
const starkinfra = require('starkinfra');
(async() => {
let card = await starkinfra.issuingCard.update('5715709195239424', {
pin: '5678'
});
console.log(card);
})();
PHP
$card = StarkInfra\IssuingCard::update("5715709195239424", [
"pin" => "5678"
]);
print_r($card);
Java
import com.starkinfra.*; import java.util.HashMap; HashMappatchData = new HashMap<>(); patchData.put("pin", "5678"); IssuingCard card = IssuingCard.update("5715709195239424", patchData); System.out.println(card);
Ruby
require('starkinfra')
card = StarkInfra::IssuingCard.update(
"5715709195239424",
pin: "5678"
)
puts card
Elixir
card = StarkInfra.IssuingCard.update!(
"5715709195239424",
pin: "5678"
)
IO.inspect(card)
C#
using System;
StarkInfra.IssuingCard card = StarkInfra.IssuingCard.Update(
"5715709195239424",
pin: "5678"
);
Console.WriteLine(card);
Go
package main
import (
"fmt"
"github.com/starkinfra/sdk-go/starkinfra/issuingcard"
)
func main() {
card, err := issuingcard.Update(
"5715709195239424",
map[string]interface{}{
"pin": "5678",
},
nil,
)
if err.Errors != nil {
for _, e := range err.Errors {
fmt.Printf("code: %s, message: %s", e.Code, e.Message)
}
}
fmt.Printf("%+v", card)
}
Clojure
Not yet available. Please contact us if you need this SDK.
Curl
curl --location --request PATCH '{{baseUrl}}/v2/issuing-card/5715709195239424' \
--header 'Access-Id: {{accessId}}' \
--header 'Access-Time: {{accessTime}}' \
--header 'Access-Signature: {{accessSignature}}' \
--header 'Content-Type: application/json' \
--data-raw '{
"pin": "5678"
}'
Python
IssuingCard(
id=5715709195239424,
holder_id=5155165527080960,
holder_name=Tony Stark,
holder_tax_id=012.345.678-90,
holder_external_id=my-holder-id-1234,
display_name=TONY STARK,
product_id=654321,
type=physical,
status=active,
rules=[],
street_line_1=Av. Faria Lima, 1844,
street_line_2=10 andar,
district=Itaim Bibi,
city=Sao Paulo,
state_code=SP,
zip_code=01311-000,
tags=['department: tech', 'team: backend'],
number=**** **** **** 1234,
security_code=***,
expiration=****-**-**T**:**:**.******+00:00,
created=2022-01-01 00:00:00,
updated=2022-06-01 00:00:00
)
Javascript
IssuingCard {
id: '5715709195239424',
holderId: '5155165527080960',
holderName: 'Tony Stark',
holderTaxId: '012.345.678-90',
holderExternalId: 'my-holder-id-1234',
displayName: 'TONY STARK',
productId: '654321',
type: 'physical',
status: 'active',
rules: [],
streetLine1: 'Av. Faria Lima, 1844',
streetLine2: '10 andar',
district: 'Itaim Bibi',
city: 'Sao Paulo',
stateCode: 'SP',
zipCode: '01311-000',
tags: [ 'department: tech', 'team: backend' ],
number: '**** **** **** 1234',
securityCode: '***',
expiration: '****-**-**T**:**:**.******+00:00',
created: '2022-01-01T00:00:00.000000+00:00',
updated: '2022-06-01T00:00:00.000000+00:00'
}
PHP
StarkInfra\IssuingCard Object
(
[id] => 5715709195239424
[productId] => 654321
[holderId] => 5155165527080960
[holderName] => Tony Stark
[holderTaxId] => 012.345.678-90
[holderExternalId] => my-holder-id-1234
[type] => physical
[displayName] => TONY STARK
[status] => active
[rules] => Array ( )
[streetLine1] => Av. Faria Lima, 1844
[streetLine2] => 10 andar
[district] => Itaim Bibi
[city] => Sao Paulo
[stateCode] => SP
[zipCode] => 01311-000
[tags] => Array ( [0] => department: tech [1] => team: backend )
[created] => DateTime Object ( [date] => 2022-01-01 00:00:00.000000 )
[updated] => DateTime Object ( [date] => 2022-06-01 00:00:00.000000 )
[number] => **** **** **** 1234
[securityCode] => ***
[expiration] => ****-**-**T**:**:**.******+00:00
)
Java
IssuingCard({
"id": "5715709195239424",
"productId": "654321",
"holderId": "5155165527080960",
"holderName": "Tony Stark",
"holderTaxId": "012.345.678-90",
"holderExternalId": "my-holder-id-1234",
"type": "physical",
"displayName": "TONY STARK",
"status": "active",
"rules": [],
"streetLine1": "Av. Faria Lima, 1844",
"streetLine2": "10 andar",
"district": "Itaim Bibi",
"city": "Sao Paulo",
"stateCode": "SP",
"zipCode": "01311-000",
"tags": ["department: tech", "team: backend"],
"created": "2022-01-01T00:00:00.000000+00:00",
"updated": "2022-06-01T00:00:00.000000+00:00",
"number": "**** **** **** 1234",
"securityCode": "***",
"expiration": "****-**-**T**:**:**.******+00:00"
})
Ruby
issuingcard(
id: 5715709195239424,
product_id: 654321,
holder_id: 5155165527080960,
holder_name: Tony Stark,
holder_tax_id: 012.345.678-90,
holder_external_id: my-holder-id-1234,
type: physical,
display_name: TONY STARK,
status: active,
rules: [],
street_line_1: Av. Faria Lima, 1844,
street_line_2: 10 andar,
district: Itaim Bibi,
city: Sao Paulo,
state_code: SP,
zip_code: 01311-000,
tags: ["department: tech", "team: backend"],
created: 2022-01-01T00:00:00+00:00,
updated: 2022-06-01T00:00:00+00:00,
number: **** **** **** 1234,
security_code: ***,
expiration: ****-**-**T**:**:**.******+00:00
)
Elixir
%StarkInfra.IssuingCard{
id: "5715709195239424",
product_id: "654321",
holder_id: "5155165527080960",
holder_name: "Tony Stark",
holder_tax_id: "012.345.678-90",
holder_external_id: "my-holder-id-1234",
type: "physical",
display_name: "TONY STARK",
status: "active",
rules: [],
street_line_1: "Av. Faria Lima, 1844",
street_line_2: "10 andar",
district: "Itaim Bibi",
city: "Sao Paulo",
state_code: "SP",
zip_code: "01311-000",
tags: ["department: tech", "team: backend"],
created: "2022-01-01T00:00:00.000000+00:00",
updated: "2022-06-01T00:00:00.000000+00:00",
number: "**** **** **** 1234",
security_code: "***",
expiration: "****-**-**T**:**:**.******+00:00"
}
C#
IssuingCard(
Id: 5715709195239424,
ProductId: 654321,
HolderId: 5155165527080960,
HolderName: Tony Stark,
HolderTaxId: 012.345.678-90,
HolderExternalId: my-holder-id-1234,
Type: physical,
DisplayName: TONY STARK,
Status: active,
Rules: [],
StreetLine1: Av. Faria Lima, 1844,
StreetLine2: 10 andar,
District: Itaim Bibi,
City: Sao Paulo,
StateCode: SP,
ZipCode: 01311-000,
Tags: [department: tech, team: backend],
Created: 01/01/2022 00:00:00,
Updated: 06/01/2022 00:00:00,
Number: **** **** **** 1234,
SecurityCode: ***,
Expiration: ****-**-**T**:**:**.******+00:00
)
Go
{
HolderName:Tony Stark
HolderTaxId:012.345.678-90
HolderExternalId:my-holder-id-1234
DisplayName:TONY STARK
Rules:[]
ProductId:654321
Tags:[department: tech team: backend]
StreetLine1:Av. Faria Lima, 1844
StreetLine2:10 andar
District:Itaim Bibi
City:Sao Paulo
StateCode:SP
ZipCode:01311-000
Id:5715709195239424
HolderId:5155165527080960
Type:physical
Status:active
Number:**** **** **** 1234
SecurityCode:***
Expiration:****-**-**T**:**:**.******+00:00
Updated:2022-06-01 00:00:00 +0000 +0000
Created:2022-01-01 00:00:00 +0000 +0000
}
Clojure
Not yet available. Please contact us if you need this SDK.
Curl
{
"card": {
"id": "5715709195239424",
"productId": "654321",
"holderId": "5155165527080960",
"holderName": "Tony Stark",
"holderTaxId": "012.345.678-90",
"holderExternalId": "my-holder-id-1234",
"type": "physical",
"displayName": "TONY STARK",
"status": "active",
"rules": [],
"streetLine1": "Av. Faria Lima, 1844",
"streetLine2": "10 andar",
"district": "Itaim Bibi",
"city": "Sao Paulo",
"stateCode": "SP",
"zipCode": "01311-000",
"tags": ["department: tech", "team: backend"],
"created": "2022-01-01T00:00:00.000000+00:00",
"updated": "2022-06-01T00:00:00.000000+00:00",
"number": "**** **** **** 1234",
"securityCode": "***",
"expiration": "****-**-**T**:**:**.******+00:00"
}
}
Canceling a card
Permanently cancel a card by its id. The card's status becomes "canceled". This action is irreversible.
Parameters
Python
import starkinfra
card = starkinfra.issuingcard.cancel("5715709195239424")
print(card)
Javascript
const starkinfra = require('starkinfra');
(async() => {
let card = await starkinfra.issuingCard.cancel('5715709195239424');
console.log(card);
})();
PHP
$card = StarkInfra\IssuingCard::cancel("5715709195239424");
print_r($card);
Java
import com.starkinfra.*;
IssuingCard card = IssuingCard.cancel("5715709195239424");
System.out.println(card);
Ruby
require('starkinfra')
card = StarkInfra::IssuingCard.cancel("5715709195239424")
puts card
Elixir
card = StarkInfra.IssuingCard.cancel!("5715709195239424")
IO.inspect(card)
C#
using System;
StarkInfra.IssuingCard card = StarkInfra.IssuingCard.Cancel("5715709195239424");
Console.WriteLine(card);
Go
package main
import (
"fmt"
"github.com/starkinfra/sdk-go/starkinfra/issuingcard"
)
func main() {
card, err := issuingcard.Cancel("5715709195239424", nil)
if err.Errors != nil {
for _, e := range err.Errors {
fmt.Printf("code: %s, message: %s", e.Code, e.Message)
}
}
fmt.Printf("%+v", card)
}
Clojure
Not yet available. Please contact us if you need this SDK.
Curl
curl --location --request DELETE '{{baseUrl}}/v2/issuing-card/5715709195239424' \
--header 'Access-Id: {{accessId}}' \
--header 'Access-Time: {{accessTime}}' \
--header 'Access-Signature: {{accessSignature}}'
Python
IssuingCard(
id=5715709195239424,
holder_id=5155165527080960,
holder_name=Tony Stark,
holder_tax_id=012.345.678-90,
holder_external_id=my-holder-id-1234,
display_name=TONY STARK,
product_id=654321,
type=physical,
status=canceled,
rules=[],
street_line_1=Av. Faria Lima, 1844,
street_line_2=10 andar,
district=Itaim Bibi,
city=Sao Paulo,
state_code=SP,
zip_code=01311-000,
tags=['department: tech', 'team: backend'],
number=**** **** **** 1234,
security_code=***,
expiration=****-**-**T**:**:**.******+00:00,
created=2022-01-01 00:00:00,
updated=2022-06-01 00:00:00
)
Javascript
IssuingCard {
id: '5715709195239424',
holderId: '5155165527080960',
holderName: 'Tony Stark',
holderTaxId: '012.345.678-90',
holderExternalId: 'my-holder-id-1234',
displayName: 'TONY STARK',
productId: '654321',
type: 'physical',
status: 'canceled',
rules: [],
streetLine1: 'Av. Faria Lima, 1844',
streetLine2: '10 andar',
district: 'Itaim Bibi',
city: 'Sao Paulo',
stateCode: 'SP',
zipCode: '01311-000',
tags: [ 'department: tech', 'team: backend' ],
number: '**** **** **** 1234',
securityCode: '***',
expiration: '****-**-**T**:**:**.******+00:00',
created: '2022-01-01T00:00:00.000000+00:00',
updated: '2022-06-01T00:00:00.000000+00:00'
}
PHP
StarkInfra\IssuingCard Object
(
[id] => 5715709195239424
[productId] => 654321
[holderId] => 5155165527080960
[holderName] => Tony Stark
[holderTaxId] => 012.345.678-90
[holderExternalId] => my-holder-id-1234
[type] => physical
[displayName] => TONY STARK
[status] => canceled
[rules] => Array ( )
[streetLine1] => Av. Faria Lima, 1844
[streetLine2] => 10 andar
[district] => Itaim Bibi
[city] => Sao Paulo
[stateCode] => SP
[zipCode] => 01311-000
[tags] => Array ( [0] => department: tech [1] => team: backend )
[created] => DateTime Object ( [date] => 2022-01-01 00:00:00.000000 )
[updated] => DateTime Object ( [date] => 2022-06-01 00:00:00.000000 )
[number] => **** **** **** 1234
[securityCode] => ***
[expiration] => ****-**-**T**:**:**.******+00:00
)
Java
IssuingCard({
"id": "5715709195239424",
"productId": "654321",
"holderId": "5155165527080960",
"holderName": "Tony Stark",
"holderTaxId": "012.345.678-90",
"holderExternalId": "my-holder-id-1234",
"type": "physical",
"displayName": "TONY STARK",
"status": "canceled",
"rules": [],
"streetLine1": "Av. Faria Lima, 1844",
"streetLine2": "10 andar",
"district": "Itaim Bibi",
"city": "Sao Paulo",
"stateCode": "SP",
"zipCode": "01311-000",
"tags": ["department: tech", "team: backend"],
"created": "2022-01-01T00:00:00.000000+00:00",
"updated": "2022-06-01T00:00:00.000000+00:00",
"number": "**** **** **** 1234",
"securityCode": "***",
"expiration": "****-**-**T**:**:**.******+00:00"
})
Ruby
issuingcard(
id: 5715709195239424,
product_id: 654321,
holder_id: 5155165527080960,
holder_name: Tony Stark,
holder_tax_id: 012.345.678-90,
holder_external_id: my-holder-id-1234,
type: physical,
display_name: TONY STARK,
status: canceled,
rules: [],
street_line_1: Av. Faria Lima, 1844,
street_line_2: 10 andar,
district: Itaim Bibi,
city: Sao Paulo,
state_code: SP,
zip_code: 01311-000,
tags: ["department: tech", "team: backend"],
created: 2022-01-01T00:00:00+00:00,
updated: 2022-06-01T00:00:00+00:00,
number: **** **** **** 1234,
security_code: ***,
expiration: ****-**-**T**:**:**.******+00:00
)
Elixir
%StarkInfra.IssuingCard{
id: "5715709195239424",
product_id: "654321",
holder_id: "5155165527080960",
holder_name: "Tony Stark",
holder_tax_id: "012.345.678-90",
holder_external_id: "my-holder-id-1234",
type: "physical",
display_name: "TONY STARK",
status: "canceled",
rules: [],
street_line_1: "Av. Faria Lima, 1844",
street_line_2: "10 andar",
district: "Itaim Bibi",
city: "Sao Paulo",
state_code: "SP",
zip_code: "01311-000",
tags: ["department: tech", "team: backend"],
created: "2022-01-01T00:00:00.000000+00:00",
updated: "2022-06-01T00:00:00.000000+00:00",
number: "**** **** **** 1234",
security_code: "***",
expiration: "****-**-**T**:**:**.******+00:00"
}
C#
IssuingCard(
Id: 5715709195239424,
ProductId: 654321,
HolderId: 5155165527080960,
HolderName: Tony Stark,
HolderTaxId: 012.345.678-90,
HolderExternalId: my-holder-id-1234,
Type: physical,
DisplayName: TONY STARK,
Status: canceled,
Rules: [],
StreetLine1: Av. Faria Lima, 1844,
StreetLine2: 10 andar,
District: Itaim Bibi,
City: Sao Paulo,
StateCode: SP,
ZipCode: 01311-000,
Tags: [department: tech, team: backend],
Created: 01/01/2022 00:00:00,
Updated: 06/01/2022 00:00:00,
Number: **** **** **** 1234,
SecurityCode: ***,
Expiration: ****-**-**T**:**:**.******+00:00
)
Go
{
HolderName:Tony Stark
HolderTaxId:012.345.678-90
HolderExternalId:my-holder-id-1234
DisplayName:TONY STARK
Rules:[]
ProductId:654321
Tags:[department: tech team: backend]
StreetLine1:Av. Faria Lima, 1844
StreetLine2:10 andar
District:Itaim Bibi
City:Sao Paulo
StateCode:SP
ZipCode:01311-000
Id:5715709195239424
HolderId:5155165527080960
Type:physical
Status:canceled
Number:**** **** **** 1234
SecurityCode:***
Expiration:****-**-**T**:**:**.******+00:00
Updated:2022-06-01 00:00:00 +0000 +0000
Created:2022-01-01 00:00:00 +0000 +0000
}
Clojure
Not yet available. Please contact us if you need this SDK.
Curl
{
"card": {
"id": "5715709195239424",
"productId": "654321",
"holderId": "5155165527080960",
"holderName": "Tony Stark",
"holderTaxId": "012.345.678-90",
"holderExternalId": "my-holder-id-1234",
"type": "physical",
"displayName": "TONY STARK",
"status": "canceled",
"rules": [],
"streetLine1": "Av. Faria Lima, 1844",
"streetLine2": "10 andar",
"district": "Itaim Bibi",
"city": "Sao Paulo",
"stateCode": "SP",
"zipCode": "01311-000",
"tags": ["department: tech", "team: backend"],
"created": "2022-01-01T00:00:00.000000+00:00",
"updated": "2022-06-01T00:00:00.000000+00:00",
"number": "**** **** **** 1234",
"securityCode": "***",
"expiration": "****-**-**T**:**:**.******+00:00"
}
}
Getting a Card's Logs
Audit a card's history by querying its logs with the "cardIds" filter. Each status change creates a Log — a card that was created, activated, blocked and then canceled returns one log per step. The "card" field in each log is a full representation of the Issuing Card as it was at that point in its history (shown abbreviated with "...").
You can also filter by "types" (created, unblocked, blocked, expired, canceled, updated) and "after" / "before", or fetch a single log with GET /v2/issuing-card/log/:id.
Parameters
Python
import starkinfra
logs = starkinfra.issuingcard.log.query(
card_ids=["5715709195239424"]
)
for log in logs:
print(log)
Javascript
const starkinfra = require('starkinfra');
(async() => {
let logs = await starkinfra.issuingCard.log.query({
limit: 10,
cardIds: ['5715709195239424']
});
for await (let log of logs) {
console.log(log);
}
})();
PHP
$logs = StarkInfra\IssuingCard\Log::query([
"cardIds" => ["5715709195239424"]
]);
foreach ($logs as $log) {
print_r($log);
}
Java
import com.starkinfra.*; import java.util.HashMap; HashMapparams = new HashMap<>(); params.put("cardIds", new String[]{"5715709195239424"}); Generator logs = IssuingCard.Log.query(params); for (IssuingCard.Log log : logs) { System.out.println(log); }
Ruby
require('starkinfra')
logs = StarkInfra::IssuingCard::Log.query(
card_ids: ["5715709195239424"]
)
logs.each do |log|
puts log
end
Elixir
logs = StarkInfra.IssuingCard.Log.query!(
card_ids: ["5715709195239424"]
)
logs |> Enum.each(&IO.inspect/1)
C#
using System; using System.Collections.Generic; IEnumerablelogs = StarkInfra.IssuingCard.Log.Query( cardIds: new List { "5715709195239424" } ); foreach (StarkInfra.IssuingCard.Log log in logs) { Console.WriteLine(log); }
Go
package main
import (
"fmt"
"github.com/starkinfra/sdk-go/starkinfra/issuingcard/log"
)
func main() {
var params = map[string]interface{}{}
params["cardIds"] = []string{"5715709195239424"}
logs, errorChannel := log.Query(params, nil)
for log := range logs {
fmt.Printf("%+v", log)
}
for err := range errorChannel {
fmt.Printf("%+v", err)
}
}
Clojure
Not yet available. Please contact us if you need this SDK.
Curl
curl --location --request GET '{{baseUrl}}/v2/issuing-card/log?cardIds=5715709195239424' \
--header 'Access-Id: {{accessId}}' \
--header 'Access-Time: {{accessTime}}' \
--header 'Access-Signature: {{accessSignature}}'
Python
Log(
id=6724771005489152,
type=created,
card=IssuingCard(id=5715709195239424, status=pending, ...),
created=2022-01-01 00:00:00
)
Log(
id=5547499534213120,
type=unblocked,
card=IssuingCard(id=5715709195239424, status=active, ...),
created=2022-02-01 00:00:00
)
Log(
id=5189683645874176,
type=blocked,
card=IssuingCard(id=5715709195239424, status=blocked, ...),
created=2022-03-01 00:00:00
)
Log(
id=6284441486065664,
type=canceled,
card=IssuingCard(id=5715709195239424, status=canceled, ...),
created=2022-06-01 00:00:00
)
Javascript
Log {
id: '6724771005489152',
type: 'created',
card: IssuingCard { id: '5715709195239424', status: 'pending', ... },
created: '2022-01-01T00:00:00.000000+00:00'
}
Log {
id: '5547499534213120',
type: 'unblocked',
card: IssuingCard { id: '5715709195239424', status: 'active', ... },
created: '2022-02-01T00:00:00.000000+00:00'
}
Log {
id: '5189683645874176',
type: 'blocked',
card: IssuingCard { id: '5715709195239424', status: 'blocked', ... },
created: '2022-03-01T00:00:00.000000+00:00'
}
Log {
id: '6284441486065664',
type: 'canceled',
card: IssuingCard { id: '5715709195239424', status: 'canceled', ... },
created: '2022-06-01T00:00:00.000000+00:00'
}
PHP
StarkInfra\IssuingCard\Log Object
(
[id] => 6724771005489152
[type] => created
[card] => StarkInfra\IssuingCard Object ( [id] => 5715709195239424 [status] => pending ... )
[created] => DateTime Object ( [date] => 2022-01-01 00:00:00.000000 )
)
StarkInfra\IssuingCard\Log Object
(
[id] => 5547499534213120
[type] => unblocked
[card] => StarkInfra\IssuingCard Object ( [id] => 5715709195239424 [status] => active ... )
[created] => DateTime Object ( [date] => 2022-02-01 00:00:00.000000 )
)
StarkInfra\IssuingCard\Log Object
(
[id] => 5189683645874176
[type] => blocked
[card] => StarkInfra\IssuingCard Object ( [id] => 5715709195239424 [status] => blocked ... )
[created] => DateTime Object ( [date] => 2022-03-01 00:00:00.000000 )
)
StarkInfra\IssuingCard\Log Object
(
[id] => 6284441486065664
[type] => canceled
[card] => StarkInfra\IssuingCard Object ( [id] => 5715709195239424 [status] => canceled ... )
[created] => DateTime Object ( [date] => 2022-06-01 00:00:00.000000 )
)
Java
IssuingCard.Log({
"id": "6724771005489152",
"type": "created",
"card": {"id": "5715709195239424", "status": "pending", ...},
"created": "2022-01-01T00:00:00.000000+00:00"
})
IssuingCard.Log({
"id": "5547499534213120",
"type": "unblocked",
"card": {"id": "5715709195239424", "status": "active", ...},
"created": "2022-02-01T00:00:00.000000+00:00"
})
IssuingCard.Log({
"id": "5189683645874176",
"type": "blocked",
"card": {"id": "5715709195239424", "status": "blocked", ...},
"created": "2022-03-01T00:00:00.000000+00:00"
})
IssuingCard.Log({
"id": "6284441486065664",
"type": "canceled",
"card": {"id": "5715709195239424", "status": "canceled", ...},
"created": "2022-06-01T00:00:00.000000+00:00"
})
Ruby
log(
id: 6724771005489152,
type: created,
card: issuingcard(id: 5715709195239424, status: pending, ...),
created: 2022-01-01T00:00:00+00:00
)
log(
id: 5547499534213120,
type: unblocked,
card: issuingcard(id: 5715709195239424, status: active, ...),
created: 2022-02-01T00:00:00+00:00
)
log(
id: 5189683645874176,
type: blocked,
card: issuingcard(id: 5715709195239424, status: blocked, ...),
created: 2022-03-01T00:00:00+00:00
)
log(
id: 6284441486065664,
type: canceled,
card: issuingcard(id: 5715709195239424, status: canceled, ...),
created: 2022-06-01T00:00:00+00:00
)
Elixir
%StarkInfra.IssuingCard.Log{
id: "6724771005489152",
type: "created",
card: %StarkInfra.IssuingCard{id: "5715709195239424", status: "pending", ...},
created: "2022-01-01T00:00:00.000000+00:00"
}
%StarkInfra.IssuingCard.Log{
id: "5547499534213120",
type: "unblocked",
card: %StarkInfra.IssuingCard{id: "5715709195239424", status: "active", ...},
created: "2022-02-01T00:00:00.000000+00:00"
}
%StarkInfra.IssuingCard.Log{
id: "5189683645874176",
type: "blocked",
card: %StarkInfra.IssuingCard{id: "5715709195239424", status: "blocked", ...},
created: "2022-03-01T00:00:00.000000+00:00"
}
%StarkInfra.IssuingCard.Log{
id: "6284441486065664",
type: "canceled",
card: %StarkInfra.IssuingCard{id: "5715709195239424", status: "canceled", ...},
created: "2022-06-01T00:00:00.000000+00:00"
}
C#
IssuingCard.Log(
Id: 6724771005489152,
Type: created,
Card: IssuingCard(Id: 5715709195239424, Status: pending, ...),
Created: 01/01/2022 00:00:00
)
IssuingCard.Log(
Id: 5547499534213120,
Type: unblocked,
Card: IssuingCard(Id: 5715709195239424, Status: active, ...),
Created: 02/01/2022 00:00:00
)
IssuingCard.Log(
Id: 5189683645874176,
Type: blocked,
Card: IssuingCard(Id: 5715709195239424, Status: blocked, ...),
Created: 03/01/2022 00:00:00
)
IssuingCard.Log(
Id: 6284441486065664,
Type: canceled,
Card: IssuingCard(Id: 5715709195239424, Status: canceled, ...),
Created: 06/01/2022 00:00:00
)
Go
{
Id:6724771005489152
Type:created
Card:{Id:5715709195239424 Status:pending ...}
Created:2022-01-01 00:00:00 +0000 +0000
}
{
Id:5547499534213120
Type:unblocked
Card:{Id:5715709195239424 Status:active ...}
Created:2022-02-01 00:00:00 +0000 +0000
}
{
Id:5189683645874176
Type:blocked
Card:{Id:5715709195239424 Status:blocked ...}
Created:2022-03-01 00:00:00 +0000 +0000
}
{
Id:6284441486065664
Type:canceled
Card:{Id:5715709195239424 Status:canceled ...}
Created:2022-06-01 00:00:00 +0000 +0000
}
Clojure
Not yet available. Please contact us if you need this SDK.
Curl
{
"cursor": null,
"logs": [
{
"id": "6724771005489152",
"type": "created",
"card": {"id": "5715709195239424", "status": "pending", ...},
"created": "2022-01-01T00:00:00.000000+00:00"
},
{
"id": "5547499534213120",
"type": "unblocked",
"card": {"id": "5715709195239424", "status": "active", ...},
"created": "2022-02-01T00:00:00.000000+00:00"
},
{
"id": "5189683645874176",
"type": "blocked",
"card": {"id": "5715709195239424", "status": "blocked", ...},
"created": "2022-03-01T00:00:00.000000+00:00"
},
{
"id": "6284441486065664",
"type": "canceled",
"card": {"id": "5715709195239424", "status": "canceled", ...},
"created": "2022-06-01T00:00:00.000000+00:00"
}
]
}
Issuing Holder Overview
An Issuing Holder is the person or business that owns the cards you issue. Each Issuing Card is attached to a holder, and one holder can own many cards.
Individual vs. business. A holder's type is derived from its taxId: a CPF (11 digits) makes it an individual, a CNPJ (14 digits) a business. This must match the holderType of the card's Issuing Product — issuing a business-product card to a CPF holder (or vice-versa) is rejected.
externalId. Each holder carries an externalId — your own reference for it, unique among your active and blocked holders. It is what lets you create cards by holderExternalId without first looking up the holder's Stark id, and it stops you from accidentally creating the same holder twice.
Spending controls. A holder can carry its own "rules" list, applied on top of each card's rules — handy to cap total spend across every card a holder owns. Pass a "rules" list on create or update. The "rules" field is always returned on the holder; pass "expand=rules" to also get each rule's live spending counter (counterAmount). See the Issuing Rule section for the full rule object and how to set it.
Holder Statuses
Each Issuing Holder has a status that reflects where it is in its life cycle:

| Status | Description |
|---|---|
| active | The holder is active and its cards can be used. New holders are created in this status. |
| blocked | The holder is temporarily blocked. You can unblock it by setting its status back to "active". |
| canceled | The holder was permanently canceled, together with all of its cards. This is irreversible. |
Holder Logs
Every time you or Stark Infra change an Issuing Holder, we create a Log entry. Logs let you audit a holder's full history — each status change and rule update.
Query the holder logs with GET /v2/issuing-holder/log (filter by holderIds, types, after / before), or fetch a single one with GET /v2/issuing-holder/log/:id. The log types are: created, unblocked, blocked, updated, canceled.
Creating a Holder
Create one or more holders by sending a "holders" list (up to 100 at a time). Each holder needs a name, a taxId and an externalId. New holders start with status "active".
The externalId must be unique among your active and blocked holders: reusing the externalId of an existing one is rejected.
You can attach a "rules" list at creation to set holder-level spending limits. The created rules are returned either way; pass "expand=rules" in the query string to also get each rule's counterAmount.
Parameters
Python
import starkinfra
holders = starkinfra.issuingholder.create(
[
starkinfra.IssuingHolder(
name="Tony Stark",
tax_id="012.345.678-90",
external_id="my-holder-id-1234",
tags=["department: tech", "team: backend"],
rules=[
starkinfra.IssuingRule(
name="General BRL",
interval="day",
amount=100000,
currency_code="BRL"
)
]
)
],
expand=["rules"]
)
for holder in holders:
print(holder)
Javascript
const starkinfra = require('starkinfra');
(async() => {
let holders = await starkinfra.issuingHolder.create([
new starkinfra.IssuingHolder({
name: 'Tony Stark',
taxId: '012.345.678-90',
externalId: 'my-holder-id-1234',
tags: ['department: tech', 'team: backend'],
rules: [
new starkinfra.IssuingRule({
name: 'General BRL',
interval: 'day',
amount: 100000,
currencyCode: 'BRL'
})
]
})
], { expand: ['rules'] });
for (let holder of holders) {
console.log(holder);
}
})();
PHP
$holders = StarkInfra\IssuingHolder::create([
new StarkInfra\IssuingHolder([
"name" => "Tony Stark",
"taxId" => "012.345.678-90",
"externalId" => "my-holder-id-1234",
"tags" => ["department: tech", "team: backend"],
"rules" => [
new StarkInfra\IssuingRule([
"name" => "General BRL",
"interval" => "day",
"amount" => 100000,
"currencyCode" => "BRL"
])
]
])
], ["expand" => ["rules"]]);
foreach ($holders as $holder) {
print_r($holder);
}
Java
import com.starkinfra.*; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; HashMaprule = new HashMap<>(); rule.put("name", "General BRL"); rule.put("interval", "day"); rule.put("amount", 100000); rule.put("currencyCode", "BRL"); Map data = new HashMap<>(); data.put("name", "Tony Stark"); data.put("taxId", "012.345.678-90"); data.put("externalId", "my-holder-id-1234"); data.put("tags", new String[]{"department: tech", "team: backend"}); data.put("rules", Arrays.asList(rule)); HashMap params = new HashMap<>(); params.put("expand", new String[]{"rules"}); List holders = IssuingHolder.create(Arrays.asList(new IssuingHolder(data)), params); for (IssuingHolder holder : holders) { System.out.println(holder); }
Ruby
require('starkinfra')
holders = StarkInfra::IssuingHolder.create(
[
StarkInfra::IssuingHolder.new(
name: "Tony Stark",
tax_id: "012.345.678-90",
external_id: "my-holder-id-1234",
tags: ["department: tech", "team: backend"],
rules: [
StarkInfra::IssuingRule.new(
name: "General BRL",
interval: "day",
amount: 100000,
currency_code: "BRL"
)
]
)
],
expand: ["rules"]
)
holders.each do |holder|
puts holder
end
Elixir
holders = StarkInfra.IssuingHolder.create!(
[
%StarkInfra.IssuingHolder{
name: "Tony Stark",
tax_id: "012.345.678-90",
external_id: "my-holder-id-1234",
tags: ["department: tech", "team: backend"],
rules: [
%StarkInfra.IssuingRule{
name: "General BRL",
interval: "day",
amount: 100000,
currency_code: "BRL"
}
]
}
],
expand: ["rules"]
)
holders |> Enum.each(&IO.inspect/1)
C#
using System; using System.Collections.Generic; Listholders = StarkInfra.IssuingHolder.Create( new List { new StarkInfra.IssuingHolder( name: "Tony Stark", taxId: "012.345.678-90", externalId: "my-holder-id-1234", tags: new List { "department: tech", "team: backend" }, rules: new List { new StarkInfra.IssuingRule( name: "General BRL", interval: "day", amount: 100000, currencyCode: "BRL" ) } ) }, expand: new List { "rules" } ); foreach (StarkInfra.IssuingHolder holder in holders) { Console.WriteLine(holder); }
Go
package main
import (
"fmt"
"github.com/starkinfra/sdk-go/starkinfra/issuingholder"
"github.com/starkinfra/sdk-go/starkinfra/issuingrule"
)
func main() {
holders, err := issuingholder.Create(
[]issuingholder.IssuingHolder{
{
Name: "Tony Stark",
TaxId: "012.345.678-90",
ExternalId: "my-holder-id-1234",
Tags: []string{"department: tech", "team: backend"},
Rules: []issuingrule.IssuingRule{
{
Name: "General BRL",
Interval: "day",
Amount: 100000,
CurrencyCode: "BRL",
},
},
},
},
map[string]interface{}{"expand": []string{"rules"}},
nil,
)
if err.Errors != nil {
for _, e := range err.Errors {
fmt.Printf("code: %s, message: %s", e.Code, e.Message)
}
}
for _, holder := range holders {
fmt.Printf("%+v", holder)
}
}
Clojure
Not yet available. Please contact us if you need this SDK.
Curl
curl --location --request POST '{{baseUrl}}/v2/issuing-holder?expand=rules' \
--header 'Access-Id: {{accessId}}' \
--header 'Access-Time: {{accessTime}}' \
--header 'Access-Signature: {{accessSignature}}' \
--header 'Content-Type: application/json' \
--data-raw '{
"holders": [
{
"name": "Tony Stark",
"taxId": "012.345.678-90",
"externalId": "my-holder-id-1234",
"tags": ["department: tech", "team: backend"],
"rules": [
{
"name": "General BRL",
"interval": "day",
"amount": 100000,
"currencyCode": "BRL"
}
]
}
]
}'
Python
IssuingHolder(
id=5715709195239424,
name=Tony Stark,
tax_id=012.345.678-90,
external_id=my-holder-id-1234,
status=active,
tags=['department: tech', 'team: backend'],
rules=[
IssuingRule(
id=5155165527080960,
name=General BRL,
amount=100000,
interval=day,
currency_code=BRL,
currency_name=Brazilian Real,
currency_symbol=R$,
counter_amount=0,
schedule=,
purposes=[],
categories=[],
countries=[],
methods=[],
merchants=[]
)
],
created=2022-01-01 00:00:00,
updated=2022-01-01 00:00:00
)
Javascript
IssuingHolder {
id: '5715709195239424',
name: 'Tony Stark',
taxId: '012.345.678-90',
externalId: 'my-holder-id-1234',
status: 'active',
tags: [ 'department: tech', 'team: backend' ],
rules: [
IssuingRule {
id: '5155165527080960',
name: 'General BRL',
amount: 100000,
interval: 'day',
currencyCode: 'BRL',
currencyName: 'Brazilian Real',
currencySymbol: 'R$',
counterAmount: 0,
schedule: '',
purposes: [],
categories: [],
countries: [],
methods: [],
merchants: []
}
],
created: '2022-01-01T00:00:00.000000+00:00',
updated: '2022-01-01T00:00:00.000000+00:00'
}
PHP
StarkInfra\IssuingHolder Object
(
[id] => 5715709195239424
[name] => Tony Stark
[taxId] => 012.345.678-90
[externalId] => my-holder-id-1234
[status] => active
[rules] => Array
(
[0] => StarkInfra\IssuingRule Object
(
[id] => 5155165527080960
[name] => General BRL
[amount] => 100000
[interval] => day
[currencyCode] => BRL
[currencyName] => Brazilian Real
[currencySymbol] => R$
[counterAmount] => 0
[schedule] =>
[purposes] => Array ( )
[categories] => Array ( )
[countries] => Array ( )
[methods] => Array ( )
[merchants] => Array ( )
)
)
[tags] => Array ( [0] => department: tech [1] => team: backend )
[created] => DateTime Object ( [date] => 2022-01-01 00:00:00.000000 )
[updated] => DateTime Object ( [date] => 2022-01-01 00:00:00.000000 )
)
Java
IssuingHolder({
"id": "5715709195239424",
"name": "Tony Stark",
"taxId": "012.345.678-90",
"externalId": "my-holder-id-1234",
"status": "active",
"rules": [
{
"id": "5155165527080960",
"name": "General BRL",
"interval": "day",
"amount": 100000,
"currencyCode": "BRL",
"currencyName": "Brazilian Real",
"currencySymbol": "R$",
"counterAmount": 0,
"schedule": "",
"purposes": [],
"categories": [],
"countries": [],
"methods": [],
"merchants": []
}
],
"tags": ["department: tech", "team: backend"],
"created": "2022-01-01T00:00:00.000000+00:00",
"updated": "2022-01-01T00:00:00.000000+00:00"
})
Ruby
issuingholder(
id: 5715709195239424,
name: Tony Stark,
tax_id: 012.345.678-90,
external_id: my-holder-id-1234,
status: active,
tags: ["department: tech", "team: backend"],
rules: [
issuingrule(
id: 5155165527080960,
name: General BRL,
amount: 100000,
interval: day,
currency_code: BRL,
currency_name: Brazilian Real,
currency_symbol: R$,
counter_amount: 0,
schedule: ,
purposes: [],
categories: [],
countries: [],
methods: [],
merchants: []
)
],
created: 2022-01-01T00:00:00+00:00,
updated: 2022-01-01T00:00:00+00:00
)
Elixir
%StarkInfra.IssuingHolder{
id: "5715709195239424",
name: "Tony Stark",
tax_id: "012.345.678-90",
external_id: "my-holder-id-1234",
status: "active",
tags: ["department: tech", "team: backend"],
rules: [
%StarkInfra.IssuingRule{
id: "5155165527080960",
name: "General BRL",
amount: 100000,
interval: "day",
currency_code: "BRL",
currency_name: "Brazilian Real",
currency_symbol: "R$",
counter_amount: 0,
schedule: "",
purposes: [],
categories: [],
countries: [],
methods: [],
merchants: []
}
],
created: "2022-01-01T00:00:00.000000+00:00",
updated: "2022-01-01T00:00:00.000000+00:00"
}
C#
IssuingHolder(
Id: 5715709195239424,
Name: Tony Stark,
TaxId: 012.345.678-90,
ExternalId: my-holder-id-1234,
Status: active,
Rules: [
IssuingRule(
Id: 5155165527080960,
Name: General BRL,
Amount: 100000,
Interval: day,
CurrencyCode: BRL,
CurrencyName: Brazilian Real,
CurrencySymbol: R$,
CounterAmount: 0,
Schedule: ,
Purposes: [],
Categories: [],
Countries: [],
Methods: [],
Merchants: []
)
],
Tags: [department: tech, team: backend],
Updated: 01/01/2022 00:00:00,
Created: 01/01/2022 00:00:00
)
Go
{
Name:Tony Stark
TaxId:012.345.678-90
ExternalId:my-holder-id-1234
Rules:[{Name:General BRL Amount:100000 Id:5155165527080960 Interval:day CurrencyCode:BRL CurrencyName:Brazilian Real CurrencySymbol:R$ CounterAmount:0 Schedule: Purposes:[] Categories:[] Countries:[] Methods:[] Merchants:[]}]
Tags:[department: tech team: backend]
Id:5715709195239424
Status:active
Updated:2022-01-01 00:00:00 +0000 +0000
Created:2022-01-01 00:00:00 +0000 +0000
}
Clojure
Not yet available. Please contact us if you need this SDK.
Curl
{
"message": "Card Holder(s) successfully created.",
"holders": [
{
"id": "5715709195239424",
"name": "Tony Stark",
"taxId": "012.345.678-90",
"externalId": "my-holder-id-1234",
"status": "active",
"tags": ["department: tech", "team: backend"],
"rules": [
{
"id": "5155165527080960",
"name": "General BRL",
"interval": "day",
"amount": 100000,
"currencyCode": "BRL",
"counterAmount": 0,
"currencyName": "Brazilian Real",
"currencySymbol": "R$",
"schedule": "",
"purposes": [],
"categories": [],
"countries": [],
"methods": [],
"merchants": []
}
],
"created": "2022-01-01T00:00:00.000000+00:00",
"updated": "2022-01-01T00:00:00.000000+00:00"
}
]
}
Blocking a Holder
Temporarily block a holder by setting its status to "blocked". While blocked, the holder's cards decline purchases until you unblock it.
Parameters
Python
import starkinfra
holder = starkinfra.issuingholder.update(
id="5715709195239424",
status="blocked"
)
print(holder)
Javascript
const starkinfra = require('starkinfra');
(async() => {
let holder = await starkinfra.issuingHolder.update(
'5715709195239424',
{ status: 'blocked' }
);
console.log(holder);
})();
PHP
$holder = StarkInfra\IssuingHolder::update("5715709195239424", [
"status" => "blocked"
]);
print_r($holder);
Java
import com.starkinfra.*; import java.util.HashMap; HashMapdata = new HashMap<>(); data.put("status", "blocked"); IssuingHolder holder = IssuingHolder.update("5715709195239424", data); System.out.println(holder);
Ruby
require('starkinfra')
holder = StarkInfra::IssuingHolder.update(
"5715709195239424",
status: "blocked"
)
puts holder
Elixir
holder = StarkInfra.IssuingHolder.update!(
"5715709195239424",
status: "blocked"
)
holder |> IO.inspect
C#
using System;
using System.Collections.Generic;
StarkInfra.IssuingHolder holder = StarkInfra.IssuingHolder.Update(
"5715709195239424",
new Dictionary { { "status", "blocked" } }
);
Console.WriteLine(holder);
Go
package main
import (
"fmt"
"github.com/starkinfra/sdk-go/starkinfra/issuingholder"
)
func main() {
holder, err := issuingholder.Update(
"5715709195239424",
map[string]interface{}{"status": "blocked"},
nil,
)
if err.Errors != nil {
for _, e := range err.Errors {
fmt.Printf("code: %s, message: %s", e.Code, e.Message)
}
}
fmt.Printf("%+v", holder)
}
Clojure
Not yet available. Please contact us if you need this SDK.
Curl
curl --location --request PATCH '{{baseUrl}}/v2/issuing-holder/5715709195239424' \
--header 'Access-Id: {{accessId}}' \
--header 'Access-Time: {{accessTime}}' \
--header 'Access-Signature: {{accessSignature}}' \
--header 'Content-Type: application/json' \
--data-raw '{
"status": "blocked"
}'
Python
IssuingHolder(
id=5715709195239424,
name=Tony Stark,
tax_id=012.345.678-90,
external_id=my-holder-id-1234,
status=blocked,
tags=['department: tech', 'team: backend'],
rules=[
IssuingRule(
id=5155165527080960,
name=General BRL,
amount=100000,
interval=day,
currency_code=BRL,
schedule=,
purposes=[],
categories=[],
countries=[],
methods=[],
merchants=[]
)
],
created=2022-01-01 00:00:00,
updated=2022-06-01 00:00:00
)
Javascript
IssuingHolder {
id: '5715709195239424',
name: 'Tony Stark',
taxId: '012.345.678-90',
externalId: 'my-holder-id-1234',
status: 'blocked',
tags: [ 'department: tech', 'team: backend' ],
rules: [
IssuingRule {
id: '5155165527080960',
name: 'General BRL',
amount: 100000,
interval: 'day',
currencyCode: 'BRL',
schedule: '',
purposes: [],
categories: [],
countries: [],
methods: [],
merchants: []
}
],
created: '2022-01-01T00:00:00.000000+00:00',
updated: '2022-06-01T00:00:00.000000+00:00'
}
PHP
StarkInfra\IssuingHolder Object
(
[id] => 5715709195239424
[name] => Tony Stark
[taxId] => 012.345.678-90
[externalId] => my-holder-id-1234
[status] => blocked
[rules] => Array
(
[0] => StarkInfra\IssuingRule Object
(
[id] => 5155165527080960
[name] => General BRL
[amount] => 100000
[interval] => day
[currencyCode] => BRL
[schedule] =>
[purposes] => Array ( )
[categories] => Array ( )
[countries] => Array ( )
[methods] => Array ( )
[merchants] => Array ( )
)
)
[tags] => Array ( [0] => department: tech [1] => team: backend )
[created] => DateTime Object ( [date] => 2022-01-01 00:00:00.000000 )
[updated] => DateTime Object ( [date] => 2022-06-01 00:00:00.000000 )
)
Java
IssuingHolder({
"id": "5715709195239424",
"name": "Tony Stark",
"taxId": "012.345.678-90",
"externalId": "my-holder-id-1234",
"status": "blocked",
"rules": [
{
"id": "5155165527080960",
"name": "General BRL",
"interval": "day",
"amount": 100000,
"currencyCode": "BRL",
"schedule": "",
"purposes": [],
"categories": [],
"countries": [],
"methods": [],
"merchants": []
}
],
"tags": ["department: tech", "team: backend"],
"created": "2022-01-01T00:00:00.000000+00:00",
"updated": "2022-06-01T00:00:00.000000+00:00"
})
Ruby
issuingholder(
id: 5715709195239424,
name: Tony Stark,
tax_id: 012.345.678-90,
external_id: my-holder-id-1234,
status: blocked,
tags: ["department: tech", "team: backend"],
rules: [
issuingrule(
id: 5155165527080960,
name: General BRL,
amount: 100000,
interval: day,
currency_code: BRL,
schedule: ,
purposes: [],
categories: [],
countries: [],
methods: [],
merchants: []
)
],
created: 2022-01-01T00:00:00+00:00,
updated: 2022-06-01T00:00:00+00:00
)
Elixir
%StarkInfra.IssuingHolder{
id: "5715709195239424",
name: "Tony Stark",
tax_id: "012.345.678-90",
external_id: "my-holder-id-1234",
status: "blocked",
tags: ["department: tech", "team: backend"],
rules: [
%StarkInfra.IssuingRule{
id: "5155165527080960",
name: "General BRL",
amount: 100000,
interval: "day",
currency_code: "BRL",
schedule: "",
purposes: [],
categories: [],
countries: [],
methods: [],
merchants: []
}
],
created: "2022-01-01T00:00:00.000000+00:00",
updated: "2022-06-01T00:00:00.000000+00:00"
}
C#
IssuingHolder(
Id: 5715709195239424,
Name: Tony Stark,
TaxId: 012.345.678-90,
ExternalId: my-holder-id-1234,
Status: blocked,
Rules: [
IssuingRule(
Id: 5155165527080960,
Name: General BRL,
Amount: 100000,
Interval: day,
CurrencyCode: BRL,
Schedule: ,
Purposes: [],
Categories: [],
Countries: [],
Methods: [],
Merchants: []
)
],
Tags: [department: tech, team: backend],
Updated: 06/01/2022 00:00:00,
Created: 01/01/2022 00:00:00
)
Go
{
Name:Tony Stark
TaxId:012.345.678-90
ExternalId:my-holder-id-1234
Rules:[{Name:General BRL Amount:100000 Id:5155165527080960 Interval:day CurrencyCode:BRL Schedule: Purposes:[] Categories:[] Countries:[] Methods:[] Merchants:[]}]
Tags:[department: tech team: backend]
Id:5715709195239424
Status:blocked
Updated:2022-06-01 00:00:00 +0000 +0000
Created:2022-01-01 00:00:00 +0000 +0000
}
Clojure
Not yet available. Please contact us if you need this SDK.
Curl
{
"message": "Card Holder(s) successfully updated.",
"holder": {
"id": "5715709195239424",
"name": "Tony Stark",
"taxId": "012.345.678-90",
"externalId": "my-holder-id-1234",
"status": "blocked",
"tags": ["department: tech", "team: backend"],
"rules": [
{
"id": "5155165527080960",
"name": "General BRL",
"interval": "day",
"amount": 100000,
"currencyCode": "BRL",
"schedule": "",
"purposes": [],
"categories": [],
"countries": [],
"methods": [],
"merchants": []
}
],
"created": "2022-01-01T00:00:00.000000+00:00",
"updated": "2022-06-01T00:00:00.000000+00:00"
}
}
Unblocking a Holder
Reactivate a blocked holder by setting its status back to "active". Only "active" and "blocked" are accepted on update — to permanently retire a holder use the cancel route below.
Parameters
Python
import starkinfra
holder = starkinfra.issuingholder.update(
id="5715709195239424",
status="active"
)
print(holder)
Javascript
const starkinfra = require('starkinfra');
(async() => {
let holder = await starkinfra.issuingHolder.update(
'5715709195239424',
{ status: 'active' }
);
console.log(holder);
})();
PHP
$holder = StarkInfra\IssuingHolder::update("5715709195239424", [
"status" => "active"
]);
print_r($holder);
Java
import com.starkinfra.*; import java.util.HashMap; HashMapdata = new HashMap<>(); data.put("status", "active"); IssuingHolder holder = IssuingHolder.update("5715709195239424", data); System.out.println(holder);
Ruby
require('starkinfra')
holder = StarkInfra::IssuingHolder.update(
"5715709195239424",
status: "active"
)
puts holder
Elixir
holder = StarkInfra.IssuingHolder.update!(
"5715709195239424",
status: "active"
)
holder |> IO.inspect
C#
using System;
using System.Collections.Generic;
StarkInfra.IssuingHolder holder = StarkInfra.IssuingHolder.Update(
"5715709195239424",
new Dictionary { { "status", "active" } }
);
Console.WriteLine(holder);
Go
package main
import (
"fmt"
"github.com/starkinfra/sdk-go/starkinfra/issuingholder"
)
func main() {
holder, err := issuingholder.Update(
"5715709195239424",
map[string]interface{}{"status": "active"},
nil,
)
if err.Errors != nil {
for _, e := range err.Errors {
fmt.Printf("code: %s, message: %s", e.Code, e.Message)
}
}
fmt.Printf("%+v", holder)
}
Clojure
Not yet available. Please contact us if you need this SDK.
Curl
curl --location --request PATCH '{{baseUrl}}/v2/issuing-holder/5715709195239424' \
--header 'Access-Id: {{accessId}}' \
--header 'Access-Time: {{accessTime}}' \
--header 'Access-Signature: {{accessSignature}}' \
--header 'Content-Type: application/json' \
--data-raw '{
"status": "active"
}'
Python
IssuingHolder(
id=5715709195239424,
name=Tony Stark,
tax_id=012.345.678-90,
external_id=my-holder-id-1234,
status=active,
tags=['department: tech', 'team: backend'],
rules=[
IssuingRule(
id=5155165527080960,
name=General BRL,
amount=100000,
interval=day,
currency_code=BRL,
schedule=,
purposes=[],
categories=[],
countries=[],
methods=[],
merchants=[]
)
],
created=2022-01-01 00:00:00,
updated=2022-06-01 00:00:00
)
Javascript
IssuingHolder {
id: '5715709195239424',
name: 'Tony Stark',
taxId: '012.345.678-90',
externalId: 'my-holder-id-1234',
status: 'active',
tags: [ 'department: tech', 'team: backend' ],
rules: [
IssuingRule {
id: '5155165527080960',
name: 'General BRL',
amount: 100000,
interval: 'day',
currencyCode: 'BRL',
schedule: '',
purposes: [],
categories: [],
countries: [],
methods: [],
merchants: []
}
],
created: '2022-01-01T00:00:00.000000+00:00',
updated: '2022-06-01T00:00:00.000000+00:00'
}
PHP
StarkInfra\IssuingHolder Object
(
[id] => 5715709195239424
[name] => Tony Stark
[taxId] => 012.345.678-90
[externalId] => my-holder-id-1234
[status] => active
[rules] => Array
(
[0] => StarkInfra\IssuingRule Object
(
[id] => 5155165527080960
[name] => General BRL
[amount] => 100000
[interval] => day
[currencyCode] => BRL
[schedule] =>
[purposes] => Array ( )
[categories] => Array ( )
[countries] => Array ( )
[methods] => Array ( )
[merchants] => Array ( )
)
)
[tags] => Array ( [0] => department: tech [1] => team: backend )
[created] => DateTime Object ( [date] => 2022-01-01 00:00:00.000000 )
[updated] => DateTime Object ( [date] => 2022-06-01 00:00:00.000000 )
)
Java
IssuingHolder({
"id": "5715709195239424",
"name": "Tony Stark",
"taxId": "012.345.678-90",
"externalId": "my-holder-id-1234",
"status": "active",
"rules": [
{
"id": "5155165527080960",
"name": "General BRL",
"interval": "day",
"amount": 100000,
"currencyCode": "BRL",
"schedule": "",
"purposes": [],
"categories": [],
"countries": [],
"methods": [],
"merchants": []
}
],
"tags": ["department: tech", "team: backend"],
"created": "2022-01-01T00:00:00.000000+00:00",
"updated": "2022-06-01T00:00:00.000000+00:00"
})
Ruby
issuingholder(
id: 5715709195239424,
name: Tony Stark,
tax_id: 012.345.678-90,
external_id: my-holder-id-1234,
status: active,
tags: ["department: tech", "team: backend"],
rules: [
issuingrule(
id: 5155165527080960,
name: General BRL,
amount: 100000,
interval: day,
currency_code: BRL,
schedule: ,
purposes: [],
categories: [],
countries: [],
methods: [],
merchants: []
)
],
created: 2022-01-01T00:00:00+00:00,
updated: 2022-06-01T00:00:00+00:00
)
Elixir
%StarkInfra.IssuingHolder{
id: "5715709195239424",
name: "Tony Stark",
tax_id: "012.345.678-90",
external_id: "my-holder-id-1234",
status: "active",
tags: ["department: tech", "team: backend"],
rules: [
%StarkInfra.IssuingRule{
id: "5155165527080960",
name: "General BRL",
amount: 100000,
interval: "day",
currency_code: "BRL",
schedule: "",
purposes: [],
categories: [],
countries: [],
methods: [],
merchants: []
}
],
created: "2022-01-01T00:00:00.000000+00:00",
updated: "2022-06-01T00:00:00.000000+00:00"
}
C#
IssuingHolder(
Id: 5715709195239424,
Name: Tony Stark,
TaxId: 012.345.678-90,
ExternalId: my-holder-id-1234,
Status: active,
Rules: [
IssuingRule(
Id: 5155165527080960,
Name: General BRL,
Amount: 100000,
Interval: day,
CurrencyCode: BRL,
Schedule: ,
Purposes: [],
Categories: [],
Countries: [],
Methods: [],
Merchants: []
)
],
Tags: [department: tech, team: backend],
Updated: 06/01/2022 00:00:00,
Created: 01/01/2022 00:00:00
)
Go
{
Name:Tony Stark
TaxId:012.345.678-90
ExternalId:my-holder-id-1234
Rules:[{Name:General BRL Amount:100000 Id:5155165527080960 Interval:day CurrencyCode:BRL Schedule: Purposes:[] Categories:[] Countries:[] Methods:[] Merchants:[]}]
Tags:[department: tech team: backend]
Id:5715709195239424
Status:active
Updated:2022-06-01 00:00:00 +0000 +0000
Created:2022-01-01 00:00:00 +0000 +0000
}
Clojure
Not yet available. Please contact us if you need this SDK.
Curl
{
"message": "Card Holder(s) successfully updated.",
"holder": {
"id": "5715709195239424",
"name": "Tony Stark",
"taxId": "012.345.678-90",
"externalId": "my-holder-id-1234",
"status": "active",
"tags": ["department: tech", "team: backend"],
"rules": [
{
"id": "5155165527080960",
"name": "General BRL",
"interval": "day",
"amount": 100000,
"currencyCode": "BRL",
"schedule": "",
"purposes": [],
"categories": [],
"countries": [],
"methods": [],
"merchants": []
}
],
"created": "2022-01-01T00:00:00.000000+00:00",
"updated": "2022-06-01T00:00:00.000000+00:00"
}
}
Updating a Holder's Rules
Send a "rules" list on update to replace the holder's spending rules — the new list overwrites the old one. You can also update "name" and "tags" in the same call.
Rules are echoed back abbreviated unless you pass "expand=rules". See the Issuing Rule section for the full rule object.
Parameters
Python
import starkinfra
holder = starkinfra.issuingholder.update(
id="5715709195239424",
rules=[
starkinfra.IssuingRule(
name="General BRL",
interval="month",
amount=500000,
currency_code="BRL"
)
]
)
print(holder)
Javascript
const starkinfra = require('starkinfra');
(async() => {
let holder = await starkinfra.issuingHolder.update(
'5715709195239424',
{
rules: [
new starkinfra.IssuingRule({
name: 'General BRL',
interval: 'month',
amount: 500000,
currencyCode: 'BRL'
})
]
}
);
console.log(holder);
})();
PHP
$holder = StarkInfra\IssuingHolder::update("5715709195239424", [
"rules" => [
new StarkInfra\IssuingRule([
"name" => "General BRL",
"interval" => "month",
"amount" => 500000,
"currencyCode" => "BRL"
])
]
]);
print_r($holder);
Java
import com.starkinfra.*; import java.util.ArrayList; import java.util.HashMap; import java.util.List; HashMaprule = new HashMap<>(); rule.put("name", "General BRL"); rule.put("interval", "month"); rule.put("amount", 500000); rule.put("currencyCode", "BRL"); List > rules = new ArrayList<>(); rules.add(rule); HashMap data = new HashMap<>(); data.put("rules", rules); IssuingHolder holder = IssuingHolder.update("5715709195239424", data); System.out.println(holder);
Ruby
require('starkinfra')
holder = StarkInfra::IssuingHolder.update(
"5715709195239424",
rules: [
StarkInfra::IssuingRule.new(
name: "General BRL",
interval: "month",
amount: 500000,
currency_code: "BRL"
)
]
)
puts holder
Elixir
holder = StarkInfra.IssuingHolder.update!(
"5715709195239424",
rules: [
%StarkInfra.IssuingRule{
name: "General BRL",
interval: "month",
amount: 500000,
currency_code: "BRL"
}
]
)
holder |> IO.inspect
C#
using System; using System.Collections.Generic; Listrules = new List { new StarkInfra.IssuingRule( name: "General BRL", interval: "month", amount: 500000, currencyCode: "BRL" ) }; StarkInfra.IssuingHolder holder = StarkInfra.IssuingHolder.Update( "5715709195239424", new Dictionary { { "rules", rules } } ); Console.WriteLine(holder);
Go
package main
import (
"fmt"
"github.com/starkinfra/sdk-go/starkinfra/issuingholder"
"github.com/starkinfra/sdk-go/starkinfra/issuingrule"
)
func main() {
holder, err := issuingholder.Update(
"5715709195239424",
map[string]interface{}{
"rules": []issuingrule.IssuingRule{
{
Name: "General BRL",
Interval: "month",
Amount: 500000,
CurrencyCode: "BRL",
},
},
},
nil,
)
if err.Errors != nil {
for _, e := range err.Errors {
fmt.Printf("code: %s, message: %s", e.Code, e.Message)
}
}
fmt.Printf("%+v", holder)
}
Clojure
Not yet available. Please contact us if you need this SDK.
Curl
curl --location --request PATCH '{{baseUrl}}/v2/issuing-holder/5715709195239424' \
--header 'Access-Id: {{accessId}}' \
--header 'Access-Time: {{accessTime}}' \
--header 'Access-Signature: {{accessSignature}}' \
--header 'Content-Type: application/json' \
--data-raw '{
"rules": [
{
"name": "General BRL",
"interval": "month",
"amount": 500000,
"currencyCode": "BRL"
}
]
}'
Python
IssuingHolder(
id=5715709195239424,
name=Tony Stark,
tax_id=012.345.678-90,
external_id=my-holder-id-1234,
status=active,
tags=['department: tech', 'team: backend'],
rules=[
IssuingRule(
id=5155165527080960,
name=General BRL,
amount=500000,
interval=month,
currency_code=BRL,
schedule=,
purposes=[],
categories=[],
countries=[],
methods=[],
merchants=[]
)
],
created=2022-01-01 00:00:00,
updated=2022-06-01 00:00:00
)
Javascript
IssuingHolder {
id: '5715709195239424',
name: 'Tony Stark',
taxId: '012.345.678-90',
externalId: 'my-holder-id-1234',
status: 'active',
tags: [ 'department: tech', 'team: backend' ],
rules: [
IssuingRule {
id: '5155165527080960',
name: 'General BRL',
amount: 500000,
interval: 'month',
currencyCode: 'BRL',
schedule: '',
purposes: [],
categories: [],
countries: [],
methods: [],
merchants: []
}
],
created: '2022-01-01T00:00:00.000000+00:00',
updated: '2022-06-01T00:00:00.000000+00:00'
}
PHP
StarkInfra\IssuingHolder Object
(
[id] => 5715709195239424
[name] => Tony Stark
[taxId] => 012.345.678-90
[externalId] => my-holder-id-1234
[status] => active
[rules] => Array
(
[0] => StarkInfra\IssuingRule Object
(
[id] => 5155165527080960
[name] => General BRL
[amount] => 500000
[interval] => month
[currencyCode] => BRL
[schedule] =>
[purposes] => Array ( )
[categories] => Array ( )
[countries] => Array ( )
[methods] => Array ( )
[merchants] => Array ( )
)
)
[tags] => Array ( [0] => department: tech [1] => team: backend )
[created] => DateTime Object ( [date] => 2022-01-01 00:00:00.000000 )
[updated] => DateTime Object ( [date] => 2022-06-01 00:00:00.000000 )
)
Java
IssuingHolder({
"id": "5715709195239424",
"name": "Tony Stark",
"taxId": "012.345.678-90",
"externalId": "my-holder-id-1234",
"status": "active",
"rules": [
{
"id": "5155165527080960",
"name": "General BRL",
"interval": "month",
"amount": 500000,
"currencyCode": "BRL",
"schedule": "",
"purposes": [],
"categories": [],
"countries": [],
"methods": [],
"merchants": []
}
],
"tags": ["department: tech", "team: backend"],
"created": "2022-01-01T00:00:00.000000+00:00",
"updated": "2022-06-01T00:00:00.000000+00:00"
})
Ruby
issuingholder(
id: 5715709195239424,
name: Tony Stark,
tax_id: 012.345.678-90,
external_id: my-holder-id-1234,
status: active,
tags: ["department: tech", "team: backend"],
rules: [
issuingrule(
id: 5155165527080960,
name: General BRL,
amount: 500000,
interval: month,
currency_code: BRL,
schedule: ,
purposes: [],
categories: [],
countries: [],
methods: [],
merchants: []
)
],
created: 2022-01-01T00:00:00+00:00,
updated: 2022-06-01T00:00:00+00:00
)
Elixir
%StarkInfra.IssuingHolder{
id: "5715709195239424",
name: "Tony Stark",
tax_id: "012.345.678-90",
external_id: "my-holder-id-1234",
status: "active",
tags: ["department: tech", "team: backend"],
rules: [
%StarkInfra.IssuingRule{
id: "5155165527080960",
name: "General BRL",
amount: 500000,
interval: "month",
currency_code: "BRL",
schedule: "",
purposes: [],
categories: [],
countries: [],
methods: [],
merchants: []
}
],
created: "2022-01-01T00:00:00.000000+00:00",
updated: "2022-06-01T00:00:00.000000+00:00"
}
C#
IssuingHolder(
Id: 5715709195239424,
Name: Tony Stark,
TaxId: 012.345.678-90,
ExternalId: my-holder-id-1234,
Status: active,
Rules: [
IssuingRule(
Id: 5155165527080960,
Name: General BRL,
Amount: 500000,
Interval: month,
CurrencyCode: BRL,
Schedule: ,
Purposes: [],
Categories: [],
Countries: [],
Methods: [],
Merchants: []
)
],
Tags: [department: tech, team: backend],
Updated: 06/01/2022 00:00:00,
Created: 01/01/2022 00:00:00
)
Go
{
Name:Tony Stark
TaxId:012.345.678-90
ExternalId:my-holder-id-1234
Rules:[{Name:General BRL Amount:500000 Id:5155165527080960 Interval:month CurrencyCode:BRL Schedule: Purposes:[] Categories:[] Countries:[] Methods:[] Merchants:[]}]
Tags:[department: tech team: backend]
Id:5715709195239424
Status:active
Updated:2022-06-01 00:00:00 +0000 +0000
Created:2022-01-01 00:00:00 +0000 +0000
}
Clojure
Not yet available. Please contact us if you need this SDK.
Curl
{
"message": "Card Holder(s) successfully updated.",
"holder": {
"id": "5715709195239424",
"name": "Tony Stark",
"taxId": "012.345.678-90",
"externalId": "my-holder-id-1234",
"status": "active",
"tags": ["department: tech", "team: backend"],
"rules": [
{
"id": "5155165527080960",
"name": "General BRL",
"interval": "month",
"amount": 500000,
"currencyCode": "BRL",
"schedule": "",
"purposes": [],
"categories": [],
"countries": [],
"methods": [],
"merchants": []
}
],
"created": "2022-01-01T00:00:00.000000+00:00",
"updated": "2022-06-01T00:00:00.000000+00:00"
}
}
Canceling a Holder
Permanently cancel a holder by its id. The holder's status becomes "canceled" and all of its cards are canceled along with it. This action is irreversible.
Parameters
Python
import starkinfra
holder = starkinfra.issuingholder.cancel("5715709195239424")
print(holder)
Javascript
const starkinfra = require('starkinfra');
(async() => {
let holder = await starkinfra.issuingHolder.cancel('5715709195239424');
console.log(holder);
})();
PHP
$holder = StarkInfra\IssuingHolder::cancel("5715709195239424");
print_r($holder);
Java
import com.starkinfra.*;
IssuingHolder holder = IssuingHolder.cancel("5715709195239424");
System.out.println(holder);
Ruby
require('starkinfra')
holder = StarkInfra::IssuingHolder.cancel("5715709195239424")
puts holder
Elixir
holder = StarkInfra.IssuingHolder.cancel!("5715709195239424")
holder |> IO.inspect
C#
using System;
StarkInfra.IssuingHolder holder = StarkInfra.IssuingHolder.Cancel("5715709195239424");
Console.WriteLine(holder);
Go
package main
import (
"fmt"
"github.com/starkinfra/sdk-go/starkinfra/issuingholder"
)
func main() {
holder, err := issuingholder.Cancel("5715709195239424", nil)
if err.Errors != nil {
for _, e := range err.Errors {
fmt.Printf("code: %s, message: %s", e.Code, e.Message)
}
}
fmt.Printf("%+v", holder)
}
Clojure
Not yet available. Please contact us if you need this SDK.
Curl
curl --location --request DELETE '{{baseUrl}}/v2/issuing-holder/5715709195239424' \
--header 'Access-Id: {{accessId}}' \
--header 'Access-Time: {{accessTime}}' \
--header 'Access-Signature: {{accessSignature}}'
Python
IssuingHolder(
id=5715709195239424,
name=Tony Stark,
tax_id=012.345.678-90,
external_id=my-holder-id-1234,
status=canceled,
tags=['department: tech', 'team: backend'],
rules=[
IssuingRule(
id=5155165527080960,
name=General BRL,
amount=100000,
interval=day,
currency_code=BRL,
schedule=,
purposes=[],
categories=[],
countries=[],
methods=[],
merchants=[]
)
],
created=2022-01-01 00:00:00,
updated=2022-06-01 00:00:00
)
Javascript
IssuingHolder {
id: '5715709195239424',
name: 'Tony Stark',
taxId: '012.345.678-90',
externalId: 'my-holder-id-1234',
status: 'canceled',
tags: [ 'department: tech', 'team: backend' ],
rules: [
IssuingRule {
id: '5155165527080960',
name: 'General BRL',
amount: 100000,
interval: 'day',
currencyCode: 'BRL',
schedule: '',
purposes: [],
categories: [],
countries: [],
methods: [],
merchants: []
}
],
created: '2022-01-01T00:00:00.000000+00:00',
updated: '2022-06-01T00:00:00.000000+00:00'
}
PHP
StarkInfra\IssuingHolder Object
(
[id] => 5715709195239424
[name] => Tony Stark
[taxId] => 012.345.678-90
[externalId] => my-holder-id-1234
[status] => canceled
[rules] => Array
(
[0] => StarkInfra\IssuingRule Object
(
[id] => 5155165527080960
[name] => General BRL
[amount] => 100000
[interval] => day
[currencyCode] => BRL
[schedule] =>
[purposes] => Array ( )
[categories] => Array ( )
[countries] => Array ( )
[methods] => Array ( )
[merchants] => Array ( )
)
)
[tags] => Array ( [0] => department: tech [1] => team: backend )
[created] => DateTime Object ( [date] => 2022-01-01 00:00:00.000000 )
[updated] => DateTime Object ( [date] => 2022-06-01 00:00:00.000000 )
)
Java
IssuingHolder({
"id": "5715709195239424",
"name": "Tony Stark",
"taxId": "012.345.678-90",
"externalId": "my-holder-id-1234",
"status": "canceled",
"rules": [
{
"id": "5155165527080960",
"name": "General BRL",
"interval": "day",
"amount": 100000,
"currencyCode": "BRL",
"schedule": "",
"purposes": [],
"categories": [],
"countries": [],
"methods": [],
"merchants": []
}
],
"tags": ["department: tech", "team: backend"],
"created": "2022-01-01T00:00:00.000000+00:00",
"updated": "2022-06-01T00:00:00.000000+00:00"
})
Ruby
issuingholder(
id: 5715709195239424,
name: Tony Stark,
tax_id: 012.345.678-90,
external_id: my-holder-id-1234,
status: canceled,
tags: ["department: tech", "team: backend"],
rules: [
issuingrule(
id: 5155165527080960,
name: General BRL,
amount: 100000,
interval: day,
currency_code: BRL,
schedule: ,
purposes: [],
categories: [],
countries: [],
methods: [],
merchants: []
)
],
created: 2022-01-01T00:00:00+00:00,
updated: 2022-06-01T00:00:00+00:00
)
Elixir
%StarkInfra.IssuingHolder{
id: "5715709195239424",
name: "Tony Stark",
tax_id: "012.345.678-90",
external_id: "my-holder-id-1234",
status: "canceled",
tags: ["department: tech", "team: backend"],
rules: [
%StarkInfra.IssuingRule{
id: "5155165527080960",
name: "General BRL",
amount: 100000,
interval: "day",
currency_code: "BRL",
schedule: "",
purposes: [],
categories: [],
countries: [],
methods: [],
merchants: []
}
],
created: "2022-01-01T00:00:00.000000+00:00",
updated: "2022-06-01T00:00:00.000000+00:00"
}
C#
IssuingHolder(
Id: 5715709195239424,
Name: Tony Stark,
TaxId: 012.345.678-90,
ExternalId: my-holder-id-1234,
Status: canceled,
Rules: [
IssuingRule(
Id: 5155165527080960,
Name: General BRL,
Amount: 100000,
Interval: day,
CurrencyCode: BRL,
Schedule: ,
Purposes: [],
Categories: [],
Countries: [],
Methods: [],
Merchants: []
)
],
Tags: [department: tech, team: backend],
Updated: 06/01/2022 00:00:00,
Created: 01/01/2022 00:00:00
)
Go
{
Name:Tony Stark
TaxId:012.345.678-90
ExternalId:my-holder-id-1234
Rules:[{Name:General BRL Amount:100000 Id:5155165527080960 Interval:day CurrencyCode:BRL Schedule: Purposes:[] Categories:[] Countries:[] Methods:[] Merchants:[]}]
Tags:[department: tech team: backend]
Id:5715709195239424
Status:canceled
Updated:2022-06-01 00:00:00 +0000 +0000
Created:2022-01-01 00:00:00 +0000 +0000
}
Clojure
Not yet available. Please contact us if you need this SDK.
Curl
{
"message": "Card Holder(s) successfully canceled.",
"holder": {
"id": "5715709195239424",
"name": "Tony Stark",
"taxId": "012.345.678-90",
"externalId": "my-holder-id-1234",
"status": "canceled",
"tags": ["department: tech", "team: backend"],
"rules": [
{
"id": "5155165527080960",
"name": "General BRL",
"interval": "day",
"amount": 100000,
"currencyCode": "BRL",
"schedule": "",
"purposes": [],
"categories": [],
"countries": [],
"methods": [],
"merchants": []
}
],
"created": "2022-01-01T00:00:00.000000+00:00",
"updated": "2022-06-01T00:00:00.000000+00:00"
}
}
Getting a Holder's Logs
Audit a holder's history by querying its logs with the "holderIds" filter. Each change creates a Log — a holder that was created, blocked and then unblocked returns one log per step. The "holder" field in each log is a representation of the Issuing Holder as it was at that point in its history.
You can also filter by "types" (created, unblocked, blocked, updated, canceled) and "after" / "before", or fetch a single log with GET /v2/issuing-holder/log/:id.
Parameters
Python
import starkinfra
logs = starkinfra.issuingholder.log.query(
holder_ids=["5715709195239424"]
)
for log in logs:
print(log)
Javascript
const starkinfra = require('starkinfra');
(async() => {
let logs = await starkinfra.issuingHolder.log.query({
limit: 10,
holderIds: ['5715709195239424']
});
for await (let log of logs) {
console.log(log);
}
})();
PHP
$logs = StarkInfra\IssuingHolder\Log::query([
"limit" => 10,
"holderIds" => ["5715709195239424"]
]);
foreach ($logs as $log) {
print_r($log);
}
Java
import com.starkinfra.*; import java.util.HashMap; HashMapparams = new HashMap<>(); params.put("limit", 10); params.put("holderIds", new String[]{"5715709195239424"}); Generator logs = IssuingHolder.Log.query(params); for (IssuingHolder.Log log : logs) { System.out.println(log); }
Ruby
require('starkinfra')
logs = StarkInfra::IssuingHolder::Log.query(
limit: 10,
holder_ids: ["5715709195239424"]
)
logs.each do |log|
puts log
end
Elixir
logs = StarkInfra.IssuingHolder.Log.query!(
limit: 10,
holder_ids: ["5715709195239424"]
)
logs |> Enum.each(&IO.inspect/1)
C#
using System; using System.Collections.Generic; IEnumerablelogs = StarkInfra.IssuingHolder.Log.Query( limit: 10, holderIds: new List { "5715709195239424" } ); foreach (StarkInfra.IssuingHolder.Log log in logs) { Console.WriteLine(log); }
Go
package main
import (
"fmt"
"github.com/starkinfra/sdk-go/starkinfra/issuingholder/log"
)
func main() {
var params = map[string]interface{}{}
params["limit"] = 10
params["holderIds"] = []string{"5715709195239424"}
logs, errorChannel := log.Query(params, nil)
for log := range logs {
fmt.Printf("%+v", log)
}
for err := range errorChannel {
fmt.Printf("%+v", err)
}
}
Clojure
Not yet available. Please contact us if you need this SDK.
Curl
curl --location --request GET '{{baseUrl}}/v2/issuing-holder/log?holderIds=5715709195239424' \
--header 'Access-Id: {{accessId}}' \
--header 'Access-Time: {{accessTime}}' \
--header 'Access-Signature: {{accessSignature}}'
Python
Log(
id=6724771005489152,
type=created,
holder=IssuingHolder(id=5715709195239424, status=active, ...),
created=2022-01-01 00:00:00
)
Log(
id=5189683645874176,
type=blocked,
holder=IssuingHolder(id=5715709195239424, status=blocked, ...),
created=2022-03-01 00:00:00
)
Log(
id=5547499534213120,
type=unblocked,
holder=IssuingHolder(id=5715709195239424, status=active, ...),
created=2022-04-01 00:00:00
)
Javascript
Log {
id: '6724771005489152',
type: 'created',
holder: IssuingHolder { id: '5715709195239424', status: 'active', ... },
created: '2022-01-01T00:00:00.000000+00:00'
}
Log {
id: '5189683645874176',
type: 'blocked',
holder: IssuingHolder { id: '5715709195239424', status: 'blocked', ... },
created: '2022-03-01T00:00:00.000000+00:00'
}
Log {
id: '5547499534213120',
type: 'unblocked',
holder: IssuingHolder { id: '5715709195239424', status: 'active', ... },
created: '2022-04-01T00:00:00.000000+00:00'
}
PHP
StarkInfra\IssuingHolder\Log Object
(
[id] => 6724771005489152
[type] => created
[holder] => StarkInfra\IssuingHolder Object ( [id] => 5715709195239424 [status] => active ... )
[created] => DateTime Object ( [date] => 2022-01-01 00:00:00.000000 )
)
StarkInfra\IssuingHolder\Log Object
(
[id] => 5189683645874176
[type] => blocked
[holder] => StarkInfra\IssuingHolder Object ( [id] => 5715709195239424 [status] => blocked ... )
[created] => DateTime Object ( [date] => 2022-03-01 00:00:00.000000 )
)
StarkInfra\IssuingHolder\Log Object
(
[id] => 5547499534213120
[type] => unblocked
[holder] => StarkInfra\IssuingHolder Object ( [id] => 5715709195239424 [status] => active ... )
[created] => DateTime Object ( [date] => 2022-04-01 00:00:00.000000 )
)
Java
IssuingHolder.Log({
"id": "6724771005489152",
"type": "created",
"holder": {"id": "5715709195239424", "status": "active", ...},
"created": "2022-01-01T00:00:00.000000+00:00"
})
IssuingHolder.Log({
"id": "5189683645874176",
"type": "blocked",
"holder": {"id": "5715709195239424", "status": "blocked", ...},
"created": "2022-03-01T00:00:00.000000+00:00"
})
IssuingHolder.Log({
"id": "5547499534213120",
"type": "unblocked",
"holder": {"id": "5715709195239424", "status": "active", ...},
"created": "2022-04-01T00:00:00.000000+00:00"
})
Ruby
log(
id: 6724771005489152,
type: created,
holder: { id: 5715709195239424, status: active, ... },
created: 2022-01-01T00:00:00+00:00
)
log(
id: 5189683645874176,
type: blocked,
holder: { id: 5715709195239424, status: blocked, ... },
created: 2022-03-01T00:00:00+00:00
)
log(
id: 5547499534213120,
type: unblocked,
holder: { id: 5715709195239424, status: active, ... },
created: 2022-04-01T00:00:00+00:00
)
Elixir
%StarkInfra.IssuingHolder.Log{
id: "6724771005489152",
type: "created",
holder: %{id: "5715709195239424", status: "active", ...},
created: "2022-01-01T00:00:00.000000+00:00"
}
%StarkInfra.IssuingHolder.Log{
id: "5189683645874176",
type: "blocked",
holder: %{id: "5715709195239424", status: "blocked", ...},
created: "2022-03-01T00:00:00.000000+00:00"
}
%StarkInfra.IssuingHolder.Log{
id: "5547499534213120",
type: "unblocked",
holder: %{id: "5715709195239424", status: "active", ...},
created: "2022-04-01T00:00:00.000000+00:00"
}
C#
IssuingHolder.Log(
Id: 6724771005489152,
Type: created,
Holder: { Id: 5715709195239424, Status: active, ... },
Created: 01/01/2022 00:00:00
)
IssuingHolder.Log(
Id: 5189683645874176,
Type: blocked,
Holder: { Id: 5715709195239424, Status: blocked, ... },
Created: 03/01/2022 00:00:00
)
IssuingHolder.Log(
Id: 5547499534213120,
Type: unblocked,
Holder: { Id: 5715709195239424, Status: active, ... },
Created: 04/01/2022 00:00:00
)
Go
{
Id:6724771005489152
Type:created
Holder:{Id:5715709195239424 Status:active ...}
Created:2022-01-01 00:00:00 +0000 +0000
}
{
Id:5189683645874176
Type:blocked
Holder:{Id:5715709195239424 Status:blocked ...}
Created:2022-03-01 00:00:00 +0000 +0000
}
{
Id:5547499534213120
Type:unblocked
Holder:{Id:5715709195239424 Status:active ...}
Created:2022-04-01 00:00:00 +0000 +0000
}
Clojure
Not yet available. Please contact us if you need this SDK.
Curl
{
"cursor": null,
"logs": [
{
"id": "6724771005489152",
"type": "created",
"holder": {"id": "5715709195239424", "status": "active"},
"created": "2022-01-01T00:00:00.000000+00:00"
},
{
"id": "5189683645874176",
"type": "blocked",
"holder": {"id": "5715709195239424", "status": "blocked"},
"created": "2022-03-01T00:00:00.000000+00:00"
},
{
"id": "5547499534213120",
"type": "unblocked",
"holder": {"id": "5715709195239424", "status": "active"},
"created": "2022-04-01T00:00:00.000000+00:00"
}
]
}
Issuing Rule Overview
The Issuing Rule object represents the spending controls you attach to an Issuing Holder or Issuing Card.
A rule caps how much can be spent within a time interval and optionally restricts spending to specific merchant categories, countries or card methods.
Rules are nested objects — you never create them on their own. You set them when creating or updating a holder or card.
The spending counter. Each rule keeps a "counterAmount": how much has already been spent against it in the current interval. We update it after every purchase that moves the limit — it goes up when a purchase is approved, and back down when a purchase is reversed or confirmed for a smaller amount than was authorized. It resets to 0 when the rule's interval rolls over.
Reading the remaining balance. The amount still available on a rule is simply "amount" − "counterAmount". For example, a R$ 1.500,00 rule (amount = 150000) that already has counterAmount = 40000 still has R$ 1.100,00 left to spend in the current interval.
The rule object is always returned on its holder or card — you do not need any expand to read a rule's name, interval, amount and restrictions. Passing "expand=rules" simply enriches each returned rule with its live "counterAmount" (plus the currency name/symbol and the fully-resolved category, country and method objects).
The Issuing Rule object
Attributes
name
Rule name, used to identify it. Example: "Travel".
interval
Interval after which the rule counter resets. Options: "instant", "day", "week", "month", "year", "lifetime".
NOTE: "lifetime" never resets on its own — a rule with this interval keeps accumulating its counterAmount indefinitely. The only way to clear it is to replace the rule yourself: update the holder or card with that rule's id omitted, which starts a fresh rule (and a fresh counter) in its place.
amount
Maximum amount that can be spent within the interval, in cents. Example: 150000 (R$ 1.500,00).
currencyCode
Currency the rule's amount is measured in (e.g. "BRL", "USD"). The rule does not limit spending to this currency — purchases in other currencies are converted and counted against the limit. Example: a R$ 100,00 limit covers a R$ 100,00 purchase, or a US$ 20,00 purchase when 1 USD = 5 BRL.
schedule
Optional schedule dictating when the rule can be used. Some examples:
- "everyday from 09:00 to 18:00 in America/Sao_Paulo" — every day, 09:00–18:00 São Paulo time;
- "every monday, wednesday, friday from 08:00 to 12:00 in America/Sao_Paulo" — only those weekdays, mornings;
- "every saturday, sunday" — weekends, all day, in UTC;
purposes
Optional list of transaction purposes the rule applies to. Options: "purchase", "withdrawal", "verification". The rule then limits only purchases of those purposes; omit it to allow any purposes. Example: ["purchase", "verification"] if you want us to automatically deny withdrawal.
categories
Optional list of MerchantCategory objects the rule applies to. Restricts spending to the given merchant categories.
countries
Optional list of MerchantCountry objects the rule applies to. Restricts spending to the given countries.
methods
Optional list of CardMethod objects the rule applies to. Restricts spending to the given payment methods.
id
Unique id of the rule. Inform it when updating to preserve the rule's counters; omit it to create a fresh rule in its place.
counterAmount
Amount already spent against this rule in the current interval, in cents. It increases when a purchase is approved and decreases when one is reversed or confirmed for a smaller amount, resetting to 0 when the interval rolls over. The rule's remaining balance is amount − counterAmount. Only present when you query the holder or card with "expand=rules".
currencyName
Currency full name. Returned only. Example: "Brazilian Real".
currencySymbol
Currency symbol. Returned only. Example: "R$".
Creating with Spending Controls
Set the initial rules when you create a holder (or card) by passing a "rules" list of IssuingRule objects.
Omit each rule's id on creation — Stark Infra assigns one, which you later reuse to preserve the rule's counters when updating.
Parameters
Python
import starkinfra
holders = starkinfra.issuingholder.create([
starkinfra.IssuingHolder(
name="Tony Stark",
tax_id="012.345.678-90",
external_id="my-holder-id-1234",
tags=["department: tech"],
rules=[
starkinfra.IssuingRule(
name="Travel",
amount=150000,
currency_code="BRL",
interval="month",
schedule="everyday from 09:00 to 18:00 in America/Sao_Paulo",
purposes=["purchase", "withdrawal"],
categories=[
starkinfra.MerchantCategory(type="transportation")
]
),
starkinfra.IssuingRule(
name="General",
amount=100000,
currency_code="BRL",
interval="week",
schedule="everyday from 09:00 to 18:00 in America/Sao_Paulo",
purposes=["purchase", "withdrawal"]
)
]
)
])
for holder in holders:
print(holder)
Javascript
const starkinfra = require('starkinfra');
(async() => {
let holders = await starkinfra.issuingHolder.create([{
name: 'Tony Stark',
taxId: '012.345.678-90',
externalId: 'my-holder-id-1234',
tags: ['department: tech'],
rules: [
{
name: 'Travel',
amount: 150000,
currencyCode: 'BRL',
interval: 'month',
schedule: 'everyday from 09:00 to 18:00 in America/Sao_Paulo',
purposes: ['purchase', 'withdrawal'],
categories: [{ type: 'transportation' }]
},
{
name: 'General',
amount: 100000,
currencyCode: 'BRL',
interval: 'week',
schedule: 'everyday from 09:00 to 18:00 in America/Sao_Paulo',
purposes: ['purchase', 'withdrawal']
}
]
}]);
for (let holder of holders) {
console.log(holder);
}
})();
PHP
use StarkInfra\IssuingHolder;
use StarkInfra\IssuingRule;
use StarkInfra\MerchantCategory;
$holders = IssuingHolder::create([
new IssuingHolder([
"name" => "Tony Stark",
"taxId" => "012.345.678-90",
"externalId" => "my-holder-id-1234",
"tags" => ["department: tech"],
"rules" => [
new IssuingRule([
"name" => "Travel",
"amount" => 150000,
"currencyCode" => "BRL",
"interval" => "month",
"schedule" => "everyday from 09:00 to 18:00 in America/Sao_Paulo",
"purposes" => ["purchase", "withdrawal"],
"categories" => [
new MerchantCategory(["type" => "transportation"])
]
]),
new IssuingRule([
"name" => "General",
"amount" => 100000,
"currencyCode" => "BRL",
"interval" => "week",
"schedule" => "everyday from 09:00 to 18:00 in America/Sao_Paulo",
"purposes" => ["purchase", "withdrawal"]
])
]
])
]);
foreach ($holders as $holder) {
print_r($holder);
}
Java
import com.starkinfra.*; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import java.util.List; HashMaptravel = new HashMap<>(); travel.put("name", "Travel"); travel.put("amount", 150000); travel.put("currencyCode", "BRL"); travel.put("interval", "month"); travel.put("schedule", "everyday from 09:00 to 18:00 in America/Sao_Paulo"); travel.put("purposes", new String[]{"purchase", "withdrawal"}); HashMap general = new HashMap<>(); general.put("name", "General"); general.put("amount", 100000); general.put("currencyCode", "BRL"); general.put("interval", "week"); general.put("schedule", "everyday from 09:00 to 18:00 in America/Sao_Paulo"); general.put("purposes", new String[]{"purchase", "withdrawal"}); HashMap data = new HashMap<>(); data.put("name", "Tony Stark"); data.put("taxId", "012.345.678-90"); data.put("externalId", "my-holder-id-1234"); data.put("tags", new String[]{"department: tech"}); data.put("rules", Arrays.asList(travel, general)); List holders = IssuingHolder.create( Arrays.asList(new IssuingHolder(data)) ); for (IssuingHolder holder : holders) { System.out.println(holder); }
Ruby
require('starkinfra')
holders = StarkInfra::IssuingHolder.create([
StarkInfra::IssuingHolder.new(
name: "Tony Stark",
tax_id: "012.345.678-90",
external_id: "my-holder-id-1234",
tags: ["department: tech"],
rules: [
StarkInfra::IssuingRule.new(
name: "Travel",
amount: 150000,
currency_code: "BRL",
interval: "month",
schedule: "everyday from 09:00 to 18:00 in America/Sao_Paulo",
purposes: ["purchase", "withdrawal"],
categories: [
StarkInfra::MerchantCategory.new(type: "transportation")
]
),
StarkInfra::IssuingRule.new(
name: "General",
amount: 100000,
currency_code: "BRL",
interval: "week",
schedule: "everyday from 09:00 to 18:00 in America/Sao_Paulo",
purposes: ["purchase", "withdrawal"]
)
]
)
])
holders.each do |holder|
puts holder
end
Elixir
holders = StarkInfra.IssuingHolder.create!([
%StarkInfra.IssuingHolder{
name: "Tony Stark",
tax_id: "012.345.678-90",
external_id: "my-holder-id-1234",
tags: ["department: tech"],
rules: [
%StarkInfra.IssuingRule{
name: "Travel",
amount: 150000,
currency_code: "BRL",
interval: "month",
schedule: "everyday from 09:00 to 18:00 in America/Sao_Paulo",
purposes: ["purchase", "withdrawal"],
categories: [
%StarkInfra.MerchantCategory{type: "transportation"}
]
},
%StarkInfra.IssuingRule{
name: "General",
amount: 100000,
currency_code: "BRL",
interval: "week",
schedule: "everyday from 09:00 to 18:00 in America/Sao_Paulo",
purposes: ["purchase", "withdrawal"]
}
]
}
])
holders |> Enum.each(&IO.inspect/1)
C#
using System; using System.Collections.Generic; Listholders = StarkInfra.IssuingHolder.Create( new List { new StarkInfra.IssuingHolder( name: "Tony Stark", taxId: "012.345.678-90", externalId: "my-holder-id-1234", tags: new List { "department: tech" }, rules: new List { new StarkInfra.IssuingRule( name: "Travel", amount: 150000, currencyCode: "BRL", interval: "month", schedule: "everyday from 09:00 to 18:00 in America/Sao_Paulo", purposes: new List { "purchase", "withdrawal" }, categories: new List { new StarkInfra.MerchantCategory(type: "transportation") } ), new StarkInfra.IssuingRule( name: "General", amount: 100000, currencyCode: "BRL", interval: "week", schedule: "everyday from 09:00 to 18:00 in America/Sao_Paulo", purposes: new List { "purchase", "withdrawal" } ) } ) } ); foreach (StarkInfra.IssuingHolder holder in holders) { Console.WriteLine(holder); }
Go
package main
import (
"fmt"
"github.com/starkinfra/sdk-go/starkinfra/issuingholder"
"github.com/starkinfra/sdk-go/starkinfra/issuingrule"
"github.com/starkinfra/sdk-go/starkinfra/merchantcategory"
)
func main() {
holders, err := issuingholder.Create(
[]issuingholder.IssuingHolder{
{
Name: "Tony Stark",
TaxId: "012.345.678-90",
ExternalId: "my-holder-id-1234",
Tags: []string{"department: tech"},
Rules: []issuingrule.IssuingRule{
{
Name: "Travel",
Amount: 150000,
CurrencyCode: "BRL",
Interval: "month",
Schedule: "everyday from 09:00 to 18:00 in America/Sao_Paulo",
Purposes: []string{"purchase", "withdrawal"},
Categories: []merchantcategory.MerchantCategory{
{Type: "transportation"},
},
},
{
Name: "General",
Amount: 100000,
CurrencyCode: "BRL",
Interval: "week",
Schedule: "everyday from 09:00 to 18:00 in America/Sao_Paulo",
Purposes: []string{"purchase", "withdrawal"},
},
},
},
},
nil,
)
if err.Errors != nil {
for _, e := range err.Errors {
fmt.Printf("code: %s, message: %s", e.Code, e.Message)
}
}
for _, holder := range holders {
fmt.Printf("%+v", holder)
}
}
Clojure
(def holders
(starkinfra.issuing-holder/create
[{:name "Tony Stark"
:tax-id "012.345.678-90"
:external-id "my-holder-id-1234"
:tags ["department: tech"]
:rules [{:name "Travel"
:amount 150000
:currency-code "BRL"
:interval "month"
:schedule "everyday from 09:00 to 18:00 in America/Sao_Paulo"
:purposes ["purchase" "withdrawal"]
:categories [{:type "transportation"}]}
{:name "General"
:amount 100000
:currency-code "BRL"
:interval "week"
:schedule "everyday from 09:00 to 18:00 in America/Sao_Paulo"
:purposes ["purchase" "withdrawal"]}]}]))
(doseq [holder holders]
(println holder))
Curl
curl --location --request POST '{{baseUrl}}/v2/issuing-holder' \
--header 'Access-Id: {{accessId}}' \
--header 'Access-Time: {{accessTime}}' \
--header 'Access-Signature: {{accessSignature}}' \
--header 'Content-Type: application/json' \
--data-raw '{
"holders": [
{
"name": "Tony Stark",
"taxId": "012.345.678-90",
"externalId": "my-holder-id-1234",
"tags": ["department: tech"],
"rules": [
{
"name": "Travel",
"amount": 150000,
"currencyCode": "BRL",
"interval": "month",
"schedule": "everyday from 09:00 to 18:00 in America/Sao_Paulo",
"purposes": ["purchase", "withdrawal"],
"categories": [
{"type": "transportation"}
]
},
{
"name": "General",
"amount": 100000,
"currencyCode": "BRL",
"interval": "week",
"schedule": "everyday from 09:00 to 18:00 in America/Sao_Paulo",
"purposes": ["purchase", "withdrawal"]
}
]
}
]
}'
Python
IssuingHolder(
id=5828610602565632,
name=Tony Stark,
tax_id=012.345.678-90,
external_id=my-holder-id-1234,
status=active,
tags=['department: tech'],
rules=[
IssuingRule(
id=5265660649144320,
name=Travel,
amount=150000,
interval=month,
currency_code=BRL,
currency_name=Brazilian Real,
currency_symbol=R$,
counter_amount=0,
schedule=everyday from 09:00 to 18:00 in America/Sao_Paulo,
purposes=['purchase', 'withdrawal'],
categories=[MerchantCategory(code=, name=, number=, type=transportation)],
countries=[],
methods=[]
),
IssuingRule(
id=6743406558576640,
name=General,
amount=100000,
interval=week,
currency_code=BRL,
currency_name=Brazilian Real,
currency_symbol=R$,
counter_amount=0,
schedule=everyday from 09:00 to 18:00 in America/Sao_Paulo,
purposes=['purchase', 'withdrawal'],
categories=[],
countries=[],
methods=[]
)
],
created=2022-01-01 00:00:00,
updated=2022-06-01 00:00:00
)
Javascript
IssuingHolder {
id: '5828610602565632',
name: 'Tony Stark',
taxId: '012.345.678-90',
externalId: 'my-holder-id-1234',
status: 'active',
tags: [ 'department: tech' ],
rules: [
IssuingRule {
id: '5265660649144320',
name: 'Travel',
amount: 150000,
interval: 'month',
currencyCode: 'BRL',
currencyName: 'Brazilian Real',
currencySymbol: 'R$',
counterAmount: 0,
schedule: 'everyday from 09:00 to 18:00 in America/Sao_Paulo',
purposes: [ 'purchase', 'withdrawal' ],
categories: [ { type: 'transportation' } ],
countries: [],
methods: []
},
IssuingRule {
id: '6743406558576640',
name: 'General',
amount: 100000,
interval: 'week',
currencyCode: 'BRL',
currencyName: 'Brazilian Real',
currencySymbol: 'R$',
counterAmount: 0,
schedule: 'everyday from 09:00 to 18:00 in America/Sao_Paulo',
purposes: [ 'purchase', 'withdrawal' ],
categories: [],
countries: [],
methods: []
}
],
created: '2022-01-01T00:00:00.000000+00:00',
updated: '2022-06-01T00:00:00.000000+00:00'
}
PHP
StarkInfra\IssuingHolder Object
(
[id] => 5828610602565632
[name] => Tony Stark
[taxId] => 012.345.678-90
[externalId] => my-holder-id-1234
[status] => active
[rules] => Array
(
[0] => StarkInfra\IssuingRule Object
(
[id] => 5265660649144320
[name] => Travel
[amount] => 150000
[interval] => month
[currencyCode] => BRL
[currencyName] => Brazilian Real
[currencySymbol] => R$
[counterAmount] => 0
[schedule] => everyday from 09:00 to 18:00 in America/Sao_Paulo
[purposes] => Array ( [0] => purchase [1] => withdrawal )
[categories] => Array ( [0] => StarkInfra\MerchantCategory Object ( [type] => transportation ) )
[countries] => Array ( )
[methods] => Array ( )
)
[1] => StarkInfra\IssuingRule Object
(
[id] => 6743406558576640
[name] => General
[amount] => 100000
[interval] => week
[currencyCode] => BRL
[currencyName] => Brazilian Real
[currencySymbol] => R$
[counterAmount] => 0
[schedule] => everyday from 09:00 to 18:00 in America/Sao_Paulo
[purposes] => Array ( [0] => purchase [1] => withdrawal )
[categories] => Array ( )
[countries] => Array ( )
[methods] => Array ( )
)
)
[tags] => Array ( [0] => department: tech )
[created] => DateTime Object ( [date] => 2022-01-01 00:00:00.000000 )
[updated] => DateTime Object ( [date] => 2022-06-01 00:00:00.000000 )
)
Java
IssuingHolder({
"id": "5828610602565632",
"name": "Tony Stark",
"taxId": "012.345.678-90",
"externalId": "my-holder-id-1234",
"status": "active",
"rules": [
{
"id": "5265660649144320",
"name": "Travel",
"interval": "month",
"amount": 150000,
"currencyCode": "BRL",
"currencyName": "Brazilian Real",
"currencySymbol": "R$",
"counterAmount": 0,
"schedule": "everyday from 09:00 to 18:00 in America/Sao_Paulo",
"purposes": ["purchase", "withdrawal"],
"categories": [{ "type": "transportation" }],
"countries": [],
"methods": []
},
{
"id": "6743406558576640",
"name": "General",
"interval": "week",
"amount": 100000,
"currencyCode": "BRL",
"currencyName": "Brazilian Real",
"currencySymbol": "R$",
"counterAmount": 0,
"schedule": "everyday from 09:00 to 18:00 in America/Sao_Paulo",
"purposes": ["purchase", "withdrawal"],
"categories": [],
"countries": [],
"methods": []
}
],
"tags": ["department: tech"],
"created": "2022-01-01T00:00:00.000000+00:00",
"updated": "2022-06-01T00:00:00.000000+00:00"
})
Ruby
issuingholder(
id: 5828610602565632,
name: Tony Stark,
tax_id: 012.345.678-90,
external_id: my-holder-id-1234,
status: active,
tags: ["department: tech"],
rules: [
issuingrule(
id: 5265660649144320,
name: Travel,
amount: 150000,
interval: month,
currency_code: BRL,
currency_name: Brazilian Real,
currency_symbol: R$,
counter_amount: 0,
schedule: everyday from 09:00 to 18:00 in America/Sao_Paulo,
purposes: ["purchase", "withdrawal"],
categories: [merchantcategory(type: transportation)],
countries: [],
methods: []
),
issuingrule(
id: 6743406558576640,
name: General,
amount: 100000,
interval: week,
currency_code: BRL,
currency_name: Brazilian Real,
currency_symbol: R$,
counter_amount: 0,
schedule: everyday from 09:00 to 18:00 in America/Sao_Paulo,
purposes: ["purchase", "withdrawal"],
categories: [],
countries: [],
methods: []
)
],
created: 2022-01-01T00:00:00+00:00,
updated: 2022-06-01T00:00:00+00:00
)
Elixir
%StarkInfra.IssuingHolder{
id: "5828610602565632",
name: "Tony Stark",
tax_id: "012.345.678-90",
external_id: "my-holder-id-1234",
status: "active",
tags: ["department: tech"],
rules: [
%StarkInfra.IssuingRule{
id: "5265660649144320",
name: "Travel",
amount: 150000,
interval: "month",
currency_code: "BRL",
currency_name: "Brazilian Real",
currency_symbol: "R$",
counter_amount: 0,
schedule: "everyday from 09:00 to 18:00 in America/Sao_Paulo",
purposes: ["purchase", "withdrawal"],
categories: [%StarkInfra.MerchantCategory{type: "transportation"}],
countries: [],
methods: []
},
%StarkInfra.IssuingRule{
id: "6743406558576640",
name: "General",
amount: 100000,
interval: "week",
currency_code: "BRL",
currency_name: "Brazilian Real",
currency_symbol: "R$",
counter_amount: 0,
schedule: "everyday from 09:00 to 18:00 in America/Sao_Paulo",
purposes: ["purchase", "withdrawal"],
categories: [],
countries: [],
methods: []
}
],
created: "2022-01-01T00:00:00.000000+00:00",
updated: "2022-06-01T00:00:00.000000+00:00"
}
C#
IssuingHolder(
Id: 5828610602565632,
Name: Tony Stark,
TaxId: 012.345.678-90,
ExternalId: my-holder-id-1234,
Status: active,
Rules: [
IssuingRule(
Id: 5265660649144320,
Name: Travel,
Amount: 150000,
Interval: month,
CurrencyCode: BRL,
CurrencyName: Brazilian Real,
CurrencySymbol: R$,
CounterAmount: 0,
Schedule: everyday from 09:00 to 18:00 in America/Sao_Paulo,
Purposes: [purchase, withdrawal],
Categories: [MerchantCategory(Type: transportation)],
Countries: [],
Methods: []
),
IssuingRule(
Id: 6743406558576640,
Name: General,
Amount: 100000,
Interval: week,
CurrencyCode: BRL,
CurrencyName: Brazilian Real,
CurrencySymbol: R$,
CounterAmount: 0,
Schedule: everyday from 09:00 to 18:00 in America/Sao_Paulo,
Purposes: [purchase, withdrawal],
Categories: [],
Countries: [],
Methods: []
)
],
Tags: [department: tech],
Updated: 06/01/2022 00:00:00,
Created: 01/01/2022 00:00:00
)
Go
{
Name:Tony Stark
TaxId:012.345.678-90
ExternalId:my-holder-id-1234
Rules:[{Id:5265660649144320 Name:Travel Amount:150000 Interval:month CurrencyCode:BRL CurrencyName:Brazilian Real CurrencySymbol:R$ CounterAmount:0 Schedule:everyday from 09:00 to 18:00 in America/Sao_Paulo Purposes:[purchase withdrawal] Categories:[{Type:transportation}] Countries:[] Methods:[]} {Id:6743406558576640 Name:General Amount:100000 Interval:week CurrencyCode:BRL CurrencyName:Brazilian Real CurrencySymbol:R$ CounterAmount:0 Schedule:everyday from 09:00 to 18:00 in America/Sao_Paulo Purposes:[purchase withdrawal] Categories:[] Countries:[] Methods:[]}]
Tags:[department: tech]
Id:5828610602565632
Status:active
Updated:2022-06-01 00:00:00 +0000 +0000
Created:2022-01-01 00:00:00 +0000 +0000
}
Clojure
{:id "5828610602565632",
:name "Tony Stark",
:status "active",
:rules [{:id "5265660649144320"
:name "Travel"
:amount 150000
:interval "month"
:currency-code "BRL"
:counter-amount 0
:schedule "everyday from 09:00 to 18:00 in America/Sao_Paulo"
:purposes ["purchase" "withdrawal"]}
{:id "6743406558576640"
:name "General"
:amount 100000
:interval "week"
:currency-code "BRL"
:counter-amount 0
:schedule "everyday from 09:00 to 18:00 in America/Sao_Paulo"
:purposes ["purchase" "withdrawal"]}],
:created "2022-01-01T00:00:00.000000+00:00",
:updated "2022-06-01T00:00:00.000000+00:00"}
Curl
{
"holder": {
"id": "5828610602565632",
"name": "Tony Stark",
"taxId": "012.345.678-90",
"externalId": "my-holder-id-1234",
"status": "active",
"tags": ["department: tech"],
"rules": [
{
"id": "5265660649144320",
"name": "Travel",
"interval": "month",
"amount": 150000,
"currencyCode": "BRL",
"currencyName": "Brazilian Real",
"currencySymbol": "R$",
"counterAmount": 0,
"schedule": "everyday from 09:00 to 18:00 in America/Sao_Paulo",
"purposes": ["purchase", "withdrawal"],
"categories": [{"type": "transportation"}],
"countries": [],
"methods": []
},
{
"id": "6743406558576640",
"name": "General",
"interval": "week",
"amount": 100000,
"currencyCode": "BRL",
"currencyName": "Brazilian Real",
"currencySymbol": "R$",
"counterAmount": 0,
"schedule": "everyday from 09:00 to 18:00 in America/Sao_Paulo",
"purposes": ["purchase", "withdrawal"],
"categories": [],
"countries": [],
"methods": []
}
]
}
}
Updating Spending Controls
You may need to add or change the rules on your holders and cards.
NOTE: When you update the rules list, inform each existing rule with its id to preserve its counters. To reset a rule, omit the id and a new rule is created in place of the old one.
Send the full list you want the resource to end with — any rule absent from the list is removed. The same pattern applies to Issuing Card updates.
Parameters
Python
import starkinfra
holder = starkinfra.issuingholder.update(
id="5828610602565632",
rules=[
starkinfra.IssuingRule(
id="5265660649144320",
name="Travel",
amount=150000,
currency_code="BRL",
interval="month",
schedule="everyday from 09:00 to 18:00 in America/Sao_Paulo",
purposes=["purchase", "withdrawal"],
categories=[
starkinfra.MerchantCategory(type="transportation")
]
),
starkinfra.IssuingRule(
name="General",
amount=100000,
currency_code="BRL",
interval="week",
schedule="everyday from 09:00 to 18:00 in America/Sao_Paulo",
purposes=["purchase", "withdrawal"]
)
]
)
holder = starkinfra.issuingholder.get(holder.id, expand=["rules"])
print(holder)
Javascript
const starkinfra = require('starkinfra');
(async() => {
let holder = await starkinfra.issuingHolder.update(
'5828610602565632',
{
rules: [
{
id: '5265660649144320',
name: 'Travel',
amount: 150000,
currencyCode: 'BRL',
interval: 'month',
schedule: 'everyday from 09:00 to 18:00 in America/Sao_Paulo',
purposes: ['purchase', 'withdrawal'],
categories: [{ type: 'transportation' }]
},
{
name: 'General',
amount: 100000,
currencyCode: 'BRL',
interval: 'week',
schedule: 'everyday from 09:00 to 18:00 in America/Sao_Paulo',
purposes: ['purchase', 'withdrawal']
}
]
}
);
holder = await starkinfra.issuingHolder.get(holder.id, { expand: ['rules'] });
console.log(holder);
})();
PHP
use StarkInfra\IssuingHolder;
use StarkInfra\IssuingRule;
use StarkInfra\MerchantCategory;
$holder = IssuingHolder::update("5828610602565632", [
"rules" => [
new IssuingRule([
"id" => "5265660649144320",
"name" => "Travel",
"amount" => 150000,
"currencyCode" => "BRL",
"interval" => "month",
"schedule" => "everyday from 09:00 to 18:00 in America/Sao_Paulo",
"purposes" => ["purchase", "withdrawal"],
"categories" => [
new MerchantCategory(["type" => "transportation"])
]
]),
new IssuingRule([
"name" => "General",
"amount" => 100000,
"currencyCode" => "BRL",
"interval" => "week",
"schedule" => "everyday from 09:00 to 18:00 in America/Sao_Paulo",
"purposes" => ["purchase", "withdrawal"]
])
]
]);
$holder = IssuingHolder::get("5828610602565632", ["expand" => ["rules"]]);
print_r($holder);
Java
import com.starkinfra.*; import java.util.ArrayList; import java.util.HashMap; import java.util.List; HashMaptravel = new HashMap<>(); travel.put("id", "5265660649144320"); travel.put("name", "Travel"); travel.put("amount", 150000); travel.put("currencyCode", "BRL"); travel.put("interval", "month"); travel.put("schedule", "everyday from 09:00 to 18:00 in America/Sao_Paulo"); travel.put("purposes", new String[]{"purchase", "withdrawal"}); HashMap general = new HashMap<>(); general.put("name", "General"); general.put("amount", 100000); general.put("currencyCode", "BRL"); general.put("interval", "week"); general.put("schedule", "everyday from 09:00 to 18:00 in America/Sao_Paulo"); general.put("purposes", new String[]{"purchase", "withdrawal"}); List > rules = new ArrayList<>(); rules.add(travel); rules.add(general); HashMap data = new HashMap<>(); data.put("rules", rules); IssuingHolder holder = IssuingHolder.update("5828610602565632", data); HashMap params = new HashMap<>(); params.put("expand", new String[]{"rules"}); holder = IssuingHolder.get("5828610602565632", params); System.out.println(holder);
Ruby
require('starkinfra')
holder = StarkInfra::IssuingHolder.update(
"5828610602565632",
rules: [
StarkInfra::IssuingRule.new(
id: "5265660649144320",
name: "Travel",
amount: 150000,
currency_code: "BRL",
interval: "month",
schedule: "everyday from 09:00 to 18:00 in America/Sao_Paulo",
purposes: ["purchase", "withdrawal"],
categories: [
StarkInfra::MerchantCategory.new(type: "transportation")
]
),
StarkInfra::IssuingRule.new(
name: "General",
amount: 100000,
currency_code: "BRL",
interval: "week",
schedule: "everyday from 09:00 to 18:00 in America/Sao_Paulo",
purposes: ["purchase", "withdrawal"]
)
]
)
holder = StarkInfra::IssuingHolder.get("5828610602565632", expand: ["rules"])
puts holder
Elixir
holder = StarkInfra.IssuingHolder.update!(
"5828610602565632",
rules: [
%StarkInfra.IssuingRule{
id: "5265660649144320",
name: "Travel",
amount: 150000,
currency_code: "BRL",
interval: "month",
schedule: "everyday from 09:00 to 18:00 in America/Sao_Paulo",
purposes: ["purchase", "withdrawal"],
categories: [
%StarkInfra.MerchantCategory{type: "transportation"}
]
},
%StarkInfra.IssuingRule{
name: "General",
amount: 100000,
currency_code: "BRL",
interval: "week",
schedule: "everyday from 09:00 to 18:00 in America/Sao_Paulo",
purposes: ["purchase", "withdrawal"]
}
]
)
holder = StarkInfra.IssuingHolder.get!("5828610602565632", expand: ["rules"])
holder |> IO.inspect
C#
using System; using System.Collections.Generic; Listrules = new List { new StarkInfra.IssuingRule( id: "5265660649144320", name: "Travel", amount: 150000, currencyCode: "BRL", interval: "month", schedule: "everyday from 09:00 to 18:00 in America/Sao_Paulo", purposes: new List { "purchase", "withdrawal" }, categories: new List { new StarkInfra.MerchantCategory(type: "transportation") } ), new StarkInfra.IssuingRule( name: "General", amount: 100000, currencyCode: "BRL", interval: "week", schedule: "everyday from 09:00 to 18:00 in America/Sao_Paulo", purposes: new List { "purchase", "withdrawal" } ) }; Dictionary patch = new Dictionary { { "rules", rules } }; StarkInfra.IssuingHolder holder = StarkInfra.IssuingHolder.Update("5828610602565632", patch: patch); Dictionary query = new Dictionary { { "expand", new List { "rules" } } }; holder = StarkInfra.IssuingHolder.Get("5828610602565632", query); Console.WriteLine(holder);
Go
package main
import (
"fmt"
"github.com/starkinfra/sdk-go/starkinfra/issuingholder"
"github.com/starkinfra/sdk-go/starkinfra/issuingrule"
"github.com/starkinfra/sdk-go/starkinfra/merchantcategory"
)
func main() {
holder, err := issuingholder.Update(
"5828610602565632",
issuingholder.IssuingHolder{
Rules: []issuingrule.IssuingRule{
{
Id: "5265660649144320",
Name: "Travel",
Amount: 150000,
CurrencyCode: "BRL",
Interval: "month",
Schedule: "everyday from 09:00 to 18:00 in America/Sao_Paulo",
Purposes: []string{"purchase", "withdrawal"},
Categories: []merchantcategory.MerchantCategory{
{Type: "transportation"},
},
},
{
Name: "General",
Amount: 100000,
CurrencyCode: "BRL",
Interval: "week",
Schedule: "everyday from 09:00 to 18:00 in America/Sao_Paulo",
Purposes: []string{"purchase", "withdrawal"},
},
},
},
nil,
)
if err.Errors != nil {
for _, e := range err.Errors {
fmt.Printf("code: %s, message: %s", e.Code, e.Message)
}
}
holder, err = issuingholder.Get(
"5828610602565632",
map[string]interface{}{"expand": []string{"rules"}},
nil,
)
fmt.Printf("%+v", holder)
}
Clojure
(def holder
(starkinfra.issuing-holder/update
"5828610602565632"
{:rules [{:id "5265660649144320"
:name "Travel"
:amount 150000
:currency-code "BRL"
:interval "month"
:schedule "everyday from 09:00 to 18:00 in America/Sao_Paulo"
:purposes ["purchase" "withdrawal"]
:categories [{:type "transportation"}]}
{:name "General"
:amount 100000
:currency-code "BRL"
:interval "week"
:schedule "everyday from 09:00 to 18:00 in America/Sao_Paulo"
:purposes ["purchase" "withdrawal"]}]}))
(def holder
(starkinfra.issuing-holder/get "5828610602565632" {:expand ["rules"]}))
(println holder)
Curl
curl --location --request PATCH '{{baseUrl}}/v2/issuing-holder/5828610602565632' \
--header 'Access-Id: {{accessId}}' \
--header 'Access-Time: {{accessTime}}' \
--header 'Access-Signature: {{accessSignature}}' \
--header 'Content-Type: application/json' \
--data-raw '{
"rules": [
{
"id": "5265660649144320",
"name": "Travel",
"amount": 150000,
"currencyCode": "BRL",
"interval": "month",
"schedule": "everyday from 09:00 to 18:00 in America/Sao_Paulo",
"purposes": ["purchase", "withdrawal"],
"categories": [
{"type": "transportation"}
]
},
{
"name": "General",
"amount": 100000,
"currencyCode": "BRL",
"interval": "week",
"schedule": "everyday from 09:00 to 18:00 in America/Sao_Paulo",
"purposes": ["purchase", "withdrawal"]
}
]
}'
Python
IssuingHolder(
id=5828610602565632,
name=Tony Stark,
tax_id=012.345.678-90,
external_id=my-holder-id-1234,
status=active,
tags=['department: tech'],
rules=[
IssuingRule(
id=5265660649144320,
name=Travel,
amount=150000,
interval=month,
currency_code=BRL,
currency_name=Brazilian Real,
currency_symbol=R$,
counter_amount=0,
schedule=everyday from 09:00 to 18:00 in America/Sao_Paulo,
purposes=['purchase', 'withdrawal'],
categories=[MerchantCategory(code=, name=, number=, type=transportation)],
countries=[],
methods=[]
),
IssuingRule(
id=6743406558576640,
name=General,
amount=100000,
interval=week,
currency_code=BRL,
currency_name=Brazilian Real,
currency_symbol=R$,
counter_amount=0,
schedule=everyday from 09:00 to 18:00 in America/Sao_Paulo,
purposes=['purchase', 'withdrawal'],
categories=[],
countries=[],
methods=[]
)
],
created=2022-01-01 00:00:00,
updated=2022-06-01 00:00:00
)
Javascript
IssuingHolder {
id: '5828610602565632',
name: 'Tony Stark',
taxId: '012.345.678-90',
externalId: 'my-holder-id-1234',
status: 'active',
tags: [ 'department: tech' ],
rules: [
IssuingRule {
id: '5265660649144320',
name: 'Travel',
amount: 150000,
interval: 'month',
currencyCode: 'BRL',
currencyName: 'Brazilian Real',
currencySymbol: 'R$',
counterAmount: 0,
schedule: 'everyday from 09:00 to 18:00 in America/Sao_Paulo',
purposes: [ 'purchase', 'withdrawal' ],
categories: [ { type: 'transportation' } ],
countries: [],
methods: []
},
IssuingRule {
id: '6743406558576640',
name: 'General',
amount: 100000,
interval: 'week',
currencyCode: 'BRL',
currencyName: 'Brazilian Real',
currencySymbol: 'R$',
counterAmount: 0,
schedule: 'everyday from 09:00 to 18:00 in America/Sao_Paulo',
purposes: [ 'purchase', 'withdrawal' ],
categories: [],
countries: [],
methods: []
}
],
created: '2022-01-01T00:00:00.000000+00:00',
updated: '2022-06-01T00:00:00.000000+00:00'
}
PHP
StarkInfra\IssuingHolder Object
(
[id] => 5828610602565632
[name] => Tony Stark
[taxId] => 012.345.678-90
[externalId] => my-holder-id-1234
[status] => active
[rules] => Array
(
[0] => StarkInfra\IssuingRule Object
(
[id] => 5265660649144320
[name] => Travel
[amount] => 150000
[interval] => month
[currencyCode] => BRL
[currencyName] => Brazilian Real
[currencySymbol] => R$
[counterAmount] => 0
[schedule] => everyday from 09:00 to 18:00 in America/Sao_Paulo
[purposes] => Array ( [0] => purchase [1] => withdrawal )
[categories] => Array ( [0] => StarkInfra\MerchantCategory Object ( [type] => transportation ) )
[countries] => Array ( )
[methods] => Array ( )
)
[1] => StarkInfra\IssuingRule Object
(
[id] => 6743406558576640
[name] => General
[amount] => 100000
[interval] => week
[currencyCode] => BRL
[currencyName] => Brazilian Real
[currencySymbol] => R$
[counterAmount] => 0
[schedule] => everyday from 09:00 to 18:00 in America/Sao_Paulo
[purposes] => Array ( [0] => purchase [1] => withdrawal )
[categories] => Array ( )
[countries] => Array ( )
[methods] => Array ( )
)
)
[tags] => Array ( [0] => department: tech )
[created] => DateTime Object ( [date] => 2022-01-01 00:00:00.000000 )
[updated] => DateTime Object ( [date] => 2022-06-01 00:00:00.000000 )
)
Java
IssuingHolder({
"id": "5828610602565632",
"name": "Tony Stark",
"taxId": "012.345.678-90",
"externalId": "my-holder-id-1234",
"status": "active",
"rules": [
{
"id": "5265660649144320",
"name": "Travel",
"interval": "month",
"amount": 150000,
"currencyCode": "BRL",
"currencyName": "Brazilian Real",
"currencySymbol": "R$",
"counterAmount": 0,
"schedule": "everyday from 09:00 to 18:00 in America/Sao_Paulo",
"purposes": ["purchase", "withdrawal"],
"categories": [{ "type": "transportation" }],
"countries": [],
"methods": []
},
{
"id": "6743406558576640",
"name": "General",
"interval": "week",
"amount": 100000,
"currencyCode": "BRL",
"currencyName": "Brazilian Real",
"currencySymbol": "R$",
"counterAmount": 0,
"schedule": "everyday from 09:00 to 18:00 in America/Sao_Paulo",
"purposes": ["purchase", "withdrawal"],
"categories": [],
"countries": [],
"methods": []
}
],
"tags": ["department: tech"],
"created": "2022-01-01T00:00:00.000000+00:00",
"updated": "2022-06-01T00:00:00.000000+00:00"
})
Ruby
issuingholder(
id: 5828610602565632,
name: Tony Stark,
tax_id: 012.345.678-90,
external_id: my-holder-id-1234,
status: active,
tags: ["department: tech"],
rules: [
issuingrule(
id: 5265660649144320,
name: Travel,
amount: 150000,
interval: month,
currency_code: BRL,
currency_name: Brazilian Real,
currency_symbol: R$,
counter_amount: 0,
schedule: everyday from 09:00 to 18:00 in America/Sao_Paulo,
purposes: ["purchase", "withdrawal"],
categories: [merchantcategory(type: transportation)],
countries: [],
methods: []
),
issuingrule(
id: 6743406558576640,
name: General,
amount: 100000,
interval: week,
currency_code: BRL,
currency_name: Brazilian Real,
currency_symbol: R$,
counter_amount: 0,
schedule: everyday from 09:00 to 18:00 in America/Sao_Paulo,
purposes: ["purchase", "withdrawal"],
categories: [],
countries: [],
methods: []
)
],
created: 2022-01-01T00:00:00+00:00,
updated: 2022-06-01T00:00:00+00:00
)
Elixir
%StarkInfra.IssuingHolder{
id: "5828610602565632",
name: "Tony Stark",
tax_id: "012.345.678-90",
external_id: "my-holder-id-1234",
status: "active",
tags: ["department: tech"],
rules: [
%StarkInfra.IssuingRule{
id: "5265660649144320",
name: "Travel",
amount: 150000,
interval: "month",
currency_code: "BRL",
currency_name: "Brazilian Real",
currency_symbol: "R$",
counter_amount: 0,
schedule: "everyday from 09:00 to 18:00 in America/Sao_Paulo",
purposes: ["purchase", "withdrawal"],
categories: [%StarkInfra.MerchantCategory{type: "transportation"}],
countries: [],
methods: []
},
%StarkInfra.IssuingRule{
id: "6743406558576640",
name: "General",
amount: 100000,
interval: "week",
currency_code: "BRL",
currency_name: "Brazilian Real",
currency_symbol: "R$",
counter_amount: 0,
schedule: "everyday from 09:00 to 18:00 in America/Sao_Paulo",
purposes: ["purchase", "withdrawal"],
categories: [],
countries: [],
methods: []
}
],
created: "2022-01-01T00:00:00.000000+00:00",
updated: "2022-06-01T00:00:00.000000+00:00"
}
C#
IssuingHolder(
Id: 5828610602565632,
Name: Tony Stark,
TaxId: 012.345.678-90,
ExternalId: my-holder-id-1234,
Status: active,
Rules: [
IssuingRule(
Id: 5265660649144320,
Name: Travel,
Amount: 150000,
Interval: month,
CurrencyCode: BRL,
CurrencyName: Brazilian Real,
CurrencySymbol: R$,
CounterAmount: 0,
Schedule: everyday from 09:00 to 18:00 in America/Sao_Paulo,
Purposes: [purchase, withdrawal],
Categories: [MerchantCategory(Type: transportation)],
Countries: [],
Methods: []
),
IssuingRule(
Id: 6743406558576640,
Name: General,
Amount: 100000,
Interval: week,
CurrencyCode: BRL,
CurrencyName: Brazilian Real,
CurrencySymbol: R$,
CounterAmount: 0,
Schedule: everyday from 09:00 to 18:00 in America/Sao_Paulo,
Purposes: [purchase, withdrawal],
Categories: [],
Countries: [],
Methods: []
)
],
Tags: [department: tech],
Updated: 06/01/2022 00:00:00,
Created: 01/01/2022 00:00:00
)
Go
{
Name:Tony Stark
TaxId:012.345.678-90
ExternalId:my-holder-id-1234
Rules:[{Id:5265660649144320 Name:Travel Amount:150000 Interval:month CurrencyCode:BRL CurrencyName:Brazilian Real CurrencySymbol:R$ CounterAmount:0 Schedule:everyday from 09:00 to 18:00 in America/Sao_Paulo Purposes:[purchase withdrawal] Categories:[{Type:transportation}] Countries:[] Methods:[]} {Id:6743406558576640 Name:General Amount:100000 Interval:week CurrencyCode:BRL CurrencyName:Brazilian Real CurrencySymbol:R$ CounterAmount:0 Schedule:everyday from 09:00 to 18:00 in America/Sao_Paulo Purposes:[purchase withdrawal] Categories:[] Countries:[] Methods:[]}]
Tags:[department: tech]
Id:5828610602565632
Status:active
Updated:2022-06-01 00:00:00 +0000 +0000
Created:2022-01-01 00:00:00 +0000 +0000
}
Clojure
{:id "5828610602565632",
:name "Tony Stark",
:status "active",
:rules [{:id "5265660649144320"
:name "Travel"
:amount 150000
:interval "month"
:currency-code "BRL"
:counter-amount 0
:schedule "everyday from 09:00 to 18:00 in America/Sao_Paulo"
:purposes ["purchase" "withdrawal"]}
{:id "6743406558576640"
:name "General"
:amount 100000
:interval "week"
:currency-code "BRL"
:counter-amount 0
:schedule "everyday from 09:00 to 18:00 in America/Sao_Paulo"
:purposes ["purchase" "withdrawal"]}],
:created "2022-01-01T00:00:00.000000+00:00",
:updated "2022-06-01T00:00:00.000000+00:00"}
Curl
{
"holder": {
"id": "5828610602565632",
"name": "Tony Stark",
"taxId": "012.345.678-90",
"externalId": "my-holder-id-1234",
"status": "active",
"tags": ["department: tech"],
"rules": [
{
"id": "5265660649144320",
"name": "Travel",
"interval": "month",
"amount": 150000,
"currencyCode": "BRL",
"currencyName": "Brazilian Real",
"currencySymbol": "R$",
"counterAmount": 0,
"schedule": "everyday from 09:00 to 18:00 in America/Sao_Paulo",
"purposes": ["purchase", "withdrawal"],
"categories": [{"type": "transportation"}],
"countries": [],
"methods": []
},
{
"id": "6743406558576640",
"name": "General",
"interval": "week",
"amount": 100000,
"currencyCode": "BRL",
"currencyName": "Brazilian Real",
"currencySymbol": "R$",
"counterAmount": 0,
"schedule": "everyday from 09:00 to 18:00 in America/Sao_Paulo",
"purposes": ["purchase", "withdrawal"],
"categories": [],
"countries": [],
"methods": []
}
]
}
}
Issuing Purchase Overview
An Issuing Purchase is a transaction made with an Issuing Card. You never create purchases yourself — they appear in real time, when a cardholder pays at a merchant and the authorization is approved.
How purchases reach you. When a card is used, the network sends us an authorization request. We fire an issuing-purchase Webhook event so you can approve or deny it on the spot; the approved (or denied) purchase is then persisted and can be queried here. See the Handling Purchase Events section to learn how to answer authorizations and react to status changes.
Merchant vs. issuer amount. When a purchase is made in a currency other than your own, the same money is recorded twice: merchantAmount (in merchantCurrencyCode, what the merchant charged) and issuerAmount (in issuerCurrencyCode, what is debited from your Issuing Balance after FX conversion). All amounts are integers in cents.
Installments. installmentCount is how many installments the purchase was split into (1 for a single, upfront charge). Each installment settles separately, so a single purchase can produce more than one confirmation over time.
endToEndId. Every purchase carries an endToEndId, the unique transaction identifier shared across the network. Use it to reconcile a purchase with the acquirer or to filter the listing (endToEndIds).
Ledger link. Once a purchase affects your balance, issuingTransactionIds lists the Issuing Transaction entries it generated — that's the bridge between a purchase and your ledger.
metadata. When a purchase came from an authorization you answered, metadata carries its authorizationId; otherwise it's an empty object.
Purchase Statuses
Each Issuing Purchase has a status that reflects where it is in its life cycle. Status changes are driven by the network and the sub-issuer — not by you:

| Status | Description |
|---|---|
| approved | The authorization request was approved by the sub-issuer or by the network/issuer default protocol. The amount is reserved for future settlement. |
| confirmed | The purchase was settled by the network. At this point the money is transferred through the network. |
| voided | The purchase was fully reversed and is no longer in effect. |
| canceled | An approved purchase was canceled by the acquirer. The reserved amount goes back to your Issuing Balance. |
| denied | The authorization request was denied by the sub-issuer or by the network/issuer default protocol. |
Purchase Logs
Every change to an Issuing Purchase creates a Log entry. Logs are how you follow a purchase through its life cycle: each authorization, settlement, reversal and edit becomes one log. Whenever a new Log is created, we fire a Webhook to your registered URL (see Handling Purchase Events).
A log's type is one of: approved, denied, confirmed, reversed (some amount was reversed, partially or fully), voided (the purchase was fully reversed), canceled and updated (you set a description or tags). Note that reversed is a log type but not a purchase status — a partial reversal logs reversed while the purchase stays confirmed.
Each log carries the purchase as it was at that point (shown abbreviated with "..."), plus installment (which installment the log refers to) and issuingTransactionId (the ledger entry tied to this step). Query logs with GET /v2/issuing-purchase/log or fetch one with GET /v2/issuing-purchase/log/:id.
Corner Cases
A few unusual authorization scenarios are worth knowing about:
Corner case 1. The network does not send us the authorization request and instead only notifies us that it approved or denied a purchase, without our (or your) permission — for example, in the unlikely event of a communication failure between us and the network.

Corner case 2. Common at gas stations in the USA: the cardholder sends the authorization request before filling the tank just to check the card data. Once the fuel is in the car and can no longer be retrieved, we are only notified of the final value charged, since it can no longer be denied.

Corner case 3. The merchant sends cash to the holder, producing an Issuing Purchase with a negative amount (e.g. a bonus or benefit to a recurring customer). In this case the interchange is retained by the acquirer and does not reach us (or you).

Corner case 4. New authorization requests can reference the same purchase, incrementing the original amount. These incremental authorizations share the same endToEndId as the previous ones — for example, when a ride-hailing app extends a previous authorization after a route change or delay.

Default Authorization Cases
These cases happen when your sub-issuer fails to respond to the authorization request in time and our default authorization protocol is triggered (governed by the defaultAuthorizationMaxAmount and defaultAuthorizationMinScore you set during setup).
Case 1. The authorization request reaches your endpoint, but the default authorization protocol denies an authorization your system had approved, or vice-versa:

Case 2. When the default authorization protocol is triggered, the request may be approved with a different amount than expected. For example, when the merchant allows a partial amount and the holder doesn't have the full amount, your system could approve a smaller amount — but if the default protocol is triggered, the purchase may be fully approved instead.

NOTE: prepare for concurrency — we may have already detected a timeout on your endpoint and sent you the corresponding approved/denied event while your system is still processing the authorization. If left unchecked, you could register two purchases with the same endToEndId.
Parsing an authorization request
When a holder uses our card, Stark Infra receives an authorization message from the card network, and POSTs a synchronous authorization request to the authorizationUrl you registered during Setup — see the Authorization flow for the full contract.
Verify the request really came from us before trusting it: pass the raw body and the Digital-Signature header to the SDK's parse method, which checks the signature against Stark Infra's public key and returns the Issuing Purchase to analyze. Then answer with {"authorization": {"status": "approved"}} (optionally overriding amount or attaching tags) or {"authorization": {"status": "denied", "reason": "..."}} with one of the accepted denial reasons.
Parameters
Python
import starkinfra
request = listen()
authorization = starkinfra.issuingpurchase.parse(
content=request.data.decode("utf-8"),
signature=request.headers["Digital-Signature"],
)
print(authorization)
denyReason = yourAuthorizationLogic(authorization)
if denyReason:
return sendResponse(starkinfra.issuingpurchase.response(status="denied", reason=denyReason))
return sendResponse(starkinfra.issuingpurchase.response(status="approved"))
Javascript
const starkinfra = require('starkinfra');
let request = listen();
let authorization = await starkinfra.issuingPurchase.parse(
request.body.toString(),
request.headers['digital-signature']
);
console.log(authorization);
let denyReason = yourAuthorizationLogic(authorization);
if (denyReason) {
return sendResponse(await starkinfra.issuingPurchase.response({status: 'denied', reason: denyReason}));
}
return sendResponse(await starkinfra.issuingPurchase.response({status: 'approved'}));
PHP
use StarkInfra\IssuingPurchase;
$request = listen(); # this is your handler to listen for authorization requests
$authorization = IssuingPurchase::parse(
$request->content,
$request->headers["Digital-Signature"]
);
print_r($authorization);
$denyReason = yourAuthorizationLogic($authorization);
if ($denyReason) {
sendResponse(IssuingPurchase::response(["status" => "denied", "reason" => $denyReason]));
} else {
sendResponse(IssuingPurchase::response(["status" => "approved"]));
}
Java
import com.starkinfra.*;
Request request = Listener.listen(); // this is your handler to listen for authorization requests
String content = request.content.toString();
String signature = request.headers.get("Digital-Signature");
IssuingPurchase authorization = IssuingPurchase.parse(content, signature);
System.out.println(authorization);
String denyReason = yourAuthorizationLogic(authorization);
if (denyReason != null) {
sendResponse(IssuingPurchase.response("denied", denyReason));
}
else {
sendResponse(IssuingPurchase.response("approved"));
}
Ruby
require('starkinfra')
request = listen() # this is your handler to listen for authorization requests
authorization = StarkInfra::IssuingPurchase.parse(
content: request.body.read,
signature: request.headers['Digital-Signature']
)
puts authorization
deny_reason = your_authorization_logic(authorization)
if deny_reason
send_response(StarkInfra::IssuingPurchase.response(status: 'denied', reason: deny_reason))
else
send_response(StarkInfra::IssuingPurchase.response(status: 'approved'))
end
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
{
"acquirerId": "5656565656565656",
"amount": 5000,
"cardId": "7834882116598271",
"cardTags": [],
"endToEndId": "79fcf95d-1dfb-40db-9fa8-679e329c58f0",
"holderId": "5917814565109760",
"holderTags": [],
"isPartialAllowed": false,
"issuerAmount": 5000,
"issuerCurrencyCode": "BRL",
"merchantAmount": 5000,
"merchantCategoryCode": "fastFoodRestaurants",
"merchantCountryCode": "BRA",
"merchantCurrencyCode": "BRL",
"merchantFee": 0,
"merchantId": "5656565656565656",
"merchantName": "Stark Store",
"methodCode": "chip",
"purpose": "purchase",
"score": 0.9775689825217906,
"tax": 0,
"walletId": ""
}
Python
IssuingPurchase(
acquirer_id=5656565656565656,
amount=5000,
card_id=7834882116598271,
card_tags=[],
end_to_end_id=79fcf95d-1dfb-40db-9fa8-679e329c58f0,
holder_id=5917814565109760,
holder_tags=[],
is_partial_allowed=False,
issuer_amount=5000,
issuer_currency_code=BRL,
merchant_amount=5000,
merchant_category_code=fastFoodRestaurants,
merchant_country_code=BRA,
merchant_currency_code=BRL,
merchant_fee=0,
merchant_id=5656565656565656,
merchant_name=Stark Store,
method_code=chip,
purpose=purchase,
score=0.9775689825217906,
tax=0,
wallet_id=
)
Javascript
IssuingPurchase {
cardId: '7834882116598271',
purpose: 'purchase',
amount: 5000,
tax: 0,
issuerAmount: 5000,
issuerCurrencyCode: 'BRL',
merchantAmount: 5000,
merchantCurrencyCode: 'BRL',
merchantCategoryCode: 'fastFoodRestaurants',
merchantCountryCode: 'BRA',
acquirerId: '5656565656565656',
merchantId: '5656565656565656',
merchantName: 'Stark Store',
merchantFee: 0,
walletId: '',
methodCode: 'chip',
score: 0.9775689825217906,
endToEndId: '79fcf95d-1dfb-40db-9fa8-679e329c58f0',
isPartialAllowed: false,
cardTags: [],
holderId: '5917814565109760',
holderTags: []
}
PHP
StarkInfra\IssuingPurchase Object
(
[acquirerId] => 5656565656565656
[amount] => 5000
[cardId] => 7834882116598271
[cardTags] => Array ( )
[endToEndId] => 79fcf95d-1dfb-40db-9fa8-679e329c58f0
[holderId] => 5917814565109760
[holderTags] => Array ( )
[isPartialAllowed] =>
[issuerAmount] => 5000
[issuerCurrencyCode] => BRL
[merchantAmount] => 5000
[merchantCategoryCode] => fastFoodRestaurants
[merchantCountryCode] => BRA
[merchantCurrencyCode] => BRL
[merchantFee] => 0
[merchantId] => 5656565656565656
[merchantName] => Stark Store
[methodCode] => chip
[purpose] => purchase
[score] => 0.9775689825217906
[tax] => 0
[walletId] =>
)
Java
IssuingPurchase({
"acquirerId": "5656565656565656",
"amount": 5000,
"cardId": "7834882116598271",
"cardTags": [],
"endToEndId": "79fcf95d-1dfb-40db-9fa8-679e329c58f0",
"holderId": "5917814565109760",
"holderTags": [],
"isPartialAllowed": false,
"issuerAmount": 5000,
"issuerCurrencyCode": "BRL",
"merchantAmount": 5000,
"merchantCategoryCode": "fastFoodRestaurants",
"merchantCountryCode": "BRA",
"merchantCurrencyCode": "BRL",
"merchantFee": 0,
"merchantId": "5656565656565656",
"merchantName": "Stark Store",
"methodCode": "chip",
"purpose": "purchase",
"score": 0.9775689825217906,
"tax": 0,
"walletId": ""
})
Ruby
issuingpurchase(
acquirer_id: 5656565656565656,
amount: 5000,
card_id: 7834882116598271,
card_tags: [],
end_to_end_id: 79fcf95d-1dfb-40db-9fa8-679e329c58f0,
holder_id: 5917814565109760,
holder_tags: [],
is_partial_allowed: false,
issuer_amount: 5000,
issuer_currency_code: BRL,
merchant_amount: 5000,
merchant_category_code: fastFoodRestaurants,
merchant_country_code: BRA,
merchant_currency_code: BRL,
merchant_fee: 0,
merchant_id: 5656565656565656,
merchant_name: Stark Store,
method_code: chip,
purpose: purchase,
score: 0.9775689825217906,
tax: 0,
wallet_id:
)
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
Listing purchases
List purchases in pages of up to 100. Filter by "status" (one of the purchase statuses), "cardIds", "holderIds", "endToEndIds", "ids", "tags" and the "after" / "before" date range.
The "issuerAmount" / "merchantAmount" split and the populated "metadata.authorizationId" are visible here — use them to reconcile each purchase against the merchant charge and the authorization you answered.
Parameters
Python
import starkinfra
purchases = starkinfra.issuingpurchase.query(
limit=10,
status="approved"
)
for purchase in purchases:
print(purchase)
Javascript
const starkinfra = require('starkinfra');
(async() => {
let purchases = await starkinfra.issuingPurchase.query({
limit: 10,
status: 'approved'
});
for await (let purchase of purchases) {
console.log(purchase);
}
})();
PHP
$purchases = StarkInfra\IssuingPurchase::query([
"limit" => 10,
"status" => "approved"
]);
foreach ($purchases as $purchase) {
print_r($purchase);
}
Java
import com.starkinfra.*; import java.util.HashMap; HashMapparams = new HashMap<>(); params.put("limit", 10); params.put("status", "approved"); Generator purchases = IssuingPurchase.query(params); for (IssuingPurchase purchase : purchases) { System.out.println(purchase); }
Ruby
require('starkinfra')
purchases = StarkInfra::IssuingPurchase.query(
limit: 10,
status: "approved"
)
purchases.each do |purchase|
puts purchase
end
Elixir
purchases = StarkInfra.IssuingPurchase.query!(
limit: 10,
status: "approved"
)
purchases |> Enum.each(&IO.inspect/1)
C#
using System; using System.Collections.Generic; IEnumerablepurchases = StarkInfra.IssuingPurchase.Query( limit: 10, status: "approved" ); foreach (StarkInfra.IssuingPurchase purchase in purchases) { Console.WriteLine(purchase); }
Go
package main
import (
"fmt"
"github.com/starkinfra/sdk-go/starkinfra/issuingpurchase"
)
func main() {
var params = map[string]interface{}{}
params["limit"] = 10
params["status"] = "approved"
purchases := issuingpurchase.Query(params, nil)
for purchase := range purchases {
fmt.Printf("%+v", purchase)
}
}
Clojure
Not yet available. Please contact us if you need this SDK.
Curl
curl --location --request GET '{{baseUrl}}/v2/issuing-purchase?limit=10&status=approved' \
--header 'Access-Id: {{accessId}}' \
--header 'Access-Time: {{accessTime}}' \
--header 'Access-Signature: {{accessSignature}}'
Python
IssuingPurchase(
id=5715709195239424,
holder_name=Tony Stark,
product_id=654321,
card_id=7834882116598271,
card_ending=1234,
purpose=purchase,
installment_count=1,
amount=5000,
tax=0,
issuer_amount=5000,
issuer_currency_code=BRL,
issuer_currency_symbol=R$,
merchant_amount=5000,
merchant_currency_code=BRL,
merchant_currency_symbol=R$,
merchant_category_code=fastFoodRestaurants,
merchant_category_number=5814,
merchant_category_type=food,
merchant_country_code=BRA,
acquirer_id=5656565656565656,
merchant_id=5656565656565656,
merchant_name=Stark Store,
merchant_fee=0,
wallet_id=None,
method_code=chip,
score=0.9775689825217906,
end_to_end_id=79fcf95d-1dfb-40db-9fa8-679e329c58f0,
tags=[],
issuing_transaction_ids=['5155165527080960'],
status=approved,
description=,
metadata={},
zip_code=01311-000,
confirmed=2022-01-01 00:00:02,
created=2022-01-01 00:00:00,
updated=2022-01-01 00:00:00
)
Javascript
IssuingPurchase {
id: '5715709195239424',
holderName: 'Tony Stark',
productId: '654321',
cardId: '7834882116598271',
cardEnding: '1234',
purpose: 'purchase',
installmentCount: 1,
amount: 5000,
tax: 0,
issuerAmount: 5000,
issuerCurrencyCode: 'BRL',
issuerCurrencySymbol: 'R$',
merchantAmount: 5000,
merchantCurrencyCode: 'BRL',
merchantCurrencySymbol: 'R$',
merchantCategoryCode: 'fastFoodRestaurants',
merchantCategoryNumber: 5814,
merchantCategoryType: 'food',
merchantCountryCode: 'BRA',
acquirerId: '5656565656565656',
merchantId: '5656565656565656',
merchantName: 'Stark Store',
merchantFee: 0,
walletId: null,
methodCode: 'chip',
score: 0.9775689825217906,
endToEndId: '79fcf95d-1dfb-40db-9fa8-679e329c58f0',
tags: [],
issuingTransactionIds: [ '5155165527080960' ],
status: 'approved',
description: '',
confirmed: '2022-01-01T00:00:02.000000+00:00',
metadata: {},
zipCode: '01311-000',
created: '2022-01-01T00:00:00.000000+00:00',
updated: '2022-01-01T00:00:00.000000+00:00'
}
PHP
StarkInfra\IssuingPurchase Object
(
[id] => 5715709195239424
[holderName] => Tony Stark
[productId] => 654321
[cardId] => 7834882116598271
[cardEnding] => 1234
[purpose] => purchase
[installmentCount] => 1
[amount] => 5000
[tax] => 0
[merchantFee] => 0
[issuerAmount] => 5000
[issuerCurrencyCode] => BRL
[issuerCurrencySymbol] => R$
[merchantAmount] => 5000
[merchantCurrencyCode] => BRL
[merchantCurrencySymbol] => R$
[merchantCategoryCode] => fastFoodRestaurants
[merchantCategoryNumber] => 5814
[merchantCategoryType] => food
[merchantCountryCode] => BRA
[acquirerId] => 5656565656565656
[merchantId] => 5656565656565656
[merchantName] => Stark Store
[walletId] =>
[methodCode] => chip
[score] => 0.9775689825217906
[issuingTransactionIds] => Array ( [0] => 5155165527080960 )
[endToEndId] => 79fcf95d-1dfb-40db-9fa8-679e329c58f0
[zipCode] => 01311-000
[status] => approved
[tags] => Array ( )
[metadata] => Array ( )
[description] =>
[confirmed] => DateTime Object ( [date] => 2022-01-01 00:00:02.000000 )
[created] => DateTime Object ( [date] => 2022-01-01 00:00:00.000000 )
[updated] => DateTime Object ( [date] => 2022-01-01 00:00:00.000000 )
)
Java
IssuingPurchase({
"id": "5715709195239424",
"holderName": "Tony Stark",
"productId": "654321",
"cardId": "7834882116598271",
"cardEnding": "1234",
"purpose": "purchase",
"installmentCount": 1,
"amount": 5000,
"tax": 0,
"merchantFee": 0,
"issuerAmount": 5000,
"issuerCurrencyCode": "BRL",
"issuerCurrencySymbol": "R$",
"merchantAmount": 5000,
"merchantCurrencyCode": "BRL",
"merchantCurrencySymbol": "R$",
"merchantCategoryCode": "fastFoodRestaurants",
"merchantCategoryNumber": 5814,
"merchantCategoryType": "food",
"merchantCountryCode": "BRA",
"acquirerId": "5656565656565656",
"merchantId": "5656565656565656",
"merchantName": "Stark Store",
"walletId": null,
"methodCode": "chip",
"score": 0.9775689825217906,
"issuingTransactionIds": ["5155165527080960"],
"endToEndId": "79fcf95d-1dfb-40db-9fa8-679e329c58f0",
"zipCode": "01311-000",
"status": "approved",
"tags": [],
"metadata": {},
"description": "",
"confirmed": "2022-01-01T00:00:02.000000+00:00",
"created": "2022-01-01T00:00:00.000000+00:00",
"updated": "2022-01-01T00:00:00.000000+00:00"
})
Ruby
issuingpurchase(
id: 5715709195239424,
holder_name: Tony Stark,
product_id: 654321,
card_id: 7834882116598271,
card_ending: 1234,
purpose: purchase,
installment_count: 1,
amount: 5000,
tax: 0,
issuer_amount: 5000,
issuer_currency_code: BRL,
issuer_currency_symbol: R$,
merchant_amount: 5000,
merchant_currency_code: BRL,
merchant_currency_symbol: R$,
merchant_category_code: fastFoodRestaurants,
merchant_category_number: 5814,
merchant_category_type: food,
merchant_country_code: BRA,
acquirer_id: 5656565656565656,
merchant_id: 5656565656565656,
merchant_name: Stark Store,
merchant_fee: 0,
wallet_id: nil,
method_code: chip,
score: 0.9775689825217906,
end_to_end_id: 79fcf95d-1dfb-40db-9fa8-679e329c58f0,
tags: [],
issuing_transaction_ids: ["5155165527080960"],
status: approved,
description: ,
metadata: {},
zip_code: 01311-000,
confirmed: 2022-01-01T00:00:02+00:00,
created: 2022-01-01T00:00:00+00:00,
updated: 2022-01-01T00:00:00+00:00
)
Elixir
%StarkInfra.IssuingPurchase{
id: "5715709195239424",
holder_name: "Tony Stark",
product_id: "654321",
card_id: "7834882116598271",
card_ending: "1234",
purpose: "purchase",
installment_count: 1,
amount: 5000,
tax: 0,
merchant_fee: 0,
issuer_amount: 5000,
issuer_currency_code: "BRL",
issuer_currency_symbol: "R$",
merchant_amount: 5000,
merchant_currency_code: "BRL",
merchant_currency_symbol: "R$",
merchant_category_code: "fastFoodRestaurants",
merchant_category_number: 5814,
merchant_category_type: "food",
merchant_country_code: "BRA",
acquirer_id: "5656565656565656",
merchant_id: "5656565656565656",
merchant_name: "Stark Store",
wallet_id: nil,
method_code: "chip",
score: 0.9775689825217906,
issuing_transaction_ids: ["5155165527080960"],
end_to_end_id: "79fcf95d-1dfb-40db-9fa8-679e329c58f0",
zip_code: "01311-000",
status: "approved",
tags: [],
metadata: %{},
description: "",
confirmed: "2022-01-01T00:00:02.000000+00:00",
created: "2022-01-01T00:00:00.000000+00:00",
updated: "2022-01-01T00:00:00.000000+00:00"
}
C#
IssuingPurchase(
Id: 5715709195239424,
HolderName: Tony Stark,
ProductId: 654321,
CardId: 7834882116598271,
CardEnding: 1234,
Purpose: purchase,
InstallmentCount: 1,
Amount: 5000,
Tax: 0,
MerchantFee: 0,
IssuerAmount: 5000,
IssuerCurrencyCode: BRL,
IssuerCurrencySymbol: R$,
MerchantAmount: 5000,
MerchantCurrencyCode: BRL,
MerchantCurrencySymbol: R$,
MerchantCategoryCode: fastFoodRestaurants,
MerchantCategoryNumber: 5814,
MerchantCategoryType: food,
MerchantCountryCode: BRA,
AcquirerId: 5656565656565656,
MerchantId: 5656565656565656,
MerchantName: Stark Store,
WalletId: ,
MethodCode: chip,
Score: 0.9775689825217906,
IssuingTransactionIds: [5155165527080960],
EndToEndId: 79fcf95d-1dfb-40db-9fa8-679e329c58f0,
ZipCode: 01311-000,
Status: approved,
Tags: [],
Metadata: {},
Description: ,
Confirmed: 01/01/2022 00:00:02,
Created: 01/01/2022 00:00:00,
Updated: 01/01/2022 00:00:00
)
Go
{
Id:5715709195239424
HolderName:Tony Stark
ProductId:654321
CardId:7834882116598271
CardEnding:1234
Purpose:purchase
InstallmentCount:1
Amount:5000
Tax:0
MerchantFee:0
IssuerAmount:5000
IssuerCurrencyCode:BRL
IssuerCurrencySymbol:R$
MerchantAmount:5000
MerchantCurrencyCode:BRL
MerchantCurrencySymbol:R$
MerchantCategoryCode:fastFoodRestaurants
MerchantCategoryNumber:5814
MerchantCategoryType:food
MerchantCountryCode:BRA
AcquirerId:5656565656565656
MerchantId:5656565656565656
MerchantName:Stark Store
WalletId:
MethodCode:chip
Score:0.9775689825217906
IssuingTransactionIds:[5155165527080960]
EndToEndId:79fcf95d-1dfb-40db-9fa8-679e329c58f0
ZipCode:01311-000
Status:approved
Tags:[]
Metadata:map[]
Description:
Confirmed:2022-01-01 00:00:02 +0000 +0000
Updated:2022-01-01 00:00:00 +0000 +0000
Created:2022-01-01 00:00:00 +0000 +0000
}
Clojure
Not yet available. Please contact us if you need this SDK.
Curl
{
"cursor": null,
"purchases": [
{
"id": "5715709195239424",
"holderName": "Tony Stark",
"productId": "654321",
"cardId": "7834882116598271",
"cardEnding": "1234",
"purpose": "purchase",
"installmentCount": 1,
"amount": 5000,
"tax": 0,
"merchantFee": 0,
"issuerAmount": 5000,
"issuerCurrencyCode": "BRL",
"issuerCurrencySymbol": "R$",
"merchantAmount": 5000,
"merchantCurrencyCode": "BRL",
"merchantCurrencySymbol": "R$",
"merchantCategoryCode": "fastFoodRestaurants",
"merchantCategoryNumber": 5814,
"merchantCategoryType": "food",
"merchantCountryCode": "BRA",
"acquirerId": "5656565656565656",
"merchantId": "5656565656565656",
"merchantName": "Stark Store",
"walletId": null,
"methodCode": "chip",
"score": 0.9775689825217906,
"issuingTransactionIds": ["5155165527080960"],
"endToEndId": "79fcf95d-1dfb-40db-9fa8-679e329c58f0",
"zipCode": "01311-000",
"status": "approved",
"tags": [],
"metadata": {},
"description": "",
"confirmed": "2022-01-01T00:00:02.000000+00:00",
"created": "2022-01-01T00:00:00.000000+00:00",
"updated": "2022-01-01T00:00:00.000000+00:00"
}
]
}
Getting a purchase
Fetch a single purchase by its id. The "issuingTransactionIds" field links it to the ledger Issuing Transaction entries it generated.
Parameters
Python
import starkinfra
purchase = starkinfra.issuingpurchase.get("5715709195239424")
print(purchase)
Javascript
const starkinfra = require('starkinfra');
(async() => {
let purchase = await starkinfra.issuingPurchase.get('5715709195239424');
console.log(purchase);
})();
PHP
$purchase = StarkInfra\IssuingPurchase::get("5715709195239424");
print_r($purchase);
Java
import com.starkinfra.*;
IssuingPurchase purchase = IssuingPurchase.get("5715709195239424");
System.out.println(purchase);
Ruby
require('starkinfra')
purchase = StarkInfra::IssuingPurchase.get("5715709195239424")
puts purchase
Elixir
purchase = StarkInfra.IssuingPurchase.get!("5715709195239424")
IO.inspect(purchase)
C#
using System;
StarkInfra.IssuingPurchase purchase = StarkInfra.IssuingPurchase.Get("5715709195239424");
Console.WriteLine(purchase);
Go
package main
import (
"fmt"
"github.com/starkinfra/sdk-go/starkinfra/issuingpurchase"
)
func main() {
purchase, err := issuingpurchase.Get("5715709195239424", nil)
if err.Errors != nil {
for _, e := range err.Errors {
fmt.Printf("code: %s, message: %s", e.Code, e.Message)
}
}
fmt.Printf("%+v", purchase)
}
Clojure
Not yet available. Please contact us if you need this SDK.
Curl
curl --location --request GET '{{baseUrl}}/v2/issuing-purchase/5715709195239424' \
--header 'Access-Id: {{accessId}}' \
--header 'Access-Time: {{accessTime}}' \
--header 'Access-Signature: {{accessSignature}}'
Python
IssuingPurchase(
id=5715709195239424,
holder_name=Tony Stark,
product_id=654321,
card_id=7834882116598271,
card_ending=1234,
purpose=purchase,
installment_count=1,
amount=5000,
tax=0,
issuer_amount=5000,
issuer_currency_code=BRL,
issuer_currency_symbol=R$,
merchant_amount=5000,
merchant_currency_code=BRL,
merchant_currency_symbol=R$,
merchant_category_code=fastFoodRestaurants,
merchant_category_number=5814,
merchant_category_type=food,
merchant_country_code=BRA,
acquirer_id=5656565656565656,
merchant_id=5656565656565656,
merchant_name=Stark Store,
merchant_fee=0,
wallet_id=None,
method_code=chip,
score=0.9775689825217906,
end_to_end_id=79fcf95d-1dfb-40db-9fa8-679e329c58f0,
tags=[],
issuing_transaction_ids=['5155165527080960'],
status=approved,
description=,
metadata={},
zip_code=01311-000,
confirmed=2022-01-01 00:00:02,
created=2022-01-01 00:00:00,
updated=2022-01-01 00:00:00
)
Javascript
IssuingPurchase {
id: '5715709195239424',
holderName: 'Tony Stark',
productId: '654321',
cardId: '7834882116598271',
cardEnding: '1234',
purpose: 'purchase',
installmentCount: 1,
amount: 5000,
tax: 0,
issuerAmount: 5000,
issuerCurrencyCode: 'BRL',
issuerCurrencySymbol: 'R$',
merchantAmount: 5000,
merchantCurrencyCode: 'BRL',
merchantCurrencySymbol: 'R$',
merchantCategoryCode: 'fastFoodRestaurants',
merchantCategoryNumber: 5814,
merchantCategoryType: 'food',
merchantCountryCode: 'BRA',
acquirerId: '5656565656565656',
merchantId: '5656565656565656',
merchantName: 'Stark Store',
merchantFee: 0,
walletId: null,
methodCode: 'chip',
score: 0.9775689825217906,
endToEndId: '79fcf95d-1dfb-40db-9fa8-679e329c58f0',
tags: [],
issuingTransactionIds: [ '5155165527080960' ],
status: 'approved',
description: '',
confirmed: '2022-01-01T00:00:02.000000+00:00',
metadata: {},
zipCode: '01311-000',
created: '2022-01-01T00:00:00.000000+00:00',
updated: '2022-01-01T00:00:00.000000+00:00'
}
PHP
StarkInfra\IssuingPurchase Object
(
[id] => 5715709195239424
[holderName] => Tony Stark
[productId] => 654321
[cardId] => 7834882116598271
[cardEnding] => 1234
[purpose] => purchase
[installmentCount] => 1
[amount] => 5000
[tax] => 0
[merchantFee] => 0
[issuerAmount] => 5000
[issuerCurrencyCode] => BRL
[issuerCurrencySymbol] => R$
[merchantAmount] => 5000
[merchantCurrencyCode] => BRL
[merchantCurrencySymbol] => R$
[merchantCategoryCode] => fastFoodRestaurants
[merchantCategoryNumber] => 5814
[merchantCategoryType] => food
[merchantCountryCode] => BRA
[acquirerId] => 5656565656565656
[merchantId] => 5656565656565656
[merchantName] => Stark Store
[walletId] =>
[methodCode] => chip
[score] => 0.9775689825217906
[issuingTransactionIds] => Array ( [0] => 5155165527080960 )
[endToEndId] => 79fcf95d-1dfb-40db-9fa8-679e329c58f0
[zipCode] => 01311-000
[status] => approved
[tags] => Array ( )
[metadata] => Array ( )
[description] =>
[confirmed] => DateTime Object ( [date] => 2022-01-01 00:00:02.000000 )
[created] => DateTime Object ( [date] => 2022-01-01 00:00:00.000000 )
[updated] => DateTime Object ( [date] => 2022-01-01 00:00:00.000000 )
)
Java
IssuingPurchase({
"id": "5715709195239424",
"holderName": "Tony Stark",
"productId": "654321",
"cardId": "7834882116598271",
"cardEnding": "1234",
"purpose": "purchase",
"installmentCount": 1,
"amount": 5000,
"tax": 0,
"merchantFee": 0,
"issuerAmount": 5000,
"issuerCurrencyCode": "BRL",
"issuerCurrencySymbol": "R$",
"merchantAmount": 5000,
"merchantCurrencyCode": "BRL",
"merchantCurrencySymbol": "R$",
"merchantCategoryCode": "fastFoodRestaurants",
"merchantCategoryNumber": 5814,
"merchantCategoryType": "food",
"merchantCountryCode": "BRA",
"acquirerId": "5656565656565656",
"merchantId": "5656565656565656",
"merchantName": "Stark Store",
"walletId": null,
"methodCode": "chip",
"score": 0.9775689825217906,
"issuingTransactionIds": ["5155165527080960"],
"endToEndId": "79fcf95d-1dfb-40db-9fa8-679e329c58f0",
"zipCode": "01311-000",
"status": "approved",
"tags": [],
"metadata": {},
"description": "",
"confirmed": "2022-01-01T00:00:02.000000+00:00",
"created": "2022-01-01T00:00:00.000000+00:00",
"updated": "2022-01-01T00:00:00.000000+00:00"
})
Ruby
issuingpurchase(
id: 5715709195239424,
holder_name: Tony Stark,
product_id: 654321,
card_id: 7834882116598271,
card_ending: 1234,
purpose: purchase,
installment_count: 1,
amount: 5000,
tax: 0,
issuer_amount: 5000,
issuer_currency_code: BRL,
issuer_currency_symbol: R$,
merchant_amount: 5000,
merchant_currency_code: BRL,
merchant_currency_symbol: R$,
merchant_category_code: fastFoodRestaurants,
merchant_category_number: 5814,
merchant_category_type: food,
merchant_country_code: BRA,
acquirer_id: 5656565656565656,
merchant_id: 5656565656565656,
merchant_name: Stark Store,
merchant_fee: 0,
wallet_id: nil,
method_code: chip,
score: 0.9775689825217906,
end_to_end_id: 79fcf95d-1dfb-40db-9fa8-679e329c58f0,
tags: [],
issuing_transaction_ids: ["5155165527080960"],
status: approved,
description: ,
metadata: {},
zip_code: 01311-000,
confirmed: 2022-01-01T00:00:02+00:00,
created: 2022-01-01T00:00:00+00:00,
updated: 2022-01-01T00:00:00+00:00
)
Elixir
%StarkInfra.IssuingPurchase{
id: "5715709195239424",
holder_name: "Tony Stark",
product_id: "654321",
card_id: "7834882116598271",
card_ending: "1234",
purpose: "purchase",
installment_count: 1,
amount: 5000,
tax: 0,
merchant_fee: 0,
issuer_amount: 5000,
issuer_currency_code: "BRL",
issuer_currency_symbol: "R$",
merchant_amount: 5000,
merchant_currency_code: "BRL",
merchant_currency_symbol: "R$",
merchant_category_code: "fastFoodRestaurants",
merchant_category_number: 5814,
merchant_category_type: "food",
merchant_country_code: "BRA",
acquirer_id: "5656565656565656",
merchant_id: "5656565656565656",
merchant_name: "Stark Store",
wallet_id: nil,
method_code: "chip",
score: 0.9775689825217906,
issuing_transaction_ids: ["5155165527080960"],
end_to_end_id: "79fcf95d-1dfb-40db-9fa8-679e329c58f0",
zip_code: "01311-000",
status: "approved",
tags: [],
metadata: %{},
description: "",
confirmed: "2022-01-01T00:00:02.000000+00:00",
created: "2022-01-01T00:00:00.000000+00:00",
updated: "2022-01-01T00:00:00.000000+00:00"
}
C#
IssuingPurchase(
Id: 5715709195239424,
HolderName: Tony Stark,
ProductId: 654321,
CardId: 7834882116598271,
CardEnding: 1234,
Purpose: purchase,
InstallmentCount: 1,
Amount: 5000,
Tax: 0,
MerchantFee: 0,
IssuerAmount: 5000,
IssuerCurrencyCode: BRL,
IssuerCurrencySymbol: R$,
MerchantAmount: 5000,
MerchantCurrencyCode: BRL,
MerchantCurrencySymbol: R$,
MerchantCategoryCode: fastFoodRestaurants,
MerchantCategoryNumber: 5814,
MerchantCategoryType: food,
MerchantCountryCode: BRA,
AcquirerId: 5656565656565656,
MerchantId: 5656565656565656,
MerchantName: Stark Store,
WalletId: ,
MethodCode: chip,
Score: 0.9775689825217906,
IssuingTransactionIds: [5155165527080960],
EndToEndId: 79fcf95d-1dfb-40db-9fa8-679e329c58f0,
ZipCode: 01311-000,
Status: approved,
Tags: [],
Metadata: {},
Description: ,
Confirmed: 01/01/2022 00:00:02,
Created: 01/01/2022 00:00:00,
Updated: 01/01/2022 00:00:00
)
Go
{
Id:5715709195239424
HolderName:Tony Stark
ProductId:654321
CardId:7834882116598271
CardEnding:1234
Purpose:purchase
InstallmentCount:1
Amount:5000
Tax:0
MerchantFee:0
IssuerAmount:5000
IssuerCurrencyCode:BRL
IssuerCurrencySymbol:R$
MerchantAmount:5000
MerchantCurrencyCode:BRL
MerchantCurrencySymbol:R$
MerchantCategoryCode:fastFoodRestaurants
MerchantCategoryNumber:5814
MerchantCategoryType:food
MerchantCountryCode:BRA
AcquirerId:5656565656565656
MerchantId:5656565656565656
MerchantName:Stark Store
WalletId:
MethodCode:chip
Score:0.9775689825217906
IssuingTransactionIds:[5155165527080960]
EndToEndId:79fcf95d-1dfb-40db-9fa8-679e329c58f0
ZipCode:01311-000
Status:approved
Tags:[]
Metadata:map[]
Description:
Confirmed:2022-01-01 00:00:02 +0000 +0000
Updated:2022-01-01 00:00:00 +0000 +0000
Created:2022-01-01 00:00:00 +0000 +0000
}
Clojure
Not yet available. Please contact us if you need this SDK.
Curl
{
"purchase": {
"id": "5715709195239424",
"holderName": "Tony Stark",
"productId": "654321",
"cardId": "7834882116598271",
"cardEnding": "1234",
"purpose": "purchase",
"installmentCount": 1,
"amount": 5000,
"tax": 0,
"merchantFee": 0,
"issuerAmount": 5000,
"issuerCurrencyCode": "BRL",
"issuerCurrencySymbol": "R$",
"merchantAmount": 5000,
"merchantCurrencyCode": "BRL",
"merchantCurrencySymbol": "R$",
"merchantCategoryCode": "fastFoodRestaurants",
"merchantCategoryNumber": 5814,
"merchantCategoryType": "food",
"merchantCountryCode": "BRA",
"acquirerId": "5656565656565656",
"merchantId": "5656565656565656",
"merchantName": "Stark Store",
"walletId": null,
"methodCode": "chip",
"score": 0.9775689825217906,
"issuingTransactionIds": ["5155165527080960"],
"endToEndId": "79fcf95d-1dfb-40db-9fa8-679e329c58f0",
"zipCode": "01311-000",
"status": "approved",
"tags": [],
"metadata": {},
"description": "",
"confirmed": "2022-01-01T00:00:02.000000+00:00",
"created": "2022-01-01T00:00:00.000000+00:00",
"updated": "2022-01-01T00:00:00.000000+00:00"
}
}
Updating a purchase
A purchase is settled by the network, so its financial fields are read-only. The only things you can change are its "description" (free text, up to 140 characters) and its "tags" — useful for reconciliation and bookkeeping. Each update creates an "updated" Log.
Parameters
Python
import starkinfra
purchase = starkinfra.issuingpurchase.update(
id="5715709195239424",
description="Reconciled with order #1234",
tags=["reconciled", "month: january"]
)
print(purchase)
Javascript
const starkinfra = require('starkinfra');
(async() => {
let purchase = await starkinfra.issuingPurchase.update('5715709195239424', {
description: 'Reconciled with order #1234',
tags: ['reconciled', 'month: january']
});
console.log(purchase);
})();
PHP
$purchase = StarkInfra\IssuingPurchase::update("5715709195239424", [
"description" => "Reconciled with order #1234",
"tags" => ["reconciled", "month: january"]
]);
print_r($purchase);
Java
import com.starkinfra.*; import java.util.HashMap; HashMappatchData = new HashMap<>(); patchData.put("description", "Reconciled with order #1234"); patchData.put("tags", new String[]{"reconciled", "month: january"}); IssuingPurchase purchase = IssuingPurchase.update("5715709195239424", patchData); System.out.println(purchase);
Ruby
require('starkinfra')
purchase = StarkInfra::IssuingPurchase.update(
"5715709195239424",
description: "Reconciled with order #1234",
tags: ["reconciled", "month: january"]
)
puts purchase
Elixir
purchase = StarkInfra.IssuingPurchase.update!(
"5715709195239424",
description: "Reconciled with order #1234",
tags: ["reconciled", "month: january"]
)
IO.inspect(purchase)
C#
using System;
using System.Collections.Generic;
StarkInfra.IssuingPurchase purchase = StarkInfra.IssuingPurchase.Update(
"5715709195239424",
new Dictionary {
{ "description", "Reconciled with order #1234" },
{ "tags", new List { "reconciled", "month: january" } }
}
);
Console.WriteLine(purchase);
Go
package main
import (
"fmt"
"github.com/starkinfra/sdk-go/starkinfra/issuingpurchase"
)
func main() {
purchase, err := issuingpurchase.Update(
"5715709195239424",
map[string]interface{}{
"description": "Reconciled with order #1234",
"tags": []string{"reconciled", "month: january"},
},
nil,
)
if err.Errors != nil {
for _, e := range err.Errors {
fmt.Printf("code: %s, message: %s", e.Code, e.Message)
}
}
fmt.Printf("%+v", purchase)
}
Clojure
Not yet available. Please contact us if you need this SDK.
Curl
curl --location --request PATCH '{{baseUrl}}/v2/issuing-purchase/5715709195239424' \
--header 'Access-Id: {{accessId}}' \
--header 'Access-Time: {{accessTime}}' \
--header 'Access-Signature: {{accessSignature}}' \
--header 'Content-Type: application/json' \
--data-raw '{
"description": "Reconciled with order #1234",
"tags": ["reconciled", "month: january"]
}'
Python
IssuingPurchase(
id=5715709195239424,
holder_name=Tony Stark,
product_id=654321,
card_id=7834882116598271,
card_ending=1234,
purpose=purchase,
installment_count=1,
amount=5000,
tax=0,
issuer_amount=5000,
issuer_currency_code=BRL,
issuer_currency_symbol=R$,
merchant_amount=5000,
merchant_currency_code=BRL,
merchant_currency_symbol=R$,
merchant_category_code=fastFoodRestaurants,
merchant_category_number=5814,
merchant_category_type=food,
merchant_country_code=BRA,
acquirer_id=5656565656565656,
merchant_id=5656565656565656,
merchant_name=Stark Store,
merchant_fee=0,
wallet_id=None,
method_code=chip,
score=0.9775689825217906,
end_to_end_id=79fcf95d-1dfb-40db-9fa8-679e329c58f0,
tags=['reconciled', 'month: january'],
issuing_transaction_ids=['5155165527080960'],
status=approved,
description=Reconciled with order #1234,
metadata={},
zip_code=01311-000,
confirmed=2022-01-01 00:00:02,
created=2022-01-01 00:00:00,
updated=2022-06-01 00:00:00
)
Javascript
IssuingPurchase {
id: '5715709195239424',
holderName: 'Tony Stark',
productId: '654321',
cardId: '7834882116598271',
cardEnding: '1234',
purpose: 'purchase',
installmentCount: 1,
amount: 5000,
tax: 0,
issuerAmount: 5000,
issuerCurrencyCode: 'BRL',
issuerCurrencySymbol: 'R$',
merchantAmount: 5000,
merchantCurrencyCode: 'BRL',
merchantCurrencySymbol: 'R$',
merchantCategoryCode: 'fastFoodRestaurants',
merchantCategoryNumber: 5814,
merchantCategoryType: 'food',
merchantCountryCode: 'BRA',
acquirerId: '5656565656565656',
merchantId: '5656565656565656',
merchantName: 'Stark Store',
merchantFee: 0,
walletId: null,
methodCode: 'chip',
score: 0.9775689825217906,
endToEndId: '79fcf95d-1dfb-40db-9fa8-679e329c58f0',
tags: [ 'reconciled', 'month: january' ],
issuingTransactionIds: [ '5155165527080960' ],
status: 'approved',
description: 'Reconciled with order #1234',
confirmed: '2022-01-01T00:00:02.000000+00:00',
metadata: {},
zipCode: '01311-000',
created: '2022-01-01T00:00:00.000000+00:00',
updated: '2022-06-01T00:00:00.000000+00:00'
}
PHP
StarkInfra\IssuingPurchase Object
(
[id] => 5715709195239424
[holderName] => Tony Stark
[productId] => 654321
[cardId] => 7834882116598271
[cardEnding] => 1234
[purpose] => purchase
[installmentCount] => 1
[amount] => 5000
[tax] => 0
[merchantFee] => 0
[issuerAmount] => 5000
[issuerCurrencyCode] => BRL
[issuerCurrencySymbol] => R$
[merchantAmount] => 5000
[merchantCurrencyCode] => BRL
[merchantCurrencySymbol] => R$
[merchantCategoryCode] => fastFoodRestaurants
[merchantCategoryNumber] => 5814
[merchantCategoryType] => food
[merchantCountryCode] => BRA
[acquirerId] => 5656565656565656
[merchantId] => 5656565656565656
[merchantName] => Stark Store
[walletId] =>
[methodCode] => chip
[score] => 0.9775689825217906
[issuingTransactionIds] => Array ( [0] => 5155165527080960 )
[endToEndId] => 79fcf95d-1dfb-40db-9fa8-679e329c58f0
[zipCode] => 01311-000
[status] => approved
[tags] => Array ( [0] => reconciled [1] => month: january )
[metadata] => Array ( )
[description] => Reconciled with order #1234
[confirmed] => DateTime Object ( [date] => 2022-01-01 00:00:02.000000 )
[created] => DateTime Object ( [date] => 2022-01-01 00:00:00.000000 )
[updated] => DateTime Object ( [date] => 2022-06-01 00:00:00.000000 )
)
Java
IssuingPurchase({
"id": "5715709195239424",
"holderName": "Tony Stark",
"productId": "654321",
"cardId": "7834882116598271",
"cardEnding": "1234",
"purpose": "purchase",
"installmentCount": 1,
"amount": 5000,
"tax": 0,
"merchantFee": 0,
"issuerAmount": 5000,
"issuerCurrencyCode": "BRL",
"issuerCurrencySymbol": "R$",
"merchantAmount": 5000,
"merchantCurrencyCode": "BRL",
"merchantCurrencySymbol": "R$",
"merchantCategoryCode": "fastFoodRestaurants",
"merchantCategoryNumber": 5814,
"merchantCategoryType": "food",
"merchantCountryCode": "BRA",
"acquirerId": "5656565656565656",
"merchantId": "5656565656565656",
"merchantName": "Stark Store",
"walletId": null,
"methodCode": "chip",
"score": 0.9775689825217906,
"issuingTransactionIds": ["5155165527080960"],
"endToEndId": "79fcf95d-1dfb-40db-9fa8-679e329c58f0",
"zipCode": "01311-000",
"status": "approved",
"tags": ["reconciled", "month: january"],
"metadata": {},
"description": "Reconciled with order #1234",
"confirmed": "2022-01-01T00:00:02.000000+00:00",
"created": "2022-01-01T00:00:00.000000+00:00",
"updated": "2022-06-01T00:00:00.000000+00:00"
})
Ruby
issuingpurchase(
id: 5715709195239424,
holder_name: Tony Stark,
product_id: 654321,
card_id: 7834882116598271,
card_ending: 1234,
purpose: purchase,
installment_count: 1,
amount: 5000,
tax: 0,
issuer_amount: 5000,
issuer_currency_code: BRL,
issuer_currency_symbol: R$,
merchant_amount: 5000,
merchant_currency_code: BRL,
merchant_currency_symbol: R$,
merchant_category_code: fastFoodRestaurants,
merchant_category_number: 5814,
merchant_category_type: food,
merchant_country_code: BRA,
acquirer_id: 5656565656565656,
merchant_id: 5656565656565656,
merchant_name: Stark Store,
merchant_fee: 0,
wallet_id: nil,
method_code: chip,
score: 0.9775689825217906,
end_to_end_id: 79fcf95d-1dfb-40db-9fa8-679e329c58f0,
tags: ["reconciled", "month: january"],
issuing_transaction_ids: ["5155165527080960"],
status: approved,
description: Reconciled with order #1234,
metadata: {},
zip_code: 01311-000,
confirmed: 2022-01-01T00:00:02+00:00,
created: 2022-01-01T00:00:00+00:00,
updated: 2022-06-01T00:00:00+00:00
)
Elixir
%StarkInfra.IssuingPurchase{
id: "5715709195239424",
holder_name: "Tony Stark",
product_id: "654321",
card_id: "7834882116598271",
card_ending: "1234",
purpose: "purchase",
installment_count: 1,
amount: 5000,
tax: 0,
merchant_fee: 0,
issuer_amount: 5000,
issuer_currency_code: "BRL",
issuer_currency_symbol: "R$",
merchant_amount: 5000,
merchant_currency_code: "BRL",
merchant_currency_symbol: "R$",
merchant_category_code: "fastFoodRestaurants",
merchant_category_number: 5814,
merchant_category_type: "food",
merchant_country_code: "BRA",
acquirer_id: "5656565656565656",
merchant_id: "5656565656565656",
merchant_name: "Stark Store",
wallet_id: nil,
method_code: "chip",
score: 0.9775689825217906,
issuing_transaction_ids: ["5155165527080960"],
end_to_end_id: "79fcf95d-1dfb-40db-9fa8-679e329c58f0",
zip_code: "01311-000",
status: "approved",
tags: ["reconciled", "month: january"],
metadata: %{},
description: "Reconciled with order #1234",
confirmed: "2022-01-01T00:00:02.000000+00:00",
created: "2022-01-01T00:00:00.000000+00:00",
updated: "2022-06-01T00:00:00.000000+00:00"
}
C#
IssuingPurchase(
Id: 5715709195239424,
HolderName: Tony Stark,
ProductId: 654321,
CardId: 7834882116598271,
CardEnding: 1234,
Purpose: purchase,
InstallmentCount: 1,
Amount: 5000,
Tax: 0,
MerchantFee: 0,
IssuerAmount: 5000,
IssuerCurrencyCode: BRL,
IssuerCurrencySymbol: R$,
MerchantAmount: 5000,
MerchantCurrencyCode: BRL,
MerchantCurrencySymbol: R$,
MerchantCategoryCode: fastFoodRestaurants,
MerchantCategoryNumber: 5814,
MerchantCategoryType: food,
MerchantCountryCode: BRA,
AcquirerId: 5656565656565656,
MerchantId: 5656565656565656,
MerchantName: Stark Store,
WalletId: ,
MethodCode: chip,
Score: 0.9775689825217906,
IssuingTransactionIds: [5155165527080960],
EndToEndId: 79fcf95d-1dfb-40db-9fa8-679e329c58f0,
ZipCode: 01311-000,
Status: approved,
Tags: [reconciled, month: january],
Metadata: {},
Description: Reconciled with order #1234,
Confirmed: 01/01/2022 00:00:02,
Created: 01/01/2022 00:00:00,
Updated: 06/01/2022 00:00:00
)
Go
{
Id:5715709195239424
HolderName:Tony Stark
ProductId:654321
CardId:7834882116598271
CardEnding:1234
Purpose:purchase
InstallmentCount:1
Amount:5000
Tax:0
MerchantFee:0
IssuerAmount:5000
IssuerCurrencyCode:BRL
IssuerCurrencySymbol:R$
MerchantAmount:5000
MerchantCurrencyCode:BRL
MerchantCurrencySymbol:R$
MerchantCategoryCode:fastFoodRestaurants
MerchantCategoryNumber:5814
MerchantCategoryType:food
MerchantCountryCode:BRA
AcquirerId:5656565656565656
MerchantId:5656565656565656
MerchantName:Stark Store
WalletId:
MethodCode:chip
Score:0.9775689825217906
IssuingTransactionIds:[5155165527080960]
EndToEndId:79fcf95d-1dfb-40db-9fa8-679e329c58f0
ZipCode:01311-000
Status:approved
Tags:[reconciled month: january]
Metadata:map[]
Description:Reconciled with order #1234
Confirmed:2022-01-01 00:00:02 +0000 +0000
Updated:2022-06-01 00:00:00 +0000 +0000
Created:2022-01-01 00:00:00 +0000 +0000
}
Clojure
Not yet available. Please contact us if you need this SDK.
Curl
{
"purchase": {
"id": "5715709195239424",
"holderName": "Tony Stark",
"productId": "654321",
"cardId": "7834882116598271",
"cardEnding": "1234",
"purpose": "purchase",
"installmentCount": 1,
"amount": 5000,
"tax": 0,
"merchantFee": 0,
"issuerAmount": 5000,
"issuerCurrencyCode": "BRL",
"issuerCurrencySymbol": "R$",
"merchantAmount": 5000,
"merchantCurrencyCode": "BRL",
"merchantCurrencySymbol": "R$",
"merchantCategoryCode": "fastFoodRestaurants",
"merchantCategoryNumber": 5814,
"merchantCategoryType": "food",
"merchantCountryCode": "BRA",
"acquirerId": "5656565656565656",
"merchantId": "5656565656565656",
"merchantName": "Stark Store",
"walletId": null,
"methodCode": "chip",
"score": 0.9775689825217906,
"issuingTransactionIds": ["5155165527080960"],
"endToEndId": "79fcf95d-1dfb-40db-9fa8-679e329c58f0",
"zipCode": "01311-000",
"status": "approved",
"tags": ["reconciled", "month: january"],
"metadata": {},
"description": "Reconciled with order #1234",
"confirmed": "2022-01-01T00:00:02.000000+00:00",
"created": "2022-01-01T00:00:00.000000+00:00",
"updated": "2022-06-01T00:00:00.000000+00:00"
}
}
Getting purchase Logs
Audit a purchase's history by querying its logs with the "purchaseIds" filter. A purchase that was approved, then confirmed, then edited returns one log per step. You can also filter by "types" (approved, denied, confirmed, reversed, voided, canceled, updated) and "after" / "before", or fetch a single log with GET /v2/issuing-purchase/log/:id.
Parameters
Python
import starkinfra
logs = starkinfra.issuingpurchase.log.query(
limit=10,
purchase_ids=["5715709195239424"]
)
for log in logs:
print(log)
Javascript
const starkinfra = require('starkinfra');
(async() => {
let logs = await starkinfra.issuingPurchase.log.query({
limit: 10,
purchaseIds: ['5715709195239424']
});
for await (let log of logs) {
console.log(log);
}
})();
PHP
$logs = StarkInfra\IssuingPurchase\Log::query([
"limit" => 10,
"purchaseIds" => ["5715709195239424"]
]);
foreach ($logs as $log) {
print_r($log);
}
Java
import com.starkinfra.*; import java.util.HashMap; HashMapparams = new HashMap<>(); params.put("limit", 10); params.put("purchaseIds", new String[]{"5715709195239424"}); Generator logs = IssuingPurchase.Log.query(params); for (IssuingPurchase.Log log : logs) { System.out.println(log); }
Ruby
require('starkinfra')
logs = StarkInfra::IssuingPurchase::Log.query(
limit: 10,
purchase_ids: ["5715709195239424"]
)
logs.each do |log|
puts log
end
Elixir
logs = StarkInfra.IssuingPurchase.Log.query!(
limit: 10,
purchase_ids: ["5715709195239424"]
)
logs |> Enum.each(&IO.inspect/1)
C#
using System; using System.Collections.Generic; IEnumerablelogs = StarkInfra.IssuingPurchase.Log.Query( limit: 10, purchaseIds: new List { "5715709195239424" } ); foreach (StarkInfra.IssuingPurchase.Log log in logs) { Console.WriteLine(log); }
Go
package main
import (
"fmt"
"github.com/starkinfra/sdk-go/starkinfra/issuingpurchase/log"
)
func main() {
var params = map[string]interface{}{}
params["limit"] = 10
params["purchaseIds"] = []string{"5715709195239424"}
logs := log.Query(params, nil)
for log := range logs {
fmt.Printf("%+v", log)
}
}
Clojure
Not yet available. Please contact us if you need this SDK.
Curl
curl --location --request GET '{{baseUrl}}/v2/issuing-purchase/log?limit=10&purchaseIds=5715709195239424' \
--header 'Access-Id: {{accessId}}' \
--header 'Access-Time: {{accessTime}}' \
--header 'Access-Signature: {{accessSignature}}'
Python
Log(
id=6724771005489152,
type=approved,
purchase=IssuingPurchase(id=5715709195239424, amount=5000, status=approved, ...),
created=2022-01-01 00:00:00
)
Log(
id=5547499534213120,
type=confirmed,
purchase=IssuingPurchase(id=5715709195239424, amount=5000, status=confirmed, ...),
created=2022-01-02 00:00:00
)
Javascript
Log {
id: '6724771005489152',
type: 'approved',
purchase: IssuingPurchase { id: '5715709195239424', amount: 5000, status: 'approved', ... },
created: '2022-01-01T00:00:00.000000+00:00'
}
Log {
id: '5547499534213120',
type: 'confirmed',
purchase: IssuingPurchase { id: '5715709195239424', amount: 5000, status: 'confirmed', ... },
created: '2022-01-02T00:00:00.000000+00:00'
}
PHP
StarkInfra\IssuingPurchase\Log Object
(
[id] => 6724771005489152
[type] => approved
[purchase] => StarkInfra\IssuingPurchase Object ( [id] => 5715709195239424 [amount] => 5000 [status] => approved ... )
[created] => DateTime Object ( [date] => 2022-01-01 00:00:00.000000 )
)
StarkInfra\IssuingPurchase\Log Object
(
[id] => 5547499534213120
[type] => confirmed
[purchase] => StarkInfra\IssuingPurchase Object ( [id] => 5715709195239424 [amount] => 5000 [status] => confirmed ... )
[created] => DateTime Object ( [date] => 2022-01-02 00:00:00.000000 )
)
Java
IssuingPurchase.Log({
"id": "6724771005489152",
"type": "approved",
"purchase": {"id": "5715709195239424", "amount": 5000, "status": "approved", "...": "..."},
"created": "2022-01-01T00:00:00.000000+00:00"
})
IssuingPurchase.Log({
"id": "5547499534213120",
"type": "confirmed",
"purchase": {"id": "5715709195239424", "amount": 5000, "status": "confirmed", "...": "..."},
"created": "2022-01-02T00:00:00.000000+00:00"
})
Ruby
log(
id: 6724771005489152,
type: approved,
purchase: issuingpurchase(id: 5715709195239424, amount: 5000, status: approved, ...),
created: 2022-01-01T00:00:00+00:00
)
log(
id: 5547499534213120,
type: confirmed,
purchase: issuingpurchase(id: 5715709195239424, amount: 5000, status: confirmed, ...),
created: 2022-01-02T00:00:00+00:00
)
Elixir
%StarkInfra.IssuingPurchase.Log{
id: "6724771005489152",
type: "approved",
purchase: %StarkInfra.IssuingPurchase{id: "5715709195239424", amount: 5000, status: "approved", ...},
created: "2022-01-01T00:00:00.000000+00:00"
}
%StarkInfra.IssuingPurchase.Log{
id: "5547499534213120",
type: "confirmed",
purchase: %StarkInfra.IssuingPurchase{id: "5715709195239424", amount: 5000, status: "confirmed", ...},
created: "2022-01-02T00:00:00.000000+00:00"
}
C#
IssuingPurchase.Log(
Id: 6724771005489152,
Type: approved,
Purchase: IssuingPurchase(Id: 5715709195239424, Amount: 5000, Status: approved, ...),
Created: 01/01/2022 00:00:00
)
IssuingPurchase.Log(
Id: 5547499534213120,
Type: confirmed,
Purchase: IssuingPurchase(Id: 5715709195239424, Amount: 5000, Status: confirmed, ...),
Created: 01/02/2022 00:00:00
)
Go
{
Id:6724771005489152
Type:approved
Purchase:{Id:5715709195239424 Amount:5000 Status:approved ...}
Created:2022-01-01 00:00:00 +0000 +0000
}
{
Id:5547499534213120
Type:confirmed
Purchase:{Id:5715709195239424 Amount:5000 Status:confirmed ...}
Created:2022-01-02 00:00:00 +0000 +0000
}
Clojure
Not yet available. Please contact us if you need this SDK.
Curl
{
"cursor": null,
"logs": [
{
"id": "6724771005489152",
"type": "approved",
"purchase": {"id": "5715709195239424", "amount": 5000, "status": "approved", "...": "..."},
"created": "2022-01-01T00:00:00.000000+00:00"
},
{
"id": "5547499534213120",
"type": "confirmed",
"purchase": {"id": "5715709195239424", "amount": 5000, "status": "confirmed", "...": "..."},
"created": "2022-01-02T00:00:00.000000+00:00"
}
]
}
Issuing Preview Installment Overview
An Issuing Preview Installment is a single upcoming installment of a card purchase that has not been billed yet. It exists only in the credit (postpaid) flow, where installment purchases are charged across several future Issuing Billing Invoices instead of being settled immediately.
Use it to preview, ahead of time, the amounts that will compose your future billing invoices — for example to forecast next month's charges or to reconcile what each purchase will add to each invoice.
Read-only. This resource is query-only: there is a single GET list endpoint. You cannot create, update or cancel a preview installment — Stark Infra derives them automatically from your installment purchases, and each one disappears from the list once its installment is actually billed.
amount vs. totalAmount. All money is in cents. amount is the value of this single installment; totalAmount is the full value of the source purchase. So a R$ 900.00 purchase split in 3 returns three preview installments of amount 30000 each, all sharing totalAmount 90000.
number and count. number is the position of this installment (1-based) and count is how many installments the source purchase was split into — e.g. number 2 of count 3.
source. Points back to the entity that originated the installment, formatted as "<resource>/<id>" — typically an Issuing Purchase, e.g. "issuing-purchase/5155165527080960".
due. The datetime when this installment is scheduled to be billed — i.e. the invoice it will land on.
Querying Preview Installments
List the upcoming installments that have not been billed yet, in chunks of at most 100. Page through the results with the "cursor" returned in each response.
Sorting. Pass "sort" to order the results: "created" / "-created" by creation datetime, or "due" / "-due" by billing datetime. A leading "-" means descending. The default is "-created". Use "due" to walk the installments in the order they will be charged.
Filtering. Narrow the list with "after" / "before" (on the creation date), "ids" (fetch specific installments) and "tags". Use "limit" to cap the page size (max 100).
Parameters
Python
import starkinfra
installments = starkinfra.issuingpreviewinstallment.query(
limit=10,
sort="due"
)
for installment in installments:
print(installment)
Javascript
const starkinfra = require('starkinfra');
(async() => {
let installments = await starkinfra.issuingPreviewInstallment.query({
limit: 10,
sort: 'due'
});
for await (let installment of installments) {
console.log(installment);
}
})();
PHP
$installments = StarkInfra\IssuingPreviewInstallment::query([
"limit" => 10,
"sort" => "due"
]);
foreach ($installments as $installment) {
print_r($installment);
}
Java
import com.starkinfra.*; import java.util.HashMap; HashMapparams = new HashMap<>(); params.put("limit", 10); params.put("sort", "due"); Generator installments = IssuingPreviewInstallment.query(params); for (IssuingPreviewInstallment installment : installments) { System.out.println(installment); }
Ruby
require('starkinfra')
installments = StarkInfra::IssuingPreviewInstallment.query(
limit: 10,
sort: "due"
)
installments.each do |installment|
puts installment
end
Elixir
installments = StarkInfra.IssuingPreviewInstallment.query!(
limit: 10,
sort: "due"
)
installments |> Enum.each(&IO.inspect/1)
C#
using System; using System.Collections.Generic; IEnumerableinstallments = StarkInfra.IssuingPreviewInstallment.Query( limit: 10, sort: "due" ); foreach (StarkInfra.IssuingPreviewInstallment installment in installments) { Console.WriteLine(installment); }
Go
package main
import (
"fmt"
"github.com/starkinfra/sdk-go/starkinfra/issuingpreviewinstallment"
)
func main() {
var params = map[string]interface{}{
"limit": 10,
"sort": "due",
}
installments := issuingpreviewinstallment.Query(params, nil)
for installment := range installments {
fmt.Printf("%+v", installment)
}
}
Clojure
Not yet available. Please contact us if you need this SDK.
Curl
curl --location --request GET '{{baseUrl}}/v2/issuing-preview-installment?limit=10&sort=due' \
--header 'Access-Id: {{accessId}}' \
--header 'Access-Time: {{accessTime}}' \
--header 'Access-Signature: {{accessSignature}}'
Python
IssuingPreviewInstallment(
id=6724771005489152,
description=Stark Coffee Shop,
amount=30000,
total_amount=90000,
source=issuing-purchase/5155165527080960,
number=1,
count=3,
due=2022-02-01 00:00:00,
tags=[],
created=2022-01-01 00:00:00
)
IssuingPreviewInstallment(
id=5547499534213120,
description=Stark Coffee Shop,
amount=30000,
total_amount=90000,
source=issuing-purchase/5155165527080960,
number=2,
count=3,
due=2022-03-01 00:00:00,
tags=[],
created=2022-01-01 00:00:00
)
Javascript
IssuingPreviewInstallment {
id: '6724771005489152',
description: 'Stark Coffee Shop',
amount: 30000,
totalAmount: 90000,
source: 'issuing-purchase/5155165527080960',
number: 1,
count: 3,
due: '2022-02-01T00:00:00.000000+00:00',
tags: [],
created: '2022-01-01T00:00:00.000000+00:00'
}
IssuingPreviewInstallment {
id: '5547499534213120',
description: 'Stark Coffee Shop',
amount: 30000,
totalAmount: 90000,
source: 'issuing-purchase/5155165527080960',
number: 2,
count: 3,
due: '2022-03-01T00:00:00.000000+00:00',
tags: [],
created: '2022-01-01T00:00:00.000000+00:00'
}
PHP
StarkInfra\IssuingPreviewInstallment Object
(
[id] => 6724771005489152
[description] => Stark Coffee Shop
[amount] => 30000
[totalAmount] => 90000
[source] => issuing-purchase/5155165527080960
[number] => 1
[count] => 3
[due] => DateTime Object ( [date] => 2022-02-01 00:00:00.000000 )
[tags] => Array ( )
[created] => DateTime Object ( [date] => 2022-01-01 00:00:00.000000 )
)
StarkInfra\IssuingPreviewInstallment Object
(
[id] => 5547499534213120
[description] => Stark Coffee Shop
[amount] => 30000
[totalAmount] => 90000
[source] => issuing-purchase/5155165527080960
[number] => 2
[count] => 3
[due] => DateTime Object ( [date] => 2022-03-01 00:00:00.000000 )
[tags] => Array ( )
[created] => DateTime Object ( [date] => 2022-01-01 00:00:00.000000 )
)
Java
IssuingPreviewInstallment({
"id": "6724771005489152",
"description": "Stark Coffee Shop",
"amount": 30000,
"totalAmount": 90000,
"source": "issuing-purchase/5155165527080960",
"number": 1,
"count": 3,
"due": "2022-02-01T00:00:00.000000+00:00",
"tags": [],
"created": "2022-01-01T00:00:00.000000+00:00"
})
IssuingPreviewInstallment({
"id": "5547499534213120",
"description": "Stark Coffee Shop",
"amount": 30000,
"totalAmount": 90000,
"source": "issuing-purchase/5155165527080960",
"number": 2,
"count": 3,
"due": "2022-03-01T00:00:00.000000+00:00",
"tags": [],
"created": "2022-01-01T00:00:00.000000+00:00"
})
Ruby
issuingpreviewinstallment(
id: 6724771005489152,
description: Stark Coffee Shop,
amount: 30000,
total_amount: 90000,
source: issuing-purchase/5155165527080960,
number: 1,
count: 3,
due: 2022-02-01T00:00:00+00:00,
tags: [],
created: 2022-01-01T00:00:00+00:00
)
issuingpreviewinstallment(
id: 5547499534213120,
description: Stark Coffee Shop,
amount: 30000,
total_amount: 90000,
source: issuing-purchase/5155165527080960,
number: 2,
count: 3,
due: 2022-03-01T00:00:00+00:00,
tags: [],
created: 2022-01-01T00:00:00+00:00
)
Elixir
%StarkInfra.IssuingPreviewInstallment{
id: "6724771005489152",
description: "Stark Coffee Shop",
amount: 30000,
total_amount: 90000,
source: "issuing-purchase/5155165527080960",
number: 1,
count: 3,
due: "2022-02-01T00:00:00.000000+00:00",
tags: [],
created: "2022-01-01T00:00:00.000000+00:00"
}
%StarkInfra.IssuingPreviewInstallment{
id: "5547499534213120",
description: "Stark Coffee Shop",
amount: 30000,
total_amount: 90000,
source: "issuing-purchase/5155165527080960",
number: 2,
count: 3,
due: "2022-03-01T00:00:00.000000+00:00",
tags: [],
created: "2022-01-01T00:00:00.000000+00:00"
}
C#
IssuingPreviewInstallment(
Id: 6724771005489152,
Description: Stark Coffee Shop,
Amount: 30000,
TotalAmount: 90000,
Source: issuing-purchase/5155165527080960,
Number: 1,
Count: 3,
Due: 02/01/2022 00:00:00,
Tags: { },
Created: 01/01/2022 00:00:00
)
IssuingPreviewInstallment(
Id: 5547499534213120,
Description: Stark Coffee Shop,
Amount: 30000,
TotalAmount: 90000,
Source: issuing-purchase/5155165527080960,
Number: 2,
Count: 3,
Due: 03/01/2022 00:00:00,
Tags: { },
Created: 01/01/2022 00:00:00
)
Go
{
Id:6724771005489152
Description:Stark Coffee Shop
Amount:30000
TotalAmount:90000
Source:issuing-purchase/5155165527080960
Number:1
Count:3
Due:2022-02-01 00:00:00 +0000 +0000
Tags:[]
Created:2022-01-01 00:00:00 +0000 +0000
}
{
Id:5547499534213120
Description:Stark Coffee Shop
Amount:30000
TotalAmount:90000
Source:issuing-purchase/5155165527080960
Number:2
Count:3
Due:2022-03-01 00:00:00 +0000 +0000
Tags:[]
Created:2022-01-01 00:00:00 +0000 +0000
}
Clojure
Not yet available. Please contact us if you need this SDK.
Curl
{
"installments": [
{
"id": "6724771005489152",
"description": "Stark Coffee Shop",
"amount": 30000,
"totalAmount": 90000,
"source": "issuing-purchase/5155165527080960",
"number": 1,
"count": 3,
"due": "2022-02-01T00:00:00.000000+00:00",
"tags": [],
"created": "2022-01-01T00:00:00.000000+00:00"
},
{
"id": "5547499534213120",
"description": "Stark Coffee Shop",
"amount": 30000,
"totalAmount": 90000,
"source": "issuing-purchase/5155165527080960",
"number": 2,
"count": 3,
"due": "2022-03-01T00:00:00.000000+00:00",
"tags": [],
"created": "2022-01-01T00:00:00.000000+00:00"
}
],
"cursor": null
}
Issuing Balance Overview
The Issuing Balance is the spendable wallet that backs every card you issue. Your cards draw on this single pool of funds — there is one Issuing Balance per workspace, not one per card or per holder.
Funding and draining. You top up the balance with an Issuing Invoice (pay its BR Code or transfer to its account) and pull money back out with an Issuing Withdrawal. Card purchases settle against the balance and lower it. Every one of these movements is recorded as an Issuing Transaction in the ledger — query those to see exactly how the balance reached its current amount.
amount is in cents. Like every monetary value in the API, amount is an integer in cents: 5000000 means R$50,000.00. It is the balance left after the latest transaction.
limit and maxLimit. Both report the ceiling your issuing wallet is allowed to reach. They are always equal (100000000, i.e. R$1,000,000.00, in the example below) and are not configurable through the API — treat them as read-only information, not a setting you can change.
Getting your Balance
Fetch your current Issuing Balance. There is a single balance per workspace, so this endpoint takes no id and returns just one entry — the wallet that all your cards spend from.
The updated field is the timestamp of the latest Issuing Transaction that moved the balance; if nothing has moved yet it reflects the current moment.
Parameters
Python
import starkinfra balance = starkinfra.issuingbalance.get() print(balance)
Javascript
const starkinfra = require('starkinfra');
(async() => {
let balance = await starkinfra.issuingBalance.get();
console.log(balance);
})();
PHP
$balance = StarkInfra\IssuingBalance::get(); print_r($balance);
Java
import com.starkinfra.*; IssuingBalance balance = IssuingBalance.get(); System.out.println(balance);
Ruby
require('starkinfra')
balance = StarkInfra::IssuingBalance.get()
puts balance
Elixir
balance = StarkInfra.IssuingBalance.get!() IO.inspect(balance)
C#
using System; StarkInfra.IssuingBalance balance = StarkInfra.IssuingBalance.Get(); Console.WriteLine(balance);
Go
package main
import (
"fmt"
"github.com/starkinfra/sdk-go/starkinfra/issuingbalance"
)
func main() {
balance, err := issuingbalance.Get(nil)
if err.Errors != nil {
for _, e := range err.Errors {
fmt.Printf("code: %s, message: %s", e.Code, e.Message)
}
}
fmt.Printf("%+v", balance)
}
Clojure
Not yet available. Please contact us if you need this SDK.
Curl
curl --location --request GET '{{baseUrl}}/v2/issuing-balance' \
--header 'Access-Id: {{accessId}}' \
--header 'Access-Time: {{accessTime}}' \
--header 'Access-Signature: {{accessSignature}}'
Python
IssuingBalance(
id=5715709195239424,
amount=5000000,
currency=BRL,
updated=2022-01-01 00:00:00
)
Javascript
IssuingBalance {
id: '5715709195239424',
amount: 5000000,
currency: 'BRL',
updated: '2022-01-01T00:00:00.000000+00:00'
}
PHP
StarkInfra\IssuingBalance Object
(
[id] => 5715709195239424
[amount] => 5000000
[currency] => BRL
[updated] => DateTime Object ( [date] => 2022-01-01 00:00:00.000000 )
)
Java
IssuingBalance({
"id": "5715709195239424",
"amount": 5000000,
"currency": "BRL",
"updated": "2022-01-01T00:00:00.000000+00:00"
})
Ruby
issuingbalance(
id: 5715709195239424,
amount: 5000000,
currency: BRL,
updated: 2022-01-01T00:00:00+00:00
)
Elixir
%StarkInfra.IssuingBalance{
id: "5715709195239424",
amount: 5000000,
currency: "BRL",
updated: "2022-01-01T00:00:00.000000+00:00"
}
C#
IssuingBalance(
Id: 5715709195239424,
Amount: 5000000,
Currency: BRL,
Updated: 01/01/2022 00:00:00
)
Go
{
Id:5715709195239424
Amount:5000000
Currency:BRL
Updated:2022-01-01 00:00:00 +0000 +0000
}
Clojure
Not yet available. Please contact us if you need this SDK.
Curl
{
"cursor": null,
"balances": [
{
"id": "5715709195239424",
"amount": 5000000,
"limit": 100000000,
"maxLimit": 100000000,
"currency": "BRL",
"updated": "2022-01-01T00:00:00.000000+00:00"
}
]
}
Issuing Invoice Overview
An Issuing Invoice is a Pix invoice you create to fund your issuing balance — the wallet your cards spend from. You must top this balance up before you can issue and spend on cards, so creating an invoice is usually the first call you make.
Creating an invoice returns a payable Pix: a "brcode" (the Pix copy-and-paste / QR string), a "link" to a hosted payment page and a "due" datetime (7 days ahead by default). Pay it from any account, and once Stark Infra confirms the payment the invoice moves to "paid" and the amount lands in your Issuing Balance, ready to spend on Issuing Cards.
amount is always in cents — 10000 means R$100.00. It must be a positive integer.
The returned taxId is the issuer's, not the payer's. You may pass a payer "name" and "taxId" when creating the invoice (they default to your workspace owner's if omitted), but the "taxId" returned on the invoice is always the tax id of your card-issuer entity — the party receiving the funds.
Watch for the "paid" status. The deposit is asynchronous: the invoice is born "created" and only becomes "paid" once the Pix settles. Track that transition through the invoice Logs or a webhook subscribed to issuing-invoice events — that is your signal that the balance was funded.
Invoice Statuses
Each Issuing Invoice has a status that reflects where it is in its life cycle:

| Status | Description |
|---|---|
| created | The invoice was created and is waiting for payment. Its brcode and link are payable. |
| paid | The Pix was paid and the amount was credited to your issuing balance. This is the status you watch for. |
| overdue | The due datetime passed and the invoice was not paid yet. It can still be paid for a short grace period. |
| expired | The invoice expired and can no longer be paid. Create a new one to fund the balance. |
| canceled | The invoice was canceled and can no longer be paid. |
Invoice Logs
Every time an Issuing Invoice changes, we create a Log entry. Logs are how you follow an invoice from creation to payment without polling — query them, or subscribe a webhook to issuing-invoice events, and react to the "paid" log to know the funds landed in your balance.
Query the invoice logs with GET /v2/issuing-invoice/log (filter by ids, types, after / before), or fetch a single one with GET /v2/issuing-invoice/log/:id. Log types are: created, paid, overdue, expired, credited and canceled. The "invoice" field in each log is an abbreviated representation of the Issuing Invoice as it was at that point (shown abbreviated with "...").
Creating an Invoice
Create an invoice to fund your issuing balance by sending an "amount" in cents. "name", "taxId", "tags" and "metadata" are optional — if you omit "name" / "taxId" they default to your workspace owner's.
The response carries the payable Pix: "brcode", "link" and "due". The invoice starts as "created"; "issuingTransactionId" stays null until the Pix is paid.
NOTE: You cannot create a funding invoice while you have an unpaid Issuing Billing Invoice — if a billing invoice is pending or overdue, settle it first.
NOTE: In Sandbox, an invoice has about a 90% chance of being paid automatically by our simulation system within 10 minutes — handy for testing the funding flow end to end.
Parameters
Python
import starkinfra
invoice = starkinfra.issuinginvoice.create(
starkinfra.IssuingInvoice(
amount=10000,
name="Tony Stark",
tax_id="012.345.678-90",
tags=["department: tech"]
)
)
print(invoice)
Javascript
const starkinfra = require('starkinfra');
(async() => {
let invoice = await starkinfra.issuingInvoice.create({
amount: 10000,
name: 'Tony Stark',
taxId: '012.345.678-90',
tags: ['department: tech']
});
console.log(invoice);
})();
PHP
$invoice = StarkInfra\IssuingInvoice::create(
new StarkInfra\IssuingInvoice([
"amount" => 10000,
"name" => "Tony Stark",
"taxId" => "012.345.678-90",
"tags" => ["department: tech"]
])
);
print_r($invoice);
Java
import com.starkinfra.*; import java.util.HashMap; HashMapdata = new HashMap<>(); data.put("amount", 10000); data.put("name", "Tony Stark"); data.put("taxId", "012.345.678-90"); data.put("tags", new String[]{"department: tech"}); IssuingInvoice invoice = IssuingInvoice.create(new IssuingInvoice(data)); System.out.println(invoice);
Ruby
require('starkinfra')
invoice = StarkInfra::IssuingInvoice.create(
StarkInfra::IssuingInvoice.new(
amount: 10000,
name: "Tony Stark",
tax_id: "012.345.678-90",
tags: ["department: tech"]
)
)
puts invoice
Elixir
invoice = StarkInfra.IssuingInvoice.create!(
%StarkInfra.IssuingInvoice{
amount: 10000,
name: "Tony Stark",
tax_id: "012.345.678-90",
tags: ["department: tech"]
}
)
IO.inspect(invoice)
C#
using System;
using System.Collections.Generic;
StarkInfra.IssuingInvoice invoice = StarkInfra.IssuingInvoice.Create(
new StarkInfra.IssuingInvoice(
amount: 10000,
name: "Tony Stark",
taxID: "012.345.678-90",
tags: new List { "department: tech" }
)
);
Console.WriteLine(invoice);
Go
package main
import (
"fmt"
"github.com/starkinfra/sdk-go/starkinfra/issuinginvoice"
)
func main() {
invoice, err := issuinginvoice.Create(
issuinginvoice.IssuingInvoice{
Amount: 10000,
Name: "Tony Stark",
TaxId: "012.345.678-90",
Tags: []string{"department: tech"},
},
nil,
)
if err.Errors != nil {
for _, e := range err.Errors {
fmt.Printf("code: %s, message: %s", e.Code, e.Message)
}
}
fmt.Printf("%+v", invoice)
}
Clojure
Not yet available. Please contact us if you need this SDK.
Curl
curl --location --request POST '{{baseUrl}}/v2/issuing-invoice' \
--header 'Access-Id: {{accessId}}' \
--header 'Access-Time: {{accessTime}}' \
--header 'Access-Signature: {{accessSignature}}' \
--header 'Content-Type: application/json' \
--data-raw '{
"amount": 10000,
"name": "Tony Stark",
"taxId": "012.345.678-90",
"tags": ["department: tech"]
}'
Python
IssuingInvoice(
id=5715709195239424,
amount=10000,
tax_id=20.018.183/0001-80,
name=Tony Stark,
tags=['department: tech'],
metadata={},
status=created,
brcode=00020101021226870014br.gov.bcb.pix2565...,
due=2022-02-10 00:00:00,
link=https://sandbox.api.starkinfra.com/invoicelink/5715709195239424,
issuing_transaction_id=None,
created=2022-01-01 00:00:00,
updated=2022-01-01 00:00:00
)
Javascript
IssuingInvoice {
id: '5715709195239424',
amount: 10000,
taxId: '20.018.183/0001-80',
name: 'Tony Stark',
tags: [ 'department: tech' ],
metadata: {},
status: 'created',
brcode: '00020101021226870014br.gov.bcb.pix2565...',
due: '2022-02-10T00:00:00.000000+00:00',
link: 'https://sandbox.api.starkinfra.com/invoicelink/5715709195239424',
issuingTransactionId: null,
created: '2022-01-01T00:00:00.000000+00:00',
updated: '2022-01-01T00:00:00.000000+00:00'
}
PHP
StarkInfra\IssuingInvoice Object
(
[id] => 5715709195239424
[amount] => 10000
[taxId] => 20.018.183/0001-80
[name] => Tony Stark
[tags] => Array ( [0] => department: tech )
[metadata] => Array ( )
[status] => created
[brcode] => 00020101021226870014br.gov.bcb.pix2565...
[due] => DateTime Object ( [date] => 2022-02-10 00:00:00.000000 )
[link] => https://sandbox.api.starkinfra.com/invoicelink/5715709195239424
[issuingTransactionId] =>
[created] => DateTime Object ( [date] => 2022-01-01 00:00:00.000000 )
[updated] => DateTime Object ( [date] => 2022-01-01 00:00:00.000000 )
)
Java
IssuingInvoice({
"id": "5715709195239424",
"amount": 10000,
"taxId": "20.018.183/0001-80",
"name": "Tony Stark",
"tags": ["department: tech"],
"metadata": {},
"status": "created",
"brcode": "00020101021226870014br.gov.bcb.pix2565...",
"due": "2022-02-10T00:00:00.000000+00:00",
"link": "https://sandbox.api.starkinfra.com/invoicelink/5715709195239424",
"issuingTransactionId": null,
"created": "2022-01-01T00:00:00.000000+00:00",
"updated": "2022-01-01T00:00:00.000000+00:00"
})
Ruby
issuinginvoice(
id: 5715709195239424,
amount: 10000,
tax_id: 20.018.183/0001-80,
name: Tony Stark,
tags: ["department: tech"],
metadata: {},
status: created,
brcode: 00020101021226870014br.gov.bcb.pix2565...,
due: 2022-02-10T00:00:00+00:00,
link: https://sandbox.api.starkinfra.com/invoicelink/5715709195239424,
issuing_transaction_id: nil,
created: 2022-01-01T00:00:00+00:00,
updated: 2022-01-01T00:00:00+00:00
)
Elixir
%StarkInfra.IssuingInvoice{
id: "5715709195239424",
amount: 10000,
tax_id: "20.018.183/0001-80",
name: "Tony Stark",
tags: ["department: tech"],
metadata: %{},
status: "created",
brcode: "00020101021226870014br.gov.bcb.pix2565...",
due: "2022-02-10T00:00:00.000000+00:00",
link: "https://sandbox.api.starkinfra.com/invoicelink/5715709195239424",
issuing_transaction_id: nil,
created: "2022-01-01T00:00:00.000000+00:00",
updated: "2022-01-01T00:00:00.000000+00:00"
}
C#
IssuingInvoice(
Id: 5715709195239424,
Amount: 10000,
TaxId: 20.018.183/0001-80,
Name: Tony Stark,
Tags: [department: tech],
Metadata: {},
Status: created,
Brcode: 00020101021226870014br.gov.bcb.pix2565...,
Due: 02/10/2022 00:00:00,
Link: https://sandbox.api.starkinfra.com/invoicelink/5715709195239424,
IssuingTransactionID: ,
Created: 01/01/2022 00:00:00,
Updated: 01/01/2022 00:00:00
)
Go
{
Id:5715709195239424
Amount:10000
TaxId:20.018.183/0001-80
Name:Tony Stark
Tags:[department: tech]
Metadata:map[]
Brcode:00020101021226870014br.gov.bcb.pix2565...
Due:2022-02-10 00:00:00 +0000 +0000
Link:https://sandbox.api.starkinfra.com/invoicelink/5715709195239424
Status:created
IssuingTransactionId:
Updated:2022-01-01 00:00:00 +0000 +0000
Created:2022-01-01 00:00:00 +0000 +0000
}
Clojure
Not yet available. Please contact us if you need this SDK.
Curl
{
"message": "Invoice successfully created.",
"invoice": {
"id": "5715709195239424",
"amount": 10000,
"taxId": "20.018.183/0001-80",
"name": "Tony Stark",
"tags": ["department: tech"],
"metadata": {},
"status": "created",
"brcode": "00020101021226870014br.gov.bcb.pix2565...",
"due": "2022-02-10T00:00:00.000000+00:00",
"link": "https://sandbox.api.starkinfra.com/invoicelink/5715709195239424",
"issuingTransactionId": null,
"created": "2022-01-01T00:00:00.000000+00:00",
"updated": "2022-01-01T00:00:00.000000+00:00"
}
}
Listing Invoices
List your invoices in pages of at most 100. Filter by "status" (created, paid, overdue, expired, canceled), "tags" and "after" / "before". Use the returned "cursor" to page through results.
Parameters
Python
import starkinfra
invoices = starkinfra.issuinginvoice.query(
limit=10,
status="paid"
)
for invoice in invoices:
print(invoice)
Javascript
const starkinfra = require('starkinfra');
(async() => {
let invoices = await starkinfra.issuingInvoice.query({
limit: 10,
status: 'paid'
});
for await (let invoice of invoices) {
console.log(invoice);
}
})();
PHP
$invoices = StarkInfra\IssuingInvoice::query([
"limit" => 10,
"status" => "paid"
]);
foreach ($invoices as $invoice) {
print_r($invoice);
}
Java
import com.starkinfra.*; import java.util.HashMap; HashMapparams = new HashMap<>(); params.put("limit", 10); params.put("status", "paid"); Generator invoices = IssuingInvoice.query(params); for (IssuingInvoice invoice : invoices) { System.out.println(invoice); }
Ruby
require('starkinfra')
invoices = StarkInfra::IssuingInvoice.query(
limit: 10,
status: "paid"
)
invoices.each do |invoice|
puts invoice
end
Elixir
invoices = StarkInfra.IssuingInvoice.query!(
limit: 10,
status: "paid"
)
invoices |> Enum.each(&IO.inspect/1)
C#
using System; using System.Collections.Generic; IEnumerableinvoices = StarkInfra.IssuingInvoice.Query( limit: 10, status: "paid" ); foreach (StarkInfra.IssuingInvoice invoice in invoices) { Console.WriteLine(invoice); }
Go
package main
import (
"fmt"
"github.com/starkinfra/sdk-go/starkinfra/issuinginvoice"
)
func main() {
var params = map[string]interface{}{}
params["limit"] = 10
params["status"] = "paid"
invoices, errorChannel := issuinginvoice.Query(params, nil)
for invoice := range invoices {
fmt.Printf("%+v", invoice)
}
for err := range errorChannel {
fmt.Printf("%+v", err)
}
}
Clojure
Not yet available. Please contact us if you need this SDK.
Curl
curl --location --request GET '{{baseUrl}}/v2/issuing-invoice?limit=10&status=paid' \
--header 'Access-Id: {{accessId}}' \
--header 'Access-Time: {{accessTime}}' \
--header 'Access-Signature: {{accessSignature}}'
Python
IssuingInvoice(
id=5715709195239424,
amount=10000,
tax_id=20.018.183/0001-80,
name=Tony Stark,
tags=['department: tech'],
metadata={},
status=paid,
brcode=00020101021226870014br.gov.bcb.pix2565...,
due=2022-02-10 00:00:00,
link=https://sandbox.api.starkinfra.com/invoicelink/5715709195239424,
issuing_transaction_id=6306924158455808,
created=2022-01-01 00:00:00,
updated=2022-01-02 00:00:00
)
Javascript
IssuingInvoice {
id: '5715709195239424',
amount: 10000,
taxId: '20.018.183/0001-80',
name: 'Tony Stark',
tags: [ 'department: tech' ],
metadata: {},
status: 'paid',
brcode: '00020101021226870014br.gov.bcb.pix2565...',
due: '2022-02-10T00:00:00.000000+00:00',
link: 'https://sandbox.api.starkinfra.com/invoicelink/5715709195239424',
issuingTransactionId: '6306924158455808',
created: '2022-01-01T00:00:00.000000+00:00',
updated: '2022-01-02T00:00:00.000000+00:00'
}
PHP
StarkInfra\IssuingInvoice Object
(
[id] => 5715709195239424
[amount] => 10000
[taxId] => 20.018.183/0001-80
[name] => Tony Stark
[tags] => Array ( [0] => department: tech )
[metadata] => Array ( )
[status] => paid
[brcode] => 00020101021226870014br.gov.bcb.pix2565...
[due] => DateTime Object ( [date] => 2022-02-10 00:00:00.000000 )
[link] => https://sandbox.api.starkinfra.com/invoicelink/5715709195239424
[issuingTransactionId] => 6306924158455808
[created] => DateTime Object ( [date] => 2022-01-01 00:00:00.000000 )
[updated] => DateTime Object ( [date] => 2022-01-02 00:00:00.000000 )
)
Java
IssuingInvoice({
"id": "5715709195239424",
"amount": 10000,
"taxId": "20.018.183/0001-80",
"name": "Tony Stark",
"tags": ["department: tech"],
"metadata": {},
"status": "paid",
"brcode": "00020101021226870014br.gov.bcb.pix2565...",
"due": "2022-02-10T00:00:00.000000+00:00",
"link": "https://sandbox.api.starkinfra.com/invoicelink/5715709195239424",
"issuingTransactionId": "6306924158455808",
"created": "2022-01-01T00:00:00.000000+00:00",
"updated": "2022-01-02T00:00:00.000000+00:00"
})
Ruby
issuinginvoice(
id: 5715709195239424,
amount: 10000,
tax_id: 20.018.183/0001-80,
name: Tony Stark,
tags: ["department: tech"],
metadata: {},
status: paid,
brcode: 00020101021226870014br.gov.bcb.pix2565...,
due: 2022-02-10T00:00:00+00:00,
link: https://sandbox.api.starkinfra.com/invoicelink/5715709195239424,
issuing_transaction_id: 6306924158455808,
created: 2022-01-01T00:00:00+00:00,
updated: 2022-01-02T00:00:00+00:00
)
Elixir
%StarkInfra.IssuingInvoice{
id: "5715709195239424",
amount: 10000,
tax_id: "20.018.183/0001-80",
name: "Tony Stark",
tags: ["department: tech"],
metadata: %{},
status: "paid",
brcode: "00020101021226870014br.gov.bcb.pix2565...",
due: "2022-02-10T00:00:00.000000+00:00",
link: "https://sandbox.api.starkinfra.com/invoicelink/5715709195239424",
issuing_transaction_id: "6306924158455808",
created: "2022-01-01T00:00:00.000000+00:00",
updated: "2022-01-02T00:00:00.000000+00:00"
}
C#
IssuingInvoice(
Id: 5715709195239424,
Amount: 10000,
TaxId: 20.018.183/0001-80,
Name: Tony Stark,
Tags: [department: tech],
Metadata: {},
Status: paid,
Brcode: 00020101021226870014br.gov.bcb.pix2565...,
Due: 02/10/2022 00:00:00,
Link: https://sandbox.api.starkinfra.com/invoicelink/5715709195239424,
IssuingTransactionID: 6306924158455808,
Created: 01/01/2022 00:00:00,
Updated: 01/02/2022 00:00:00
)
Go
{
Id:5715709195239424
Amount:10000
TaxId:20.018.183/0001-80
Name:Tony Stark
Tags:[department: tech]
Metadata:map[]
Brcode:00020101021226870014br.gov.bcb.pix2565...
Due:2022-02-10 00:00:00 +0000 +0000
Link:https://sandbox.api.starkinfra.com/invoicelink/5715709195239424
Status:paid
IssuingTransactionId:6306924158455808
Updated:2022-01-02 00:00:00 +0000 +0000
Created:2022-01-01 00:00:00 +0000 +0000
}
Clojure
Not yet available. Please contact us if you need this SDK.
Curl
{
"cursor": null,
"invoices": [
{
"id": "5715709195239424",
"amount": 10000,
"taxId": "20.018.183/0001-80",
"name": "Tony Stark",
"tags": ["department: tech"],
"metadata": {},
"status": "paid",
"brcode": "00020101021226870014br.gov.bcb.pix2565...",
"due": "2022-02-10T00:00:00.000000+00:00",
"link": "https://sandbox.api.starkinfra.com/invoicelink/5715709195239424",
"issuingTransactionId": "6306924158455808",
"created": "2022-01-01T00:00:00.000000+00:00",
"updated": "2022-01-02T00:00:00.000000+00:00"
}
]
}
Getting an Invoice
Fetch a single invoice by its id — for example to re-read its current "status" or recover its "brcode" and "link" to present the Pix again.
Parameters
Python
import starkinfra
invoice = starkinfra.issuinginvoice.get("5715709195239424")
print(invoice)
Javascript
const starkinfra = require('starkinfra');
(async() => {
let invoice = await starkinfra.issuingInvoice.get('5715709195239424');
console.log(invoice);
})();
PHP
$invoice = StarkInfra\IssuingInvoice::get("5715709195239424");
print_r($invoice);
Java
import com.starkinfra.*;
IssuingInvoice invoice = IssuingInvoice.get("5715709195239424");
System.out.println(invoice);
Ruby
require('starkinfra')
invoice = StarkInfra::IssuingInvoice.get("5715709195239424")
puts invoice
Elixir
invoice = StarkInfra.IssuingInvoice.get!("5715709195239424")
IO.inspect(invoice)
C#
using System;
StarkInfra.IssuingInvoice invoice = StarkInfra.IssuingInvoice.Get("5715709195239424");
Console.WriteLine(invoice);
Go
package main
import (
"fmt"
"github.com/starkinfra/sdk-go/starkinfra/issuinginvoice"
)
func main() {
invoice, err := issuinginvoice.Get("5715709195239424", nil)
if err.Errors != nil {
for _, e := range err.Errors {
fmt.Printf("code: %s, message: %s", e.Code, e.Message)
}
}
fmt.Printf("%+v", invoice)
}
Clojure
Not yet available. Please contact us if you need this SDK.
Curl
curl --location --request GET '{{baseUrl}}/v2/issuing-invoice/5715709195239424' \
--header 'Access-Id: {{accessId}}' \
--header 'Access-Time: {{accessTime}}' \
--header 'Access-Signature: {{accessSignature}}'
Python
IssuingInvoice(
id=5715709195239424,
amount=10000,
tax_id=20.018.183/0001-80,
name=Tony Stark,
tags=['department: tech'],
metadata={},
status=created,
brcode=00020101021226870014br.gov.bcb.pix2565...,
due=2022-02-10 00:00:00,
link=https://sandbox.api.starkinfra.com/invoicelink/5715709195239424,
issuing_transaction_id=None,
created=2022-01-01 00:00:00,
updated=2022-01-01 00:00:00
)
Javascript
IssuingInvoice {
id: '5715709195239424',
amount: 10000,
taxId: '20.018.183/0001-80',
name: 'Tony Stark',
tags: [ 'department: tech' ],
metadata: {},
status: 'created',
brcode: '00020101021226870014br.gov.bcb.pix2565...',
due: '2022-02-10T00:00:00.000000+00:00',
link: 'https://sandbox.api.starkinfra.com/invoicelink/5715709195239424',
issuingTransactionId: null,
created: '2022-01-01T00:00:00.000000+00:00',
updated: '2022-01-01T00:00:00.000000+00:00'
}
PHP
StarkInfra\IssuingInvoice Object
(
[id] => 5715709195239424
[amount] => 10000
[taxId] => 20.018.183/0001-80
[name] => Tony Stark
[tags] => Array ( [0] => department: tech )
[metadata] => Array ( )
[status] => created
[brcode] => 00020101021226870014br.gov.bcb.pix2565...
[due] => DateTime Object ( [date] => 2022-02-10 00:00:00.000000 )
[link] => https://sandbox.api.starkinfra.com/invoicelink/5715709195239424
[issuingTransactionId] =>
[created] => DateTime Object ( [date] => 2022-01-01 00:00:00.000000 )
[updated] => DateTime Object ( [date] => 2022-01-01 00:00:00.000000 )
)
Java
IssuingInvoice({
"id": "5715709195239424",
"amount": 10000,
"taxId": "20.018.183/0001-80",
"name": "Tony Stark",
"tags": ["department: tech"],
"metadata": {},
"status": "created",
"brcode": "00020101021226870014br.gov.bcb.pix2565...",
"due": "2022-02-10T00:00:00.000000+00:00",
"link": "https://sandbox.api.starkinfra.com/invoicelink/5715709195239424",
"issuingTransactionId": null,
"created": "2022-01-01T00:00:00.000000+00:00",
"updated": "2022-01-01T00:00:00.000000+00:00"
})
Ruby
issuinginvoice(
id: 5715709195239424,
amount: 10000,
tax_id: 20.018.183/0001-80,
name: Tony Stark,
tags: ["department: tech"],
metadata: {},
status: created,
brcode: 00020101021226870014br.gov.bcb.pix2565...,
due: 2022-02-10T00:00:00+00:00,
link: https://sandbox.api.starkinfra.com/invoicelink/5715709195239424,
issuing_transaction_id: nil,
created: 2022-01-01T00:00:00+00:00,
updated: 2022-01-01T00:00:00+00:00
)
Elixir
%StarkInfra.IssuingInvoice{
id: "5715709195239424",
amount: 10000,
tax_id: "20.018.183/0001-80",
name: "Tony Stark",
tags: ["department: tech"],
metadata: %{},
status: "created",
brcode: "00020101021226870014br.gov.bcb.pix2565...",
due: "2022-02-10T00:00:00.000000+00:00",
link: "https://sandbox.api.starkinfra.com/invoicelink/5715709195239424",
issuing_transaction_id: nil,
created: "2022-01-01T00:00:00.000000+00:00",
updated: "2022-01-01T00:00:00.000000+00:00"
}
C#
IssuingInvoice(
Id: 5715709195239424,
Amount: 10000,
TaxId: 20.018.183/0001-80,
Name: Tony Stark,
Tags: [department: tech],
Metadata: {},
Status: created,
Brcode: 00020101021226870014br.gov.bcb.pix2565...,
Due: 02/10/2022 00:00:00,
Link: https://sandbox.api.starkinfra.com/invoicelink/5715709195239424,
IssuingTransactionID: ,
Created: 01/01/2022 00:00:00,
Updated: 01/01/2022 00:00:00
)
Go
{
Id:5715709195239424
Amount:10000
TaxId:20.018.183/0001-80
Name:Tony Stark
Tags:[department: tech]
Metadata:map[]
Brcode:00020101021226870014br.gov.bcb.pix2565...
Due:2022-02-10 00:00:00 +0000 +0000
Link:https://sandbox.api.starkinfra.com/invoicelink/5715709195239424
Status:created
IssuingTransactionId:
Updated:2022-01-01 00:00:00 +0000 +0000
Created:2022-01-01 00:00:00 +0000 +0000
}
Clojure
Not yet available. Please contact us if you need this SDK.
Curl
{
"invoice": {
"id": "5715709195239424",
"amount": 10000,
"taxId": "20.018.183/0001-80",
"name": "Tony Stark",
"tags": ["department: tech"],
"metadata": {},
"status": "created",
"brcode": "00020101021226870014br.gov.bcb.pix2565...",
"due": "2022-02-10T00:00:00.000000+00:00",
"link": "https://sandbox.api.starkinfra.com/invoicelink/5715709195239424",
"issuingTransactionId": null,
"created": "2022-01-01T00:00:00.000000+00:00",
"updated": "2022-01-01T00:00:00.000000+00:00"
}
}
Getting an Invoice's Logs
Follow an invoice's life cycle by querying its logs. Filter by "types" (e.g. "paid") to react only to the transitions you care about, or by "ids" to scope to specific invoices, plus "after" / "before". Fetch a single log with GET /v2/issuing-invoice/log/:id.
Parameters
Python
import starkinfra
logs = starkinfra.issuinginvoice.log.query(
ids=["5715709195239424"]
)
for log in logs:
print(log)
Javascript
const starkinfra = require('starkinfra');
(async() => {
let logs = await starkinfra.issuingInvoice.log.query({
ids: ['5715709195239424']
});
for await (let log of logs) {
console.log(log);
}
})();
PHP
$logs = StarkInfra\IssuingInvoice\Log::query([
"ids" => ["5715709195239424"]
]);
foreach ($logs as $log) {
print_r($log);
}
Java
import com.starkinfra.*; import java.util.HashMap; HashMapparams = new HashMap<>(); params.put("ids", new String[]{"5715709195239424"}); Generator logs = IssuingInvoice.Log.query(params); for (IssuingInvoice.Log log : logs) { System.out.println(log); }
Ruby
require('starkinfra')
logs = StarkInfra::IssuingInvoice::Log.query(
ids: ["5715709195239424"]
)
logs.each do |log|
puts log
end
Elixir
logs = StarkInfra.IssuingInvoice.Log.query!(
ids: ["5715709195239424"]
)
logs |> Enum.each(&IO.inspect/1)
C#
using System; using System.Collections.Generic; IEnumerablelogs = StarkInfra.IssuingInvoice.Log.Query( ids: new List { "5715709195239424" } ); foreach (StarkInfra.IssuingInvoice.Log log in logs) { Console.WriteLine(log); }
Go
package main
import (
"fmt"
"github.com/starkinfra/sdk-go/starkinfra/issuinginvoice/log"
)
func main() {
var params = map[string]interface{}{}
params["ids"] = []string{"5715709195239424"}
logs, errorChannel := log.Query(params, nil)
for log := range logs {
fmt.Printf("%+v", log)
}
for err := range errorChannel {
fmt.Printf("%+v", err)
}
}
Clojure
Not yet available. Please contact us if you need this SDK.
Curl
curl --location --request GET '{{baseUrl}}/v2/issuing-invoice/log?ids=5715709195239424' \
--header 'Access-Id: {{accessId}}' \
--header 'Access-Time: {{accessTime}}' \
--header 'Access-Signature: {{accessSignature}}'
Python
Log(
id=6724771005489152,
type=created,
invoice=IssuingInvoice(id=5715709195239424, amount=10000, status=created, ...),
created=2022-01-01 00:00:00
)
Log(
id=5547499534213120,
type=paid,
invoice=IssuingInvoice(id=5715709195239424, amount=10000, status=paid, ...),
created=2022-01-02 00:00:00
)
Javascript
Log {
id: '6724771005489152',
type: 'created',
invoice: IssuingInvoice { id: '5715709195239424', amount: 10000, status: 'created', ... },
created: '2022-01-01T00:00:00.000000+00:00'
}
Log {
id: '5547499534213120',
type: 'paid',
invoice: IssuingInvoice { id: '5715709195239424', amount: 10000, status: 'paid', ... },
created: '2022-01-02T00:00:00.000000+00:00'
}
PHP
StarkInfra\IssuingInvoice\Log Object
(
[id] => 6724771005489152
[type] => created
[invoice] => StarkInfra\IssuingInvoice Object ( [id] => 5715709195239424 [amount] => 10000 [status] => created ... )
[created] => DateTime Object ( [date] => 2022-01-01 00:00:00.000000 )
)
StarkInfra\IssuingInvoice\Log Object
(
[id] => 5547499534213120
[type] => paid
[invoice] => StarkInfra\IssuingInvoice Object ( [id] => 5715709195239424 [amount] => 10000 [status] => paid ... )
[created] => DateTime Object ( [date] => 2022-01-02 00:00:00.000000 )
)
Java
IssuingInvoice.Log({
"id": "6724771005489152",
"type": "created",
"invoice": {"id": "5715709195239424", "amount": 10000, "status": "created", ...},
"created": "2022-01-01T00:00:00.000000+00:00"
})
IssuingInvoice.Log({
"id": "5547499534213120",
"type": "paid",
"invoice": {"id": "5715709195239424", "amount": 10000, "status": "paid", ...},
"created": "2022-01-02T00:00:00.000000+00:00"
})
Ruby
log(
id: 6724771005489152,
type: created,
invoice: issuinginvoice(id: 5715709195239424, amount: 10000, status: created, ...),
created: 2022-01-01T00:00:00+00:00
)
log(
id: 5547499534213120,
type: paid,
invoice: issuinginvoice(id: 5715709195239424, amount: 10000, status: paid, ...),
created: 2022-01-02T00:00:00+00:00
)
Elixir
%StarkInfra.IssuingInvoice.Log{
id: "6724771005489152",
type: "created",
invoice: %StarkInfra.IssuingInvoice{id: "5715709195239424", amount: 10000, status: "created", ...},
created: "2022-01-01T00:00:00.000000+00:00"
}
%StarkInfra.IssuingInvoice.Log{
id: "5547499534213120",
type: "paid",
invoice: %StarkInfra.IssuingInvoice{id: "5715709195239424", amount: 10000, status: "paid", ...},
created: "2022-01-02T00:00:00.000000+00:00"
}
C#
IssuingInvoice.Log(
Id: 6724771005489152,
Type: created,
Invoice: IssuingInvoice(Id: 5715709195239424, Amount: 10000, Status: created, ...),
Created: 01/01/2022 00:00:00
)
IssuingInvoice.Log(
Id: 5547499534213120,
Type: paid,
Invoice: IssuingInvoice(Id: 5715709195239424, Amount: 10000, Status: paid, ...),
Created: 01/02/2022 00:00:00
)
Go
{
Id:6724771005489152
Type:created
Invoice:{Id:5715709195239424 Amount:10000 Status:created ...}
Created:2022-01-01 00:00:00 +0000 +0000
}
{
Id:5547499534213120
Type:paid
Invoice:{Id:5715709195239424 Amount:10000 Status:paid ...}
Created:2022-01-02 00:00:00 +0000 +0000
}
Clojure
Not yet available. Please contact us if you need this SDK.
Curl
{
"cursor": null,
"logs": [
{
"id": "6724771005489152",
"type": "created",
"invoice": {"id": "5715709195239424", "amount": 10000, "status": "created", ...},
"created": "2022-01-01T00:00:00.000000+00:00"
},
{
"id": "5547499534213120",
"type": "paid",
"invoice": {"id": "5715709195239424", "amount": 10000, "status": "paid", ...},
"created": "2022-01-02T00:00:00.000000+00:00"
}
]
}
Issuing Billing Invoice Overview
An Issuing Billing Invoice is the postpaid settlement document of a credit issuing operation. At the close of each billing period Stark Infra consolidates everything your cards spent and bills it back to you as a single Pix invoice that you pay.
It is composed of Issuing Billing Transaction entries. Each purchase, withdrawal, refund and reversal settled in the period becomes a billing transaction; the invoice's nominalAmount is the sum of those entries. Query the Issuing Billing Transaction section to see the line items behind an invoice.
Read-only. You do not create or update billing invoices — Stark Infra generates and closes them on the billing cycle. The only operations available here are listing them and fetching one by id.
Pay it before funding. While an invoice is "pending" or "overdue" you cannot create a funding Issuing Invoice — settle the outstanding billing invoice first. Pay it with its brcode (a Pix BR Code) or by opening its link.
Money direction & amounts. nominalAmount is the original amount owed for the period; amount is what you owe right now — equal to nominalAmount until the due date, then growing by fine and interest once the invoice is overdue. Both are integers in cents (e.g. 100000 = R$ 1,000.00). fine is a one-off percentage and interest a monthly percentage, applied only when you pay after the due date.
Billing Invoice Statuses
Each Issuing Billing Invoice has a status that reflects where it is in the billing cycle:
| Status | Description |
|---|---|
| created | The invoice was generated for the billing period but is not yet open for payment. |
| pending | The invoice is open and awaiting payment. Pay it with its brcode or link before the due date to avoid fine and interest. |
| overdue | The due date passed without payment. The amount now grows by fine and interest until it is paid. |
| paid | The invoice was settled. No further amount is owed for the period. |
| expired | The invoice was not paid and is no longer payable through this document. The outstanding balance is handled outside this flow. |
Listing Billing Invoices
List your billing invoices in chunks of at most 100. Filter by "status" (created, pending, overdue, expired, paid), by "after" / "before" on the creation date, by "ids" or by "tags".
Use "status=pending" to find what you currently owe — these are the invoices that must be paid before you can fund your operation with a new Issuing Invoice.
Parameters
Python
import starkinfra
billing_invoices = starkinfra.issuingbillinginvoice.query(
limit=10,
status="pending"
)
for billing_invoice in billing_invoices:
print(billing_invoice)
Javascript
const starkinfra = require('starkinfra');
(async() => {
let billingInvoices = await starkinfra.issuingBillingInvoice.query({
limit: 10,
status: 'pending'
});
for await (let billingInvoice of billingInvoices) {
console.log(billingInvoice);
}
})();
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/issuing-billing-invoice?limit=10&status=pending' \
--header 'Access-Id: {{accessId}}' \
--header 'Access-Time: {{accessTime}}' \
--header 'Access-Signature: {{accessSignature}}'
Python
IssuingBillingInvoice(
id=5715709195239424,
name=Tony Stark,
tax_id=012.345.678-90,
fine=2.0,
interest=1.0,
status=pending,
amount=100000,
nominal_amount=100000,
brcode=00020101021226930014br.gov.bcb.pix2571brcode-h.sandbox.starkinfra.com/v2/d6a916beba1c41a5bbe31d63a93553c35204000053039865802BR5925Stark Bank S.A.6009Sao Paulo62070503***6304811B,
link=https://invoice-h.sandbox.starkbank.com/invoicelink/851ff545535c40ba88e24a05accb9978,
due=2022-02-10 00:00:00,
start=2022-01-01 00:00:00,
end=2022-01-31 23:59:59,
created=2022-02-01 00:00:00,
updated=2022-02-01 00:00:00
)
Javascript
IssuingBillingInvoice {
id: '5715709195239424',
name: 'Tony Stark',
taxId: '012.345.678-90',
fine: 2.0,
interest: 1.0,
status: 'pending',
amount: 100000,
nominalAmount: 100000,
brcode: '00020101021226930014br.gov.bcb.pix2571brcode-h.sandbox.starkinfra.com/v2/d6a916beba1c41a5bbe31d63a93553c35204000053039865802BR5925Stark Bank S.A.6009Sao Paulo62070503***6304811B',
link: 'https://invoice-h.sandbox.starkbank.com/invoicelink/851ff545535c40ba88e24a05accb9978',
due: '2022-02-10T00:00:00.000000+00:00',
start: '2022-01-01T00:00:00.000000+00:00',
end: '2022-01-31T23:59:59.999999+00:00',
created: '2022-02-01T00:00:00.000000+00:00',
updated: '2022-02-01T00:00:00.000000+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": null,
"invoices": [
{
"id": "5715709195239424",
"taxId": "012.345.678-90",
"name": "Tony Stark",
"fine": 2.0,
"interest": 1.0,
"amount": 100000,
"nominalAmount": 100000,
"status": "pending",
"brcode": "00020101021226930014br.gov.bcb.pix2571brcode-h.sandbox.starkinfra.com/v2/d6a916beba1c41a5bbe31d63a93553c35204000053039865802BR5925Stark Bank S.A.6009Sao Paulo62070503***6304811B",
"link": "https://invoice-h.sandbox.starkbank.com/invoicelink/851ff545535c40ba88e24a05accb9978",
"due": "2022-02-10T00:00:00.000000+00:00",
"start": "2022-01-01T00:00:00.000000+00:00",
"end": "2022-01-31T23:59:59.999999+00:00",
"created": "2022-02-01T00:00:00.000000+00:00",
"updated": "2022-02-01T00:00:00.000000+00:00"
}
]
}
Getting a Billing Invoice
Fetch a single billing invoice by its id to read its current amount, status, due date and the brcode / link you use to pay it.
The billing period the invoice covers is given by "start" and "end"; "due" is when payment is expected. Once overdue, "amount" reflects the original "nominalAmount" plus the accrued fine and interest.
Parameters
Python
import starkinfra
billing_invoice = starkinfra.issuingbillinginvoice.get("5715709195239424")
print(billing_invoice)
Javascript
const starkinfra = require('starkinfra');
(async() => {
let billingInvoice = await starkinfra.issuingBillingInvoice.get('5715709195239424');
console.log(billingInvoice);
})();
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/issuing-billing-invoice/5715709195239424' \
--header 'Access-Id: {{accessId}}' \
--header 'Access-Time: {{accessTime}}' \
--header 'Access-Signature: {{accessSignature}}'
Python
IssuingBillingInvoice(
id=5715709195239424,
name=Tony Stark,
tax_id=012.345.678-90,
fine=2.0,
interest=1.0,
status=overdue,
amount=103000,
nominal_amount=100000,
brcode=00020101021226930014br.gov.bcb.pix2571brcode-h.sandbox.starkinfra.com/v2/d6a916beba1c41a5bbe31d63a93553c35204000053039865802BR5925Stark Bank S.A.6009Sao Paulo62070503***6304811B,
link=https://invoice-h.sandbox.starkbank.com/invoicelink/851ff545535c40ba88e24a05accb9978,
due=2022-02-10 00:00:00,
start=2022-01-01 00:00:00,
end=2022-01-31 23:59:59,
created=2022-02-01 00:00:00,
updated=2022-02-15 00:00:00
)
Javascript
IssuingBillingInvoice {
id: '5715709195239424',
name: 'Tony Stark',
taxId: '012.345.678-90',
fine: 2.0,
interest: 1.0,
status: 'overdue',
amount: 103000,
nominalAmount: 100000,
brcode: '00020101021226930014br.gov.bcb.pix2571brcode-h.sandbox.starkinfra.com/v2/d6a916beba1c41a5bbe31d63a93553c35204000053039865802BR5925Stark Bank S.A.6009Sao Paulo62070503***6304811B',
link: 'https://invoice-h.sandbox.starkbank.com/invoicelink/851ff545535c40ba88e24a05accb9978',
due: '2022-02-10T00:00:00.000000+00:00',
start: '2022-01-01T00:00:00.000000+00:00',
end: '2022-01-31T23:59:59.999999+00:00',
created: '2022-02-01T00:00:00.000000+00:00',
updated: '2022-02-15T00:00:00.000000+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
{
"invoice": {
"id": "5715709195239424",
"taxId": "012.345.678-90",
"name": "Tony Stark",
"fine": 2.0,
"interest": 1.0,
"amount": 103000,
"nominalAmount": 100000,
"status": "overdue",
"brcode": "00020101021226930014br.gov.bcb.pix2571brcode-h.sandbox.starkinfra.com/v2/d6a916beba1c41a5bbe31d63a93553c35204000053039865802BR5925Stark Bank S.A.6009Sao Paulo62070503***6304811B",
"link": "https://invoice-h.sandbox.starkbank.com/invoicelink/851ff545535c40ba88e24a05accb9978",
"due": "2022-02-10T00:00:00.000000+00:00",
"start": "2022-01-01T00:00:00.000000+00:00",
"end": "2022-01-31T23:59:59.999999+00:00",
"created": "2022-02-01T00:00:00.000000+00:00",
"updated": "2022-02-15T00:00:00.000000+00:00"
}
}
Issuing Billing Transaction Overview
An Issuing Billing Transaction is a single line entry that composes an Issuing Billing Invoice. Each purchase, withdrawal or fee that was billed in a period produces one transaction — and an installment purchase produces one transaction per installment that falls in that period.
This is a read-only, query-only resource: there is one endpoint and it lists transactions. You never create, update or cancel a transaction directly — they are generated by Stark Infra as purchases settle into invoices.
Reconciling an invoice. Pass "invoiceId" to list every transaction that makes up a given Issuing Billing Invoice. The transactions are ordered as they were applied, and each one carries the running "balance" — the invoice balance in cents after that transaction — so the last transaction's balance equals the invoice total.
Tracing back to the purchase. The "source" field points to the entity that originated the transaction, formatted as "
Installments
When a purchase is split into installments, each installment is billed as its own transaction. "installmentCount" is the total number of installments of the source purchase and "installment" is the number of this one (1-based). A single-payment purchase has "installment": 1 and "installmentCount": 1.
The transactions for the different installments of the same purchase share the same originating "source", but each lands in the invoice of its own billing period — so to see them all you query across invoices, not within a single one.
Amounts and currency
All amounts are integers in cents. "amount" is what was billed in BRL (e.g. 30000 = R$ 300.00) and "tax" is the IOF in cents applied to the transaction. For international transactions, "merchantAmount" and "merchantCurrencyCode" hold the amount in the merchant's currency and "rate" is the conversion rate that was applied; for domestic transactions the merchant amount equals the amount, the code is "BRL" and the rate is 1.0.
Listing Billing Transactions
List billing transactions in pages of up to 100 ("limit"). The response wraps the results in a "transactions" list plus a "cursor" — pass the cursor back to fetch the next page; a null cursor means there are no more results.
Pass "invoiceId" to scope the list to a single Issuing Billing Invoice and reconcile it to its line entries. You can also filter by "ids" (a comma-separated list of specific transaction ids), by "tags", and by "after" / "before" to bound the creation date.
Parameters
Python
import starkinfra
transactions = starkinfra.issuingbillingtransaction.query(
limit=10,
invoice_id="5715709195239424"
)
for transaction in transactions:
print(transaction)
Javascript
const starkinfra = require('starkinfra');
(async() => {
let transactions = await starkinfra.issuingBillingTransaction.query({
limit: 10,
invoiceId: '5715709195239424'
});
for await (let transaction of transactions) {
console.log(transaction);
}
})();
PHP
$transactions = StarkInfra\IssuingBillingTransaction::query([
"limit" => 10,
"invoiceId" => "5715709195239424"
]);
foreach ($transactions as $transaction) {
print_r($transaction);
}
Java
import com.starkinfra.*; import java.util.HashMap; HashMapparams = new HashMap<>(); params.put("limit", 10); params.put("invoiceId", "5715709195239424"); Generator transactions = IssuingBillingTransaction.query(params); for (IssuingBillingTransaction transaction : transactions) { System.out.println(transaction); }
Ruby
require('starkinfra')
transactions = StarkInfra::IssuingBillingTransaction.query(
limit: 10,
invoice_id: "5715709195239424"
)
transactions.each do |transaction|
puts transaction
end
Elixir
transactions = StarkInfra.IssuingBillingTransaction.query!(
limit: 10,
invoice_id: "5715709195239424"
)
transactions |> Enum.each(&IO.inspect/1)
C#
using System; using System.Collections.Generic; IEnumerabletransactions = StarkInfra.IssuingBillingTransaction.Query( limit: 10, invoiceId: "5715709195239424" ); foreach (StarkInfra.IssuingBillingTransaction transaction in transactions) { Console.WriteLine(transaction); }
Go
package main
import (
"fmt"
"github.com/starkinfra/sdk-go/starkinfra/issuingbillingtransaction"
)
func main() {
var params = map[string]interface{}{
"limit": 10,
"invoiceId": "5715709195239424",
}
transactions := issuingbillingtransaction.Query(params, nil)
for transaction := range transactions {
fmt.Printf("%+v", transaction)
}
}
Clojure
Not yet available. Please contact us if you need this SDK.
Curl
curl --location --request GET '{{baseUrl}}/v2/issuing-billing-transaction?limit=10&invoiceId=5715709195239424' \
--header 'Access-Id: {{accessId}}' \
--header 'Access-Time: {{accessTime}}' \
--header 'Access-Signature: {{accessSignature}}'
Python
IssuingBillingTransaction(
id=5715709195239424,
installment=1,
installment_count=3,
amount=30000,
balance=60000,
source=issuing-purchase/5155165527080960,
external_id=5155165527080960-1,
description=Stark Coffee Shop,
card_ending=1234,
holder_name=Tony Stark,
tax=0,
rate=1.0,
merchant_amount=30000,
merchant_currency_code=BRL,
created=2022-01-01 00:00:00
)
Javascript
IssuingBillingTransaction {
id: '5715709195239424',
installment: 1,
installmentCount: 3,
amount: 30000,
balance: 60000,
source: 'issuing-purchase/5155165527080960',
externalId: '5155165527080960-1',
description: 'Stark Coffee Shop',
cardEnding: '1234',
holderName: 'Tony Stark',
tax: 0,
rate: 1.0,
merchantAmount: 30000,
merchantCurrencyCode: 'BRL',
created: '2022-01-01T00:00:00.000000+00:00'
}
PHP
StarkInfra\IssuingBillingTransaction Object
(
[id] => 5715709195239424
[installment] => 1
[installmentCount] => 3
[amount] => 30000
[balance] => 60000
[source] => issuing-purchase/5155165527080960
[externalId] => 5155165527080960-1
[description] => Stark Coffee Shop
[cardEnding] => 1234
[holderName] => Tony Stark
[tax] => 0
[rate] => 1
[merchantAmount] => 30000
[merchantCurrencyCode] => BRL
[created] => DateTime Object ( [date] => 2022-01-01 00:00:00.000000 )
)
Java
IssuingBillingTransaction({
"id": "5715709195239424",
"installment": 1,
"installmentCount": 3,
"amount": 30000,
"balance": 60000,
"source": "issuing-purchase/5155165527080960",
"externalId": "5155165527080960-1",
"description": "Stark Coffee Shop",
"cardEnding": "1234",
"holderName": "Tony Stark",
"tax": 0,
"rate": 1.0,
"merchantAmount": 30000,
"merchantCurrencyCode": "BRL",
"created": "2022-01-01T00:00:00.000000+00:00"
})
Ruby
issuingbillingtransaction(
id: 5715709195239424,
installment: 1,
installment_count: 3,
amount: 30000,
balance: 60000,
source: issuing-purchase/5155165527080960,
external_id: 5155165527080960-1,
description: Stark Coffee Shop,
card_ending: 1234,
holder_name: Tony Stark,
tax: 0,
rate: 1.0,
merchant_amount: 30000,
merchant_currency_code: BRL,
created: 2022-01-01T00:00:00+00:00
)
Elixir
%StarkInfra.IssuingBillingTransaction{
id: "5715709195239424",
installment: 1,
installment_count: 3,
amount: 30000,
balance: 60000,
source: "issuing-purchase/5155165527080960",
external_id: "5155165527080960-1",
description: "Stark Coffee Shop",
card_ending: "1234",
holder_name: "Tony Stark",
tax: 0,
rate: 1.0,
merchant_amount: 30000,
merchant_currency_code: "BRL",
created: "2022-01-01T00:00:00.000000+00:00"
}
C#
IssuingBillingTransaction(
Id: 5715709195239424,
Installment: 1,
InstallmentCount: 3,
Amount: 30000,
Balance: 60000,
Source: issuing-purchase/5155165527080960,
ExternalId: 5155165527080960-1,
Description: Stark Coffee Shop,
CardEnding: 1234,
HolderName: Tony Stark,
Tax: 0,
Rate: 1.0,
MerchantAmount: 30000,
MerchantCurrencyCode: BRL,
Created: 01/01/2022 00:00:00
)
Go
{
Id:5715709195239424
Installment:1
InstallmentCount:3
Amount:30000
Balance:60000
Source:issuing-purchase/5155165527080960
ExternalId:5155165527080960-1
Description:Stark Coffee Shop
CardEnding:1234
HolderName:Tony Stark
Tax:0
Rate:1
MerchantAmount:30000
MerchantCurrencyCode:BRL
Created:2022-01-01 00:00:00 +0000 +0000
}
Clojure
Not yet available. Please contact us if you need this SDK.
Curl
{
"cursor": null,
"transactions": [
{
"id": "5715709195239424",
"installment": 1,
"installmentCount": 3,
"amount": 30000,
"balance": 60000,
"source": "issuing-purchase/5155165527080960",
"externalId": "5155165527080960-1",
"description": "Stark Coffee Shop",
"cardEnding": "1234",
"holderName": "Tony Stark",
"tax": 0,
"rate": 1.0,
"merchantAmount": 30000,
"merchantCurrencyCode": "BRL",
"created": "2022-01-01T00:00:00.000000+00:00"
}
]
}
Issuing Withdrawal Overview
An Issuing Withdrawal moves funds out of your Issuing Balance and back into your Stark Infra workspace. It is the inverse of a funding Issuing Invoice: where an invoice tops your issuing balance up, a withdrawal drains the excess back to your main account.
Use a withdrawal whenever your issuing balance holds more than you need to back your cards — the money returns to your regular Stark Infra balance, where it can be transferred out or reused.
Two transaction ids. A successful withdrawal records both legs of the move: issuingTransactionId is the debit on your issuing balance, and transactionId is the matching credit on your Stark Infra workspace balance. Both are returned only after the withdrawal settles.
externalId (idempotency). You assign your own externalId to each withdrawal. It must be unique per workspace — sending a withdrawal whose externalId was already used is rejected, so a retried request never withdraws twice. Use it later to look a withdrawal back up with the externalIds filter.
amount is an integer in cents (e.g. 10000 means R$100.00) and must be positive. description is mandatory and must be 10 to 200 characters long.
Creating a Withdrawal
Create a withdrawal by sending amount, externalId and description. The amount is debited from your issuing balance and credited back to your Stark Infra workspace balance.
The externalId must be unique per workspace — a repeated externalId is rejected, which makes a retried request safe. The description is mandatory and must be 10 to 200 characters.
The response echoes the withdrawal together with the transactionId (workspace credit) and issuingTransactionId (issuing-balance debit) recorded for the move.
Parameters
Python
import starkinfra
withdrawal = starkinfra.issuingwithdrawal.create(
starkinfra.IssuingWithdrawal(
amount=10000,
external_id="withdrawal-2022-001",
description="Excess funds withdrawal",
tags=["tony", "stark"]
)
)
print(withdrawal)
Javascript
const starkinfra = require('starkinfra');
(async() => {
let withdrawal = await starkinfra.issuingWithdrawal.create({
amount: 10000,
externalId: 'withdrawal-2022-001',
description: 'Excess funds withdrawal',
tags: ['tony', 'stark']
});
console.log(withdrawal);
})();
PHP
$withdrawal = StarkInfra\IssuingWithdrawal::create(
new StarkInfra\IssuingWithdrawal([
"amount" => 10000,
"externalId" => "withdrawal-2022-001",
"description" => "Excess funds withdrawal",
"tags" => ["tony", "stark"]
])
);
print_r($withdrawal);
Java
import com.starkinfra.*; import java.util.HashMap; HashMapdata = new HashMap<>(); data.put("amount", 10000); data.put("externalId", "withdrawal-2022-001"); data.put("description", "Excess funds withdrawal"); data.put("tags", new String[]{"tony", "stark"}); IssuingWithdrawal withdrawal = IssuingWithdrawal.create(new IssuingWithdrawal(data)); System.out.println(withdrawal);
Ruby
require('starkinfra')
withdrawal = StarkInfra::IssuingWithdrawal.create(
StarkInfra::IssuingWithdrawal.new(
amount: 10000,
external_id: "withdrawal-2022-001",
description: "Excess funds withdrawal",
tags: ["tony", "stark"]
)
)
puts withdrawal
Elixir
withdrawal = StarkInfra.IssuingWithdrawal.create!(
%StarkInfra.IssuingWithdrawal{
amount: 10000,
external_id: "withdrawal-2022-001",
description: "Excess funds withdrawal",
tags: ["tony", "stark"]
}
)
IO.inspect(withdrawal)
C#
using System;
using System.Collections.Generic;
StarkInfra.IssuingWithdrawal withdrawal = StarkInfra.IssuingWithdrawal.Create(
new StarkInfra.IssuingWithdrawal(
amount: 10000,
externalID: "withdrawal-2022-001",
description: "Excess funds withdrawal",
tags: new List { "tony", "stark" }
)
);
Console.WriteLine(withdrawal);
Go
package main
import (
"fmt"
"github.com/starkinfra/sdk-go/starkinfra/issuingwithdrawal"
)
func main() {
withdrawal, err := issuingwithdrawal.Create(
issuingwithdrawal.IssuingWithdrawal{
Amount: 10000,
ExternalId: "withdrawal-2022-001",
Description: "Excess funds withdrawal",
Tags: []string{"tony", "stark"},
},
nil,
)
if err.Errors != nil {
for _, e := range err.Errors {
fmt.Printf("code: %s, message: %s", e.Code, e.Message)
}
}
fmt.Printf("%+v", withdrawal)
}
Clojure
Not yet available. Please contact us if you need this SDK.
Curl
curl --location --request POST '{{baseUrl}}/v2/issuing-withdrawal' \
--header 'Access-Id: {{accessId}}' \
--header 'Access-Time: {{accessTime}}' \
--header 'Access-Signature: {{accessSignature}}' \
--header 'Content-Type: application/json' \
--data-raw '{
"amount": 10000,
"externalId": "withdrawal-2022-001",
"description": "Excess funds withdrawal",
"tags": ["tony", "stark"]
}'
Python
IssuingWithdrawal(
id=5715709195239424,
amount=10000,
external_id=withdrawal-2022-001,
description=Excess funds withdrawal,
transaction_id=6724771005489152,
issuing_transaction_id=7834882116598271,
tags=['tony', 'stark'],
created=2022-01-01 00:00:00,
updated=2022-01-01 00:00:00
)
Javascript
IssuingWithdrawal {
id: '5715709195239424',
amount: 10000,
externalId: 'withdrawal-2022-001',
description: 'Excess funds withdrawal',
transactionId: '6724771005489152',
issuingTransactionId: '7834882116598271',
tags: ['tony', 'stark'],
created: '2022-01-01T00:00:00.000000+00:00',
updated: '2022-01-01T00:00:00.000000+00:00'
}
PHP
StarkInfra\IssuingWithdrawal Object
(
[id] => 5715709195239424
[amount] => 10000
[externalId] => withdrawal-2022-001
[description] => Excess funds withdrawal
[transactionId] => 6724771005489152
[issuingTransactionId] => 7834882116598271
[tags] => Array ( [0] => tony [1] => stark )
[created] => DateTime Object ( [date] => 2022-01-01 00:00:00.000000 )
[updated] => DateTime Object ( [date] => 2022-01-01 00:00:00.000000 )
)
Java
IssuingWithdrawal({
"id": "5715709195239424",
"amount": 10000,
"externalId": "withdrawal-2022-001",
"description": "Excess funds withdrawal",
"transactionId": "6724771005489152",
"issuingTransactionId": "7834882116598271",
"tags": ["tony", "stark"],
"created": "2022-01-01T00:00:00.000000+00:00",
"updated": "2022-01-01T00:00:00.000000+00:00"
})
Ruby
issuingwithdrawal(
id: 5715709195239424,
amount: 10000,
external_id: withdrawal-2022-001,
description: Excess funds withdrawal,
transaction_id: 6724771005489152,
issuing_transaction_id: 7834882116598271,
tags: ['tony', 'stark'],
created: 2022-01-01T00:00:00+00:00,
updated: 2022-01-01T00:00:00+00:00
)
Elixir
%StarkInfra.IssuingWithdrawal{
id: "5715709195239424",
amount: 10000,
external_id: "withdrawal-2022-001",
description: "Excess funds withdrawal",
transaction_id: "6724771005489152",
issuing_transaction_id: "7834882116598271",
tags: ["tony", "stark"],
created: "2022-01-01T00:00:00.000000+00:00",
updated: "2022-01-01T00:00:00.000000+00:00"
}
C#
IssuingWithdrawal(
Id: 5715709195239424,
Amount: 10000,
ExternalId: withdrawal-2022-001,
Description: Excess funds withdrawal,
TransactionId: 6724771005489152,
IssuingTransactionId: 7834882116598271,
Tags: { tony, stark },
Created: 01/01/2022 00:00:00,
Updated: 01/01/2022 00:00:00
)
Go
{
Id:5715709195239424
Amount:10000
ExternalId:withdrawal-2022-001
Description:Excess funds withdrawal
TransactionId:6724771005489152
IssuingTransactionId:7834882116598271
Tags:[tony stark]
Created:2022-01-01 00:00:00 +0000 +0000
Updated:2022-01-01 00:00:00 +0000 +0000
}
Clojure
Not yet available. Please contact us if you need this SDK.
Curl
{
"message": "Withdrawal successfully created.",
"withdrawal": {
"id": "5715709195239424",
"amount": 10000,
"description": "Excess funds withdrawal",
"transactionId": "6724771005489152",
"issuingTransactionId": "7834882116598271",
"externalId": "withdrawal-2022-001",
"tags": ["tony", "stark"],
"created": "2022-01-01T00:00:00.000000+00:00",
"updated": "2022-01-01T00:00:00.000000+00:00"
}
}
Listing Withdrawals
List your withdrawals in pages of up to 100. Filter by "after" / "before" (creation date), "tags", or "externalIds" to find the ones you assigned.
The response is paginated: follow the "cursor" to fetch the next page (null means the last page).
Parameters
Python
import starkinfra
withdrawals = starkinfra.issuingwithdrawal.query(
limit=10,
after="2022-01-01",
before="2022-12-31",
tags=["tony", "stark"]
)
for withdrawal in withdrawals:
print(withdrawal)
Javascript
const starkinfra = require('starkinfra');
(async() => {
let withdrawals = await starkinfra.issuingWithdrawal.query({
limit: 10,
after: '2022-01-01',
before: '2022-12-31',
tags: ['tony', 'stark']
});
for await (let withdrawal of withdrawals) {
console.log(withdrawal);
}
})();
PHP
$withdrawals = StarkInfra\IssuingWithdrawal::query([
"limit" => 10,
"after" => "2022-01-01",
"before" => "2022-12-31",
"tags" => ["tony", "stark"]
]);
foreach ($withdrawals as $withdrawal) {
print_r($withdrawal);
}
Java
import com.starkinfra.*; import java.util.Arrays; import java.util.HashMap; HashMapparams = new HashMap<>(); params.put("limit", 10); params.put("after", "2022-01-01"); params.put("before", "2022-12-31"); params.put("tags", Arrays.asList("tony", "stark")); Generator withdrawals = IssuingWithdrawal.query(params); for (IssuingWithdrawal withdrawal : withdrawals) { System.out.println(withdrawal); }
Ruby
require('starkinfra')
withdrawals = StarkInfra::IssuingWithdrawal.query(
limit: 10,
after: "2022-01-01",
before: "2022-12-31",
tags: ["tony", "stark"]
)
withdrawals.each do |withdrawal|
puts withdrawal
end
Elixir
withdrawals = StarkInfra.IssuingWithdrawal.query!(
limit: 10,
after: "2022-01-01",
before: "2022-12-31",
tags: ["tony", "stark"]
)
withdrawals |> Enum.each(&IO.inspect/1)
C#
using System; using System.Collections.Generic; IEnumerablewithdrawals = StarkInfra.IssuingWithdrawal.Query( limit: 10, after: new DateTime(2022, 1, 1), before: new DateTime(2022, 12, 31), tags: new List { "tony", "stark" } ); foreach (StarkInfra.IssuingWithdrawal withdrawal in withdrawals) { Console.WriteLine(withdrawal); }
Go
package main
import (
"fmt"
"github.com/starkinfra/sdk-go/starkinfra/issuingwithdrawal"
)
func main() {
var params = map[string]interface{}{}
params["limit"] = 10
params["after"] = "2022-01-01"
params["before"] = "2022-12-31"
params["tags"] = []string{"tony", "stark"}
withdrawals, errorChannel := issuingwithdrawal.Query(params, nil)
for withdrawal := range withdrawals {
fmt.Printf("%+v", withdrawal)
}
for err := range errorChannel {
fmt.Printf("%+v", err)
}
}
Clojure
Not yet available. Please contact us if you need this SDK.
Curl
curl --location --request GET '{{baseUrl}}/v2/issuing-withdrawal?limit=10&after=2022-01-01&before=2022-12-31&tags=tony,stark' \
--header 'Access-Id: {{accessId}}' \
--header 'Access-Time: {{accessTime}}' \
--header 'Access-Signature: {{accessSignature}}'
Python
IssuingWithdrawal(
id=5715709195239424,
amount=10000,
external_id=withdrawal-2022-001,
description=Excess funds withdrawal,
transaction_id=6724771005489152,
issuing_transaction_id=7834882116598271,
tags=['tony', 'stark'],
created=2022-01-01 00:00:00,
updated=2022-01-01 00:00:00
)
Javascript
IssuingWithdrawal {
id: '5715709195239424',
amount: 10000,
externalId: 'withdrawal-2022-001',
description: 'Excess funds withdrawal',
transactionId: '6724771005489152',
issuingTransactionId: '7834882116598271',
tags: ['tony', 'stark'],
created: '2022-01-01T00:00:00.000000+00:00',
updated: '2022-01-01T00:00:00.000000+00:00'
}
PHP
StarkInfra\IssuingWithdrawal Object
(
[id] => 5715709195239424
[amount] => 10000
[externalId] => withdrawal-2022-001
[description] => Excess funds withdrawal
[transactionId] => 6724771005489152
[issuingTransactionId] => 7834882116598271
[tags] => Array ( [0] => tony [1] => stark )
[created] => DateTime Object ( [date] => 2022-01-01 00:00:00.000000 )
[updated] => DateTime Object ( [date] => 2022-01-01 00:00:00.000000 )
)
Java
IssuingWithdrawal({
"id": "5715709195239424",
"amount": 10000,
"externalId": "withdrawal-2022-001",
"description": "Excess funds withdrawal",
"transactionId": "6724771005489152",
"issuingTransactionId": "7834882116598271",
"tags": ["tony", "stark"],
"created": "2022-01-01T00:00:00.000000+00:00",
"updated": "2022-01-01T00:00:00.000000+00:00"
})
Ruby
issuingwithdrawal(
id: 5715709195239424,
amount: 10000,
external_id: withdrawal-2022-001,
description: Excess funds withdrawal,
transaction_id: 6724771005489152,
issuing_transaction_id: 7834882116598271,
tags: ['tony', 'stark'],
created: 2022-01-01T00:00:00+00:00,
updated: 2022-01-01T00:00:00+00:00
)
Elixir
%StarkInfra.IssuingWithdrawal{
id: "5715709195239424",
amount: 10000,
external_id: "withdrawal-2022-001",
description: "Excess funds withdrawal",
transaction_id: "6724771005489152",
issuing_transaction_id: "7834882116598271",
tags: ["tony", "stark"],
created: "2022-01-01T00:00:00.000000+00:00",
updated: "2022-01-01T00:00:00.000000+00:00"
}
C#
IssuingWithdrawal(
Id: 5715709195239424,
Amount: 10000,
ExternalId: withdrawal-2022-001,
Description: Excess funds withdrawal,
TransactionId: 6724771005489152,
IssuingTransactionId: 7834882116598271,
Tags: { tony, stark },
Created: 01/01/2022 00:00:00,
Updated: 01/01/2022 00:00:00
)
Go
{
Id:5715709195239424
Amount:10000
ExternalId:withdrawal-2022-001
Description:Excess funds withdrawal
TransactionId:6724771005489152
IssuingTransactionId:7834882116598271
Tags:[tony stark]
Created:2022-01-01 00:00:00 +0000 +0000
Updated:2022-01-01 00:00:00 +0000 +0000
}
Clojure
Not yet available. Please contact us if you need this SDK.
Curl
{
"cursor": null,
"withdrawals": [
{
"id": "5715709195239424",
"amount": 10000,
"description": "Excess funds withdrawal",
"transactionId": "6724771005489152",
"issuingTransactionId": "7834882116598271",
"externalId": "withdrawal-2022-001",
"tags": ["tony", "stark"],
"created": "2022-01-01T00:00:00.000000+00:00",
"updated": "2022-01-01T00:00:00.000000+00:00"
}
]
}
Getting a Withdrawal
Fetch a single withdrawal by its id.
Parameters
Python
import starkinfra
withdrawal = starkinfra.issuingwithdrawal.get("5715709195239424")
print(withdrawal)
Javascript
const starkinfra = require('starkinfra');
(async() => {
let withdrawal = await starkinfra.issuingWithdrawal.get('5715709195239424');
console.log(withdrawal);
})();
PHP
$withdrawal = StarkInfra\IssuingWithdrawal::get("5715709195239424");
print_r($withdrawal);
Java
import com.starkinfra.*;
IssuingWithdrawal withdrawal = IssuingWithdrawal.get("5715709195239424");
System.out.println(withdrawal);
Ruby
require('starkinfra')
withdrawal = StarkInfra::IssuingWithdrawal.get("5715709195239424")
puts withdrawal
Elixir
withdrawal = StarkInfra.IssuingWithdrawal.get!("5715709195239424")
IO.inspect(withdrawal)
C#
using System;
StarkInfra.IssuingWithdrawal withdrawal = StarkInfra.IssuingWithdrawal.Get("5715709195239424");
Console.WriteLine(withdrawal);
Go
package main
import (
"fmt"
"github.com/starkinfra/sdk-go/starkinfra/issuingwithdrawal"
)
func main() {
withdrawal, err := issuingwithdrawal.Get("5715709195239424", nil)
if err.Errors != nil {
for _, e := range err.Errors {
fmt.Printf("code: %s, message: %s", e.Code, e.Message)
}
}
fmt.Printf("%+v", withdrawal)
}
Clojure
Not yet available. Please contact us if you need this SDK.
Curl
curl --location --request GET '{{baseUrl}}/v2/issuing-withdrawal/5715709195239424' \
--header 'Access-Id: {{accessId}}' \
--header 'Access-Time: {{accessTime}}' \
--header 'Access-Signature: {{accessSignature}}'
Python
IssuingWithdrawal(
id=5715709195239424,
amount=10000,
external_id=withdrawal-2022-001,
description=Excess funds withdrawal,
transaction_id=6724771005489152,
issuing_transaction_id=7834882116598271,
tags=['tony', 'stark'],
created=2022-01-01 00:00:00,
updated=2022-01-01 00:00:00
)
Javascript
IssuingWithdrawal {
id: '5715709195239424',
amount: 10000,
externalId: 'withdrawal-2022-001',
description: 'Excess funds withdrawal',
transactionId: '6724771005489152',
issuingTransactionId: '7834882116598271',
tags: ['tony', 'stark'],
created: '2022-01-01T00:00:00.000000+00:00',
updated: '2022-01-01T00:00:00.000000+00:00'
}
PHP
StarkInfra\IssuingWithdrawal Object
(
[id] => 5715709195239424
[amount] => 10000
[externalId] => withdrawal-2022-001
[description] => Excess funds withdrawal
[transactionId] => 6724771005489152
[issuingTransactionId] => 7834882116598271
[tags] => Array ( [0] => tony [1] => stark )
[created] => DateTime Object ( [date] => 2022-01-01 00:00:00.000000 )
[updated] => DateTime Object ( [date] => 2022-01-01 00:00:00.000000 )
)
Java
IssuingWithdrawal({
"id": "5715709195239424",
"amount": 10000,
"externalId": "withdrawal-2022-001",
"description": "Excess funds withdrawal",
"transactionId": "6724771005489152",
"issuingTransactionId": "7834882116598271",
"tags": ["tony", "stark"],
"created": "2022-01-01T00:00:00.000000+00:00",
"updated": "2022-01-01T00:00:00.000000+00:00"
})
Ruby
issuingwithdrawal(
id: 5715709195239424,
amount: 10000,
external_id: withdrawal-2022-001,
description: Excess funds withdrawal,
transaction_id: 6724771005489152,
issuing_transaction_id: 7834882116598271,
tags: ['tony', 'stark'],
created: 2022-01-01T00:00:00+00:00,
updated: 2022-01-01T00:00:00+00:00
)
Elixir
%StarkInfra.IssuingWithdrawal{
id: "5715709195239424",
amount: 10000,
external_id: "withdrawal-2022-001",
description: "Excess funds withdrawal",
transaction_id: "6724771005489152",
issuing_transaction_id: "7834882116598271",
tags: ["tony", "stark"],
created: "2022-01-01T00:00:00.000000+00:00",
updated: "2022-01-01T00:00:00.000000+00:00"
}
C#
IssuingWithdrawal(
Id: 5715709195239424,
Amount: 10000,
ExternalId: withdrawal-2022-001,
Description: Excess funds withdrawal,
TransactionId: 6724771005489152,
IssuingTransactionId: 7834882116598271,
Tags: { tony, stark },
Created: 01/01/2022 00:00:00,
Updated: 01/01/2022 00:00:00
)
Go
{
Id:5715709195239424
Amount:10000
ExternalId:withdrawal-2022-001
Description:Excess funds withdrawal
TransactionId:6724771005489152
IssuingTransactionId:7834882116598271
Tags:[tony stark]
Created:2022-01-01 00:00:00 +0000 +0000
Updated:2022-01-01 00:00:00 +0000 +0000
}
Clojure
Not yet available. Please contact us if you need this SDK.
Curl
{
"withdrawal": {
"id": "5715709195239424",
"amount": 10000,
"description": "Excess funds withdrawal",
"transactionId": "6724771005489152",
"issuingTransactionId": "7834882116598271",
"externalId": "withdrawal-2022-001",
"tags": ["tony", "stark"],
"created": "2022-01-01T00:00:00.000000+00:00",
"updated": "2022-01-01T00:00:00.000000+00:00"
}
}
Issuing Transaction Overview
An Issuing Transaction is a single entry in the ledger of your Issuing Balance. Every event that moves money in your issuing account — a card purchase, an Issuing Invoice that funds it, an Issuing Withdrawal that takes money out, or a fee — produces exactly one transaction.
Read-only. You never create, update or delete transactions: Stark Infra writes them automatically as funds move. You can only list them and fetch them by id.
Amount sign. The amount is in cents and its sign tells you the direction of the money: a positive amount is a credit (money in — e.g. an invoice that tops up your balance), a negative amount is a debit (money out — e.g. a purchase or a withdrawal).
Running balance. The balance field is your full issuing balance, in cents, right after this transaction was applied. Walking the transactions in order lets you reconcile every cent of your Issuing Balance without recomputing it yourself.
Source. The source links a transaction back to the entity that generated it, in the form resource/id — for example issuingPurchase/6724771005489152. Use it to trace a balance change back to the Issuing Purchase, Issuing Invoice or Issuing Withdrawal that caused it, and as a query filter to pull every transaction tied to one source.
Listing Transactions
List your issuing transactions, most recent first, in pages of at most 100. Narrow the result with "after" / "before" (by creation date), "tags", "ids" or "externalIds".
Filter by "source" to pull every transaction generated by one entity — pass the full resource/id value (e.g. "issuingPurchase/6724771005489152") to follow a single purchase, invoice or withdrawal through the ledger.
Parameters
Python
import starkinfra
transactions = starkinfra.issuingtransaction.query(
after="2022-01-01",
before="2022-12-31"
)
for transaction in transactions:
print(transaction)
Javascript
const starkinfra = require('starkinfra');
(async() => {
let transactions = await starkinfra.issuingTransaction.query({
after: '2022-01-01',
before: '2022-12-31'
});
for await (let transaction of transactions) {
console.log(transaction);
}
})();
PHP
$transactions = StarkInfra\IssuingTransaction::query([
"after" => "2022-01-01",
"before" => "2022-12-31"
]);
foreach ($transactions as $transaction) {
print_r($transaction);
}
Java
import com.starkinfra.*; import java.util.HashMap; HashMapparams = new HashMap<>(); params.put("after", "2022-01-01"); params.put("before", "2022-12-31"); Generator transactions = IssuingTransaction.query(params); for (IssuingTransaction transaction : transactions) { System.out.println(transaction); }
Ruby
require('starkinfra')
transactions = StarkInfra::IssuingTransaction.query(
after: "2022-01-01",
before: "2022-12-31"
)
transactions.each do |transaction|
puts transaction
end
Elixir
transactions = StarkInfra.IssuingTransaction.query!(
after: "2022-01-01",
before: "2022-12-31"
)
transactions |> Enum.each(&IO.inspect/1)
C#
using System; using System.Collections.Generic; IEnumerabletransactions = StarkInfra.IssuingTransaction.Query( after: new DateTime(2022, 1, 1), before: new DateTime(2022, 12, 31) ); foreach (StarkInfra.IssuingTransaction transaction in transactions) { Console.WriteLine(transaction); }
Go
package main
import (
"fmt"
"github.com/starkinfra/sdk-go/starkinfra/issuingtransaction"
)
func main() {
var params = map[string]interface{}{}
params["after"] = "2022-01-01"
params["before"] = "2022-12-31"
transactions, errorChannel := issuingtransaction.Query(params, nil)
for transaction := range transactions {
fmt.Printf("%+v", transaction)
}
for err := range errorChannel {
fmt.Printf("%+v", err)
}
}
Clojure
Not yet available. Please contact us if you need this SDK.
Curl
curl --location --request GET '{{baseUrl}}/v2/issuing-transaction?after=2022-01-01&before=2022-12-31' \
--header 'Access-Id: {{accessId}}' \
--header 'Access-Time: {{accessTime}}' \
--header 'Access-Signature: {{accessSignature}}'
Python
IssuingTransaction(
id=5715709195239424,
amount=-1500,
balance=5000000,
description=Issuing purchase 6724771005489152,
source=issuingPurchase/6724771005489152,
tags=['tony', 'stark'],
created=2022-01-01 00:00:00
)
IssuingTransaction(
id=5189683645874176,
amount=5001500,
balance=5001500,
description=Issuing invoice 5547499534213120,
source=issuingInvoice/5547499534213120,
tags=[],
created=2021-12-31 00:00:00
)
Javascript
IssuingTransaction {
id: '5715709195239424',
amount: -1500,
balance: 5000000,
description: 'Issuing purchase 6724771005489152',
source: 'issuingPurchase/6724771005489152',
tags: ['tony', 'stark'],
created: '2022-01-01T00:00:00.000000+00:00'
}
IssuingTransaction {
id: '5189683645874176',
amount: 5001500,
balance: 5001500,
description: 'Issuing invoice 5547499534213120',
source: 'issuingInvoice/5547499534213120',
tags: [],
created: '2021-12-31T00:00:00.000000+00:00'
}
PHP
StarkInfra\IssuingTransaction Object
(
[id] => 5715709195239424
[amount] => -1500
[balance] => 5000000
[description] => Issuing purchase 6724771005489152
[source] => issuingPurchase/6724771005489152
[tags] => Array ( [0] => tony [1] => stark )
[created] => DateTime Object ( [date] => 2022-01-01 00:00:00.000000 )
)
StarkInfra\IssuingTransaction Object
(
[id] => 5189683645874176
[amount] => 5001500
[balance] => 5001500
[description] => Issuing invoice 5547499534213120
[source] => issuingInvoice/5547499534213120
[tags] => Array ( )
[created] => DateTime Object ( [date] => 2021-12-31 00:00:00.000000 )
)
Java
IssuingTransaction({
"id": "5715709195239424",
"amount": -1500,
"balance": 5000000,
"description": "Issuing purchase 6724771005489152",
"source": "issuingPurchase/6724771005489152",
"tags": ["tony", "stark"],
"created": "2022-01-01T00:00:00.000000+00:00"
})
IssuingTransaction({
"id": "5189683645874176",
"amount": 5001500,
"balance": 5001500,
"description": "Issuing invoice 5547499534213120",
"source": "issuingInvoice/5547499534213120",
"tags": [],
"created": "2021-12-31T00:00:00.000000+00:00"
})
Ruby
issuingtransaction(
id: 5715709195239424,
amount: -1500,
balance: 5000000,
description: Issuing purchase 6724771005489152,
source: issuingPurchase/6724771005489152,
tags: ['tony', 'stark'],
created: 2022-01-01T00:00:00+00:00
)
issuingtransaction(
id: 5189683645874176,
amount: 5001500,
balance: 5001500,
description: Issuing invoice 5547499534213120,
source: issuingInvoice/5547499534213120,
tags: [],
created: 2021-12-31T00:00:00+00:00
)
Elixir
%StarkInfra.IssuingTransaction{
id: "5715709195239424",
amount: -1500,
balance: 5000000,
description: "Issuing purchase 6724771005489152",
source: "issuingPurchase/6724771005489152",
tags: ["tony", "stark"],
created: "2022-01-01T00:00:00.000000+00:00"
}
%StarkInfra.IssuingTransaction{
id: "5189683645874176",
amount: 5001500,
balance: 5001500,
description: "Issuing invoice 5547499534213120",
source: "issuingInvoice/5547499534213120",
tags: [],
created: "2021-12-31T00:00:00.000000+00:00"
}
C#
IssuingTransaction(
Id: 5715709195239424,
Amount: -1500,
Balance: 5000000,
Description: Issuing purchase 6724771005489152,
Source: issuingPurchase/6724771005489152,
Tags: { tony, stark },
Created: 01/01/2022 00:00:00
)
IssuingTransaction(
Id: 5189683645874176,
Amount: 5001500,
Balance: 5001500,
Description: Issuing invoice 5547499534213120,
Source: issuingInvoice/5547499534213120,
Tags: { },
Created: 12/31/2021 00:00:00
)
Go
{
Id:5715709195239424
Amount:-1500
Balance:5000000
Description:Issuing purchase 6724771005489152
Source:issuingPurchase/6724771005489152
Tags:[tony stark]
Created:2022-01-01 00:00:00 +0000 +0000
}
{
Id:5189683645874176
Amount:5001500
Balance:5001500
Description:Issuing invoice 5547499534213120
Source:issuingInvoice/5547499534213120
Tags:[]
Created:2021-12-31 00:00:00 +0000 +0000
}
Clojure
Not yet available. Please contact us if you need this SDK.
Curl
{
"cursor": null,
"transactions": [
{
"id": "5715709195239424",
"amount": -1500,
"balance": 5000000,
"description": "Issuing purchase 6724771005489152",
"source": "issuingPurchase/6724771005489152",
"tags": ["tony", "stark"],
"created": "2022-01-01T00:00:00.000000+00:00"
},
{
"id": "5189683645874176",
"amount": 5001500,
"balance": 5001500,
"description": "Issuing invoice 5547499534213120",
"source": "issuingInvoice/5547499534213120",
"tags": [],
"created": "2021-12-31T00:00:00.000000+00:00"
}
]
}
Getting a Transaction
Fetch a single transaction by its id to inspect one ledger entry — its amount, the resulting balance and the source that generated it.
Parameters
Python
import starkinfra
transaction = starkinfra.issuingtransaction.get("5715709195239424")
print(transaction)
Javascript
const starkinfra = require('starkinfra');
(async() => {
let transaction = await starkinfra.issuingTransaction.get('5715709195239424');
console.log(transaction);
})();
PHP
$transaction = StarkInfra\IssuingTransaction::get("5715709195239424");
print_r($transaction);
Java
import com.starkinfra.*;
IssuingTransaction transaction = IssuingTransaction.get("5715709195239424");
System.out.println(transaction);
Ruby
require('starkinfra')
transaction = StarkInfra::IssuingTransaction.get("5715709195239424")
puts transaction
Elixir
transaction = StarkInfra.IssuingTransaction.get!("5715709195239424")
IO.inspect(transaction)
C#
using System;
StarkInfra.IssuingTransaction transaction = StarkInfra.IssuingTransaction.Get("5715709195239424");
Console.WriteLine(transaction);
Go
package main
import (
"fmt"
"github.com/starkinfra/sdk-go/starkinfra/issuingtransaction"
)
func main() {
transaction, err := issuingtransaction.Get("5715709195239424", nil)
if err.Errors != nil {
for _, e := range err.Errors {
fmt.Printf("code: %s, message: %s", e.Code, e.Message)
}
}
fmt.Printf("%+v", transaction)
}
Clojure
Not yet available. Please contact us if you need this SDK.
Curl
curl --location --request GET '{{baseUrl}}/v2/issuing-transaction/5715709195239424' \
--header 'Access-Id: {{accessId}}' \
--header 'Access-Time: {{accessTime}}' \
--header 'Access-Signature: {{accessSignature}}'
Python
IssuingTransaction(
id=5715709195239424,
amount=-1500,
balance=5000000,
description=Issuing purchase 6724771005489152,
source=issuingPurchase/6724771005489152,
tags=['tony', 'stark'],
created=2022-01-01 00:00:00
)
Javascript
IssuingTransaction {
id: '5715709195239424',
amount: -1500,
balance: 5000000,
description: 'Issuing purchase 6724771005489152',
source: 'issuingPurchase/6724771005489152',
tags: ['tony', 'stark'],
created: '2022-01-01T00:00:00.000000+00:00'
}
PHP
StarkInfra\IssuingTransaction Object
(
[id] => 5715709195239424
[amount] => -1500
[balance] => 5000000
[description] => Issuing purchase 6724771005489152
[source] => issuingPurchase/6724771005489152
[tags] => Array ( [0] => tony [1] => stark )
[created] => DateTime Object ( [date] => 2022-01-01 00:00:00.000000 )
)
Java
IssuingTransaction({
"id": "5715709195239424",
"amount": -1500,
"balance": 5000000,
"description": "Issuing purchase 6724771005489152",
"source": "issuingPurchase/6724771005489152",
"tags": ["tony", "stark"],
"created": "2022-01-01T00:00:00.000000+00:00"
})
Ruby
issuingtransaction(
id: 5715709195239424,
amount: -1500,
balance: 5000000,
description: Issuing purchase 6724771005489152,
source: issuingPurchase/6724771005489152,
tags: ['tony', 'stark'],
created: 2022-01-01T00:00:00+00:00
)
Elixir
%StarkInfra.IssuingTransaction{
id: "5715709195239424",
amount: -1500,
balance: 5000000,
description: "Issuing purchase 6724771005489152",
source: "issuingPurchase/6724771005489152",
tags: ["tony", "stark"],
created: "2022-01-01T00:00:00.000000+00:00"
}
C#
IssuingTransaction(
Id: 5715709195239424,
Amount: -1500,
Balance: 5000000,
Description: Issuing purchase 6724771005489152,
Source: issuingPurchase/6724771005489152,
Tags: { tony, stark },
Created: 01/01/2022 00:00:00
)
Go
{
Id:5715709195239424
Amount:-1500
Balance:5000000
Description:Issuing purchase 6724771005489152
Source:issuingPurchase/6724771005489152
Tags:[tony stark]
Created:2022-01-01 00:00:00 +0000 +0000
}
Clojure
Not yet available. Please contact us if you need this SDK.
Curl
{
"transaction": {
"id": "5715709195239424",
"amount": -1500,
"balance": 5000000,
"description": "Issuing purchase 6724771005489152",
"source": "issuingPurchase/6724771005489152",
"tags": ["tony", "stark"],
"created": "2022-01-01T00:00:00.000000+00:00"
}
}
Issuing Product Overview
An Issuing Product is the card product — the BIN range — that every Issuing Card references through its productId. It defines the network, funding type, holder type and code shared by every card created under it.
Read-only. Products are not created through the API: they are defined together with your account manager when you set up card issuing. The API exposes a single endpoint to list the products available to your workspace so you can pick a productId to issue cards with.
Getting a productId. List your products with the endpoint below and copy the id of the one you want. If you don't have any product yet, request one at help@starkinfra.com.
Field meanings. network is the card network ("Visa" or "Mastercard"). fundingType is how the card settles — "prepaid" (balance is debited from your Issuing Balance up front) or "credit". holderType tells whether the product issues cards to a "business" or to an "individual". code is the product code that identifies the specific card product.
NOTE: settlement, client and customerType are legacy aliases kept for backward compatibility — settlement mirrors fundingType, while client and customerType both mirror holderType. Prefer the canonical fields in new integrations.
Listing your Products
List the card products available to your workspace and copy the id of the one you want to issue cards with. Each entry exposes the product's network, fundingType, holderType and code.
This is the only Issuing Product endpoint — products are read-only and cannot be created, updated or deleted through the API.
Parameters
Python
import starkinfra
products = starkinfra.issuingproduct.query()
for product in products:
print(product)
Javascript
const starkinfra = require('starkinfra');
(async() => {
let products = await starkinfra.issuingProduct.query({});
for await (let product of products) {
console.log(product);
}
})();
PHP
$products = StarkInfra\IssuingProduct::query();
foreach ($products as $product) {
print_r($product);
}
Java
import com.starkinfra.*; import java.util.HashMap; HashMapparams = new HashMap<>(); Generator products = IssuingProduct.query(params); for (IssuingProduct product : products) { System.out.println(product); }
Ruby
require('starkinfra')
products = StarkInfra::IssuingProduct.query()
products.each do |product|
puts product
end
Elixir
products = StarkInfra.IssuingProduct.query!() products |> Enum.each(&IO.inspect/1)
C#
using System; using System.Collections.Generic; IEnumerableproducts = StarkInfra.IssuingProduct.Query(); foreach (StarkInfra.IssuingProduct product in products) { Console.WriteLine(product); }
Go
package main
import (
"fmt"
"github.com/starkinfra/sdk-go/starkinfra/issuingproduct"
)
func main() {
products := issuingproduct.Query(nil, nil)
for product := range products {
fmt.Printf("%+v", product)
}
}
Clojure
Not yet available. Please contact us if you need this SDK.
Curl
curl --location --request GET '{{baseUrl}}/v2/issuing-product' \
--header 'Access-Id: {{accessId}}' \
--header 'Access-Time: {{accessTime}}' \
--header 'Access-Signature: {{accessSignature}}'
Python
IssuingProduct(
id=5715709195239424,
network=Mastercard,
funding_type=credit,
holder_type=individual,
code=ABC,
created=2022-01-01 00:00:00
)
Javascript
IssuingProduct {
id: '5715709195239424',
network: 'Mastercard',
fundingType: 'credit',
holderType: 'individual',
code: 'ABC',
created: '2022-01-01T00:00:00.000000+00:00'
}
PHP
StarkInfra\IssuingProduct Object
(
[id] => 5715709195239424
[network] => Mastercard
[fundingType] => credit
[holderType] => individual
[code] => ABC
[created] => DateTime Object
(
[date] => 2022-01-01 00:00:00.000000
[timezone_type] => 1
[timezone] => +00:00
)
)
Java
IssuingProduct({
"id": "5715709195239424",
"network": "Mastercard",
"fundingType": "credit",
"holderType": "individual",
"code": "ABC",
"created": "2022-01-01T00:00:00.000000+00:00"
})
Ruby
issuingproduct(
id: 5715709195239424,
network: Mastercard,
funding_type: credit,
holder_type: individual,
code: ABC,
created: 2022-01-01T00:00:00+00:00
)
Elixir
%StarkInfra.IssuingProduct{
id: "5715709195239424",
network: "Mastercard",
funding_type: "credit",
holder_type: "individual",
code: "ABC",
created: "2022-01-01T00:00:00.000000+00:00"
}
C#
IssuingProduct(
Id: 5715709195239424,
Network: Mastercard,
FundingType: credit,
HolderType: individual,
Code: ABC,
Created: 01/01/2022 00:00:00
)
Go
{
Id:5715709195239424
Network:Mastercard
FundingType:credit
HolderType:individual
Code:ABC
Created:2022-01-01 00:00:00 +0000 +0000
}
Clojure
Not yet available. Please contact us if you need this SDK.
Curl
{
"cursor": null,
"products": [
{
"id": "5715709195239424",
"network": "Mastercard",
"fundingType": "credit",
"holderType": "individual",
"code": "ABC",
"settlement": "credit",
"client": "individual",
"customerType": "individual",
"created": "2022-01-01T00:00:00.000000+00:00"
}
]
}
Issuing Design Overview
An Issuing Design is the artwork template applied when a physical card is embossed and printed. It defines the visual layout — the artwork, fonts and positioning — that the embosser prints onto the card.
Designs are read-only: you don't create them through the API. They are registered for your sub-issuer ahead of time (together with the embossers that can print them), and you reference one by its id when you order a physical card through an Issuing Embossing Kit.
Registering a design requires network approval. A design is not something you configure on your own: each one must be approved by the card network (Visa/Mastercard) through the embosser that will print it before it can be registered for your sub-issuer. To set up a new design or change an existing one, contact help@starkinfra.com and our team will walk you through the network approval and embosser configuration.
Picking a design for a kit. Each design lists the embosserIds that are able to print it. When you assemble an Issuing Embossing Kit, the card design and the envelope design you choose must both be printable by the same embosser — so check the embosserIds overlap before referencing them.
Previewing the artwork. Beyond the design metadata, you can download a PDF proof of the layout to preview exactly how a card or envelope will look once printed. See Getting a Design's PDF below.
Design Types
A design's "type" is one of exactly two values, telling you which part of the physical mailing it applies to:
| Type | Description |
|---|---|
| card | Artwork printed on the plastic card itself. |
| envelope | Artwork for any printed material that is not the plastic card — the mailing envelope, a flyer, a leaflet or any other paper that ships alongside the card. Anything other than the card is typed as "envelope". |
Listing Designs
List the designs available to your sub-issuer. Use this to discover which design ids you can reference when ordering physical cards, and to read each design's type and the embosserIds that can print it.
Filter by "ids" to fetch specific designs, and page through results with "limit" (max 100) and "cursor" — our SDKs handle the cursor for you.
Parameters
Python
import starkinfra
designs = starkinfra.issuingdesign.query(limit=10)
for design in designs:
print(design)
Javascript
const starkinfra = require('starkinfra');
(async() => {
let designs = await starkinfra.issuingDesign.query({ limit: 10 });
for await (let design of designs) {
console.log(design);
}
})();
PHP
$designs = StarkInfra\IssuingDesign::query(["limit" => 10]);
foreach ($designs as $design) {
print_r($design);
}
Java
import com.starkinfra.*; import java.util.HashMap; HashMapparams = new HashMap<>(); params.put("limit", 10); Generator designs = IssuingDesign.query(params); for (IssuingDesign design : designs) { System.out.println(design); }
Ruby
require('starkinfra')
designs = StarkInfra::IssuingDesign.query(limit: 10)
designs.each do |design|
puts design
end
Elixir
designs = StarkInfra.IssuingDesign.query!(limit: 10) designs |> Enum.each(&IO.inspect/1)
C#
using System; using System.Collections.Generic; IEnumerabledesigns = StarkInfra.IssuingDesign.Query(limit: 10); foreach (StarkInfra.IssuingDesign design in designs) { Console.WriteLine(design); }
Go
package main
import (
"fmt"
"github.com/starkinfra/sdk-go/starkinfra/issuingdesign"
)
func main() {
designs := issuingdesign.Query(
&issuingdesign.Query{Limit: 10},
nil,
)
for design := range designs {
fmt.Printf("%+v", design)
}
}
Clojure
Not yet available. Please contact us if you need this SDK.
Curl
curl --location --request GET '{{baseUrl}}/v2/issuing-design?limit=10' \
--header 'Access-Id: {{accessId}}' \
--header 'Access-Time: {{accessTime}}' \
--header 'Access-Signature: {{accessSignature}}'
Python
IssuingDesign(
id=5715709195239424,
name=Standard Blue,
embosser_ids=['6724771005489152'],
type=card,
created=2022-01-01 00:00:00,
updated=2022-01-01 00:00:00
)
Javascript
IssuingDesign {
id: '5715709195239424',
name: 'Standard Blue',
embosserIds: [ '6724771005489152' ],
type: 'card',
created: '2022-01-01T00:00:00.000000+00:00',
updated: '2022-01-01T00:00:00.000000+00:00'
}
PHP
StarkInfra\IssuingDesign Object
(
[id] => 5715709195239424
[name] => Standard Blue
[type] => card
[embosserIds] => Array ( [0] => 6724771005489152 )
[created] => DateTime Object ( [date] => 2022-01-01 00:00:00.000000 )
[updated] => DateTime Object ( [date] => 2022-01-01 00:00:00.000000 )
)
Java
IssuingDesign({
"id": "5715709195239424",
"name": "Standard Blue",
"type": "card",
"embosserIds": ["6724771005489152"],
"created": "2022-01-01T00:00:00.000000+00:00",
"updated": "2022-01-01T00:00:00.000000+00:00"
})
Ruby
issuingdesign(
id: 5715709195239424,
name: Standard Blue,
embosser_ids: ["6724771005489152"],
type: card,
created: 2022-01-01T00:00:00+00:00,
updated: 2022-01-01T00:00:00+00:00
)
Elixir
%StarkInfra.IssuingDesign{
id: "5715709195239424",
name: "Standard Blue",
type: "card",
embosser_ids: ["6724771005489152"],
created: "2022-01-01T00:00:00.000000+00:00",
updated: "2022-01-01T00:00:00.000000+00:00"
}
C#
IssuingDesign(
Id: 5715709195239424,
Name: Standard Blue,
Type: card,
EmbosserIds: [6724771005489152],
Created: 01/01/2022 00:00:00,
Updated: 01/01/2022 00:00:00
)
Go
{
Id:5715709195239424
Name:Standard Blue
EmbosserIds:[6724771005489152]
Type:card
Updated:2022-01-01 00:00:00 +0000 +0000
Created:2022-01-01 00:00:00 +0000 +0000
}
Clojure
Not yet available. Please contact us if you need this SDK.
Curl
{
"cursor": null,
"designs": [
{
"id": "5715709195239424",
"name": "Standard Blue",
"type": "card",
"embosserIds": ["6724771005489152"],
"created": "2022-01-01T00:00:00.000000+00:00",
"updated": "2022-01-01T00:00:00.000000+00:00"
}
]
}
Getting a Design
Fetch a single design by its id to read its name, type and the embosserIds that support it.
Parameters
Python
import starkinfra
design = starkinfra.issuingdesign.get("5715709195239424")
print(design)
Javascript
const starkinfra = require('starkinfra');
(async() => {
let design = await starkinfra.issuingDesign.get('5715709195239424');
console.log(design);
})();
PHP
$design = StarkInfra\IssuingDesign::get("5715709195239424");
print_r($design);
Java
import com.starkinfra.*;
IssuingDesign design = IssuingDesign.get("5715709195239424");
System.out.println(design);
Ruby
require('starkinfra')
design = StarkInfra::IssuingDesign.get("5715709195239424")
puts design
Elixir
design = StarkInfra.IssuingDesign.get!("5715709195239424")
IO.inspect(design)
C#
using System;
StarkInfra.IssuingDesign design = StarkInfra.IssuingDesign.Get("5715709195239424");
Console.WriteLine(design);
Go
package main
import (
"fmt"
"github.com/starkinfra/sdk-go/starkinfra/issuingdesign"
)
func main() {
design, err := issuingdesign.Get("5715709195239424", nil)
if err.Errors != nil {
for _, e := range err.Errors {
fmt.Printf("code: %s, message: %s", e.Code, e.Message)
}
}
fmt.Printf("%+v", design)
}
Clojure
Not yet available. Please contact us if you need this SDK.
Curl
curl --location --request GET '{{baseUrl}}/v2/issuing-design/5715709195239424' \
--header 'Access-Id: {{accessId}}' \
--header 'Access-Time: {{accessTime}}' \
--header 'Access-Signature: {{accessSignature}}'
Python
IssuingDesign(
id=5715709195239424,
name=Standard Blue,
embosser_ids=['6724771005489152'],
type=card,
created=2022-01-01 00:00:00,
updated=2022-01-01 00:00:00
)
Javascript
IssuingDesign {
id: '5715709195239424',
name: 'Standard Blue',
embosserIds: [ '6724771005489152' ],
type: 'card',
created: '2022-01-01T00:00:00.000000+00:00',
updated: '2022-01-01T00:00:00.000000+00:00'
}
PHP
StarkInfra\IssuingDesign Object
(
[id] => 5715709195239424
[name] => Standard Blue
[type] => card
[embosserIds] => Array ( [0] => 6724771005489152 )
[created] => DateTime Object ( [date] => 2022-01-01 00:00:00.000000 )
[updated] => DateTime Object ( [date] => 2022-01-01 00:00:00.000000 )
)
Java
IssuingDesign({
"id": "5715709195239424",
"name": "Standard Blue",
"type": "card",
"embosserIds": ["6724771005489152"],
"created": "2022-01-01T00:00:00.000000+00:00",
"updated": "2022-01-01T00:00:00.000000+00:00"
})
Ruby
issuingdesign(
id: 5715709195239424,
name: Standard Blue,
embosser_ids: ["6724771005489152"],
type: card,
created: 2022-01-01T00:00:00+00:00,
updated: 2022-01-01T00:00:00+00:00
)
Elixir
%StarkInfra.IssuingDesign{
id: "5715709195239424",
name: "Standard Blue",
type: "card",
embosser_ids: ["6724771005489152"],
created: "2022-01-01T00:00:00.000000+00:00",
updated: "2022-01-01T00:00:00.000000+00:00"
}
C#
IssuingDesign(
Id: 5715709195239424,
Name: Standard Blue,
Type: card,
EmbosserIds: [6724771005489152],
Created: 01/01/2022 00:00:00,
Updated: 01/01/2022 00:00:00
)
Go
{
Id:5715709195239424
Name:Standard Blue
EmbosserIds:[6724771005489152]
Type:card
Updated:2022-01-01 00:00:00 +0000 +0000
Created:2022-01-01 00:00:00 +0000 +0000
}
Clojure
Not yet available. Please contact us if you need this SDK.
Curl
{
"design": {
"id": "5715709195239424",
"name": "Standard Blue",
"type": "card",
"embosserIds": ["6724771005489152"],
"created": "2022-01-01T00:00:00.000000+00:00",
"updated": "2022-01-01T00:00:00.000000+00:00"
}
}
Getting a Design's PDF
Download a PDF proof of the design's artwork to preview how the card or envelope will look once printed.
Unlike the other endpoints, this one returns the raw PDF bytes — there is no JSON body. With curl, write the response straight to a file with --output design.pdf; our SDKs return the binary content for you to save.
Parameters
Python
import starkinfra
pdf = starkinfra.issuingdesign.pdf("5715709195239424")
with open("design.pdf", "wb") as f:
f.write(pdf)
Javascript
const starkinfra = require('starkinfra');
const fs = require('fs');
(async() => {
let pdf = await starkinfra.issuingDesign.pdf('5715709195239424');
fs.writeFileSync('design.pdf', pdf);
})();
PHP
$pdf = StarkInfra\IssuingDesign::pdf("5715709195239424");
file_put_contents("design.pdf", $pdf);
Java
import com.starkinfra.*;
import java.io.FileOutputStream;
byte[] pdf = IssuingDesign.pdf("5715709195239424");
FileOutputStream fos = new FileOutputStream("design.pdf");
fos.write(pdf);
fos.close();
Ruby
require('starkinfra')
pdf = StarkInfra::IssuingDesign.pdf("5715709195239424")
File.binwrite("design.pdf", pdf)
Elixir
pdf = StarkInfra.IssuingDesign.pdf!("5715709195239424")
File.write!("design.pdf", pdf)
C#
using System.IO;
byte[] pdf = StarkInfra.IssuingDesign.Pdf("5715709195239424");
File.WriteAllBytes("design.pdf", pdf);
Go
package main
import (
"os"
"github.com/starkinfra/sdk-go/starkinfra/issuingdesign"
)
func main() {
pdf, err := issuingdesign.Pdf("5715709195239424", nil)
if err.Errors != nil {
panic(err)
}
os.WriteFile("design.pdf", pdf, 0644)
}
Clojure
Not yet available. Please contact us if you need this SDK.
Curl
curl --location --request GET '{{baseUrl}}/v2/issuing-design/5715709195239424/pdf' \
--header 'Access-Id: {{accessId}}' \
--header 'Access-Time: {{accessTime}}' \
--header 'Access-Signature: {{accessSignature}}' \
--output design.pdf
Python
b'%PDF-1.4 ...' # Binary PDF content
Javascript
// Binary PDF content
PHP
// Binary PDF content written to design.pdf
Java
// Binary PDF content written to design.pdf
Ruby
# Binary PDF content written to design.pdf
Elixir
# Binary PDF content written to design.pdf
C#
// Binary PDF content written to design.pdf
Go
// Binary PDF content written to design.pdf
Clojure
Not yet available. Please contact us if you need this SDK.
Curl
// Binary PDF content saved to design.pdf
Issuing Embossing Kit Overview
An Issuing Embossing Kit bundles the physical materials used to personalize a card — the plastic and packaging — together with the Issuing Designs available for embossing.
Where it fits. When you order an Issuing Embossing Request for a physical card, you reference a kitId. The kit determines which designs you can pick and how the card is physically produced and shipped, so you list the available kits first and reuse their ids in your embossing requests.
Read-only. Kits are provisioned for your sub-issuer by Stark Infra — you cannot create, change or delete them. The only operations are listing the kits available to you and fetching one by its id.
The designs field. Each kit returns a "designs" list referencing the Issuing Designs it supports. These come back as id-only objects (e.g. {"id": "6284441486065664"}) — resolve a design's full details through the Issuing Design section using that id.
Listing your Embossing Kits
List the embossing kits available to your sub-issuer. Use the returned ids when ordering an Issuing Embossing Request.
Filter by "designIds" to keep only the kits that support a given Issuing Design (up to 30 ids), by "ids" to fetch specific kits, or by "after" / "before" to bound the results by creation date.
Parameters
Python
import starkinfra
kits = starkinfra.issuingembossingkit.query(limit=10)
for kit in kits:
print(kit)
Javascript
const starkinfra = require('starkinfra');
(async() => {
let kits = await starkinfra.issuingEmbossingKit.query({ limit: 10 });
for await (let kit of kits) {
console.log(kit);
}
})();
PHP
$kits = StarkInfra\IssuingEmbossingKit::query(["limit" => 10]);
foreach ($kits as $kit) {
print_r($kit);
}
Java
import com.starkinfra.*; import java.util.HashMap; HashMapparams = new HashMap<>(); params.put("limit", 10); Generator kits = IssuingEmbossingKit.query(params); for (IssuingEmbossingKit kit : kits) { System.out.println(kit); }
Ruby
require('starkinfra')
kits = StarkInfra::IssuingEmbossingKit.query(limit: 10)
kits.each do |kit|
puts kit
end
Elixir
kits = StarkInfra.IssuingEmbossingKit.query!(limit: 10) kits |> Enum.each(&IO.inspect/1)
C#
using System; using System.Collections.Generic; IEnumerablekits = StarkInfra.IssuingEmbossingKit.Query(limit: 10); foreach (StarkInfra.IssuingEmbossingKit kit in kits) { Console.WriteLine(kit); }
Go
package main
import (
"fmt"
"github.com/starkinfra/sdk-go/starkinfra/issuingembossingkit"
)
func main() {
var params = map[string]interface{}{}
params["limit"] = 10
kits, errorChannel := issuingembossingkit.Query(params, nil)
for kit := range kits {
fmt.Printf("%+v", kit)
}
for err := range errorChannel {
fmt.Printf("%+v", err)
}
}
Clojure
Not yet available. Please contact us if you need this SDK.
Curl
curl --location --request GET '{{baseUrl}}/v2/issuing-embossing-kit?limit=10' \
--header 'Access-Id: {{accessId}}' \
--header 'Access-Time: {{accessTime}}' \
--header 'Access-Signature: {{accessSignature}}'
Python
IssuingEmbossingKit(
id=5715709195239424,
name=Standard Kit,
designs=[
IssuingDesign(
id=6284441486065664,
name=None,
embosser_ids=None,
type=None,
created=None,
updated=None
),
IssuingDesign(
id=6284441486065665,
name=None,
embosser_ids=None,
type=None,
created=None,
updated=None
)
],
created=2022-01-01 00:00:00,
updated=2022-01-01 00:00:00
)
Javascript
IssuingEmbossingKit {
id: '5715709195239424',
name: 'Standard Kit',
designs: [
IssuingDesign {
id: '6284441486065664',
name: null,
embosserIds: null,
type: null,
created: null,
updated: null
},
IssuingDesign {
id: '6284441486065665',
name: null,
embosserIds: null,
type: null,
created: null,
updated: null
}
],
created: '2022-01-01T00:00:00.000000+00:00',
updated: '2022-01-01T00:00:00.000000+00:00'
}
PHP
StarkInfra\IssuingEmbossingKit Object
(
[id] => 5715709195239424
[name] => Standard Kit
[designs] => Array
(
[0] => StarkInfra\IssuingDesign Object
(
[id] => 6284441486065664
[name] =>
[type] =>
[embosserIds] =>
[created] =>
[updated] =>
)
[1] => StarkInfra\IssuingDesign Object
(
[id] => 6284441486065665
[name] =>
[type] =>
[embosserIds] =>
[created] =>
[updated] =>
)
)
[created] => DateTime Object ( [date] => 2022-01-01 00:00:00.000000 )
[updated] => DateTime Object ( [date] => 2022-01-01 00:00:00.000000 )
)
Java
IssuingEmbossingKit({
"id": "5715709195239424",
"name": "Standard Kit",
"designs": [
{"id": "6284441486065664"},
{"id": "6284441486065665"}
],
"created": "2022-01-01T00:00:00.000000+00:00",
"updated": "2022-01-01T00:00:00.000000+00:00"
})
Ruby
issuingembossingkit(
id: 5715709195239424,
name: Standard Kit,
designs: [
issuingdesign(
id: 6284441486065664,
name: nil,
embosser_ids: nil,
type: nil,
created: nil,
updated: nil
),
issuingdesign(
id: 6284441486065665,
name: nil,
embosser_ids: nil,
type: nil,
created: nil,
updated: nil
)
],
created: 2022-01-01T00:00:00+00:00,
updated: 2022-01-01T00:00:00+00:00
)
Elixir
%StarkInfra.IssuingEmbossingKit{
id: "5715709195239424",
name: "Standard Kit",
designs: [
%StarkInfra.IssuingDesign{id: "6284441486065664"},
%StarkInfra.IssuingDesign{id: "6284441486065665"}
],
created: "2022-01-01T00:00:00.000000+00:00",
updated: "2022-01-01T00:00:00.000000+00:00"
}
C#
IssuingEmbossingKit(
Id: 5715709195239424,
Name: Standard Kit,
Designs: [
IssuingDesign(
Id: 6284441486065664,
Name: ,
EmbosserIds: ,
Created: ,
Updated:
),
IssuingDesign(
Id: 6284441486065665,
Name: ,
EmbosserIds: ,
Created: ,
Updated:
)
],
Created: 01/01/2022 00:00:00,
Updated: 01/01/2022 00:00:00
)
Go
{
Id:5715709195239424
Name:Standard Kit
Designs:[{Id:6284441486065664} {Id:6284441486065665}]
Updated:2022-01-01 00:00:00 +0000 +0000
Created:2022-01-01 00:00:00 +0000 +0000
}
Clojure
Not yet available. Please contact us if you need this SDK.
Curl
{
"cursor": null,
"kits": [
{
"id": "5715709195239424",
"name": "Standard Kit",
"designs": [
{"id": "6284441486065664"},
{"id": "6284441486065665"}
],
"created": "2022-01-01T00:00:00.000000+00:00",
"updated": "2022-01-01T00:00:00.000000+00:00"
}
]
}
Getting an Embossing Kit
Fetch a single embossing kit by its id to inspect its name and the Issuing Designs it supports.
Parameters
Python
import starkinfra
kit = starkinfra.issuingembossingkit.get("5715709195239424")
print(kit)
Javascript
const starkinfra = require('starkinfra');
(async() => {
let kit = await starkinfra.issuingEmbossingKit.get('5715709195239424');
console.log(kit);
})();
PHP
$kit = StarkInfra\IssuingEmbossingKit::get("5715709195239424");
print_r($kit);
Java
import com.starkinfra.*;
IssuingEmbossingKit kit = IssuingEmbossingKit.get("5715709195239424");
System.out.println(kit);
Ruby
require('starkinfra')
kit = StarkInfra::IssuingEmbossingKit.get("5715709195239424")
puts kit
Elixir
kit = StarkInfra.IssuingEmbossingKit.get!("5715709195239424")
IO.inspect(kit)
C#
using System;
StarkInfra.IssuingEmbossingKit kit = StarkInfra.IssuingEmbossingKit.Get("5715709195239424");
Console.WriteLine(kit);
Go
package main
import (
"fmt"
"github.com/starkinfra/sdk-go/starkinfra/issuingembossingkit"
)
func main() {
kit, err := issuingembossingkit.Get("5715709195239424", nil)
if err.Errors != nil {
for _, e := range err.Errors {
fmt.Printf("code: %s, message: %s", e.Code, e.Message)
}
}
fmt.Printf("%+v", kit)
}
Clojure
Not yet available. Please contact us if you need this SDK.
Curl
curl --location --request GET '{{baseUrl}}/v2/issuing-embossing-kit/5715709195239424' \
--header 'Access-Id: {{accessId}}' \
--header 'Access-Time: {{accessTime}}' \
--header 'Access-Signature: {{accessSignature}}'
Python
IssuingEmbossingKit(
id=5715709195239424,
name=Standard Kit,
designs=[
IssuingDesign(
id=6284441486065664,
name=None,
embosser_ids=None,
type=None,
created=None,
updated=None
),
IssuingDesign(
id=6284441486065665,
name=None,
embosser_ids=None,
type=None,
created=None,
updated=None
)
],
created=2022-01-01 00:00:00,
updated=2022-01-01 00:00:00
)
Javascript
IssuingEmbossingKit {
id: '5715709195239424',
name: 'Standard Kit',
designs: [
IssuingDesign {
id: '6284441486065664',
name: null,
embosserIds: null,
type: null,
created: null,
updated: null
},
IssuingDesign {
id: '6284441486065665',
name: null,
embosserIds: null,
type: null,
created: null,
updated: null
}
],
created: '2022-01-01T00:00:00.000000+00:00',
updated: '2022-01-01T00:00:00.000000+00:00'
}
PHP
StarkInfra\IssuingEmbossingKit Object
(
[id] => 5715709195239424
[name] => Standard Kit
[designs] => Array
(
[0] => StarkInfra\IssuingDesign Object
(
[id] => 6284441486065664
[name] =>
[type] =>
[embosserIds] =>
[created] =>
[updated] =>
)
[1] => StarkInfra\IssuingDesign Object
(
[id] => 6284441486065665
[name] =>
[type] =>
[embosserIds] =>
[created] =>
[updated] =>
)
)
[created] => DateTime Object ( [date] => 2022-01-01 00:00:00.000000 )
[updated] => DateTime Object ( [date] => 2022-01-01 00:00:00.000000 )
)
Java
IssuingEmbossingKit({
"id": "5715709195239424",
"name": "Standard Kit",
"designs": [
{"id": "6284441486065664"},
{"id": "6284441486065665"}
],
"created": "2022-01-01T00:00:00.000000+00:00",
"updated": "2022-01-01T00:00:00.000000+00:00"
})
Ruby
issuingembossingkit(
id: 5715709195239424,
name: Standard Kit,
designs: [
issuingdesign(
id: 6284441486065664,
name: nil,
embosser_ids: nil,
type: nil,
created: nil,
updated: nil
),
issuingdesign(
id: 6284441486065665,
name: nil,
embosser_ids: nil,
type: nil,
created: nil,
updated: nil
)
],
created: 2022-01-01T00:00:00+00:00,
updated: 2022-01-01T00:00:00+00:00
)
Elixir
%StarkInfra.IssuingEmbossingKit{
id: "5715709195239424",
name: "Standard Kit",
designs: [
%StarkInfra.IssuingDesign{id: "6284441486065664"},
%StarkInfra.IssuingDesign{id: "6284441486065665"}
],
created: "2022-01-01T00:00:00.000000+00:00",
updated: "2022-01-01T00:00:00.000000+00:00"
}
C#
IssuingEmbossingKit(
Id: 5715709195239424,
Name: Standard Kit,
Designs: [
IssuingDesign(
Id: 6284441486065664,
Name: ,
EmbosserIds: ,
Created: ,
Updated:
),
IssuingDesign(
Id: 6284441486065665,
Name: ,
EmbosserIds: ,
Created: ,
Updated:
)
],
Created: 01/01/2022 00:00:00,
Updated: 01/01/2022 00:00:00
)
Go
{
Id:5715709195239424
Name:Standard Kit
Designs:[{Id:6284441486065664} {Id:6284441486065665}]
Updated:2022-01-01 00:00:00 +0000 +0000
Created:2022-01-01 00:00:00 +0000 +0000
}
Clojure
Not yet available. Please contact us if you need this SDK.
Curl
{
"kit": {
"id": "5715709195239424",
"name": "Standard Kit",
"designs": [
{"id": "6284441486065664"},
{"id": "6284441486065665"}
],
"created": "2022-01-01T00:00:00.000000+00:00",
"updated": "2022-01-01T00:00:00.000000+00:00"
}
}
Issuing Stock Overview
An Issuing Stock tracks the raw blank cards available for embossing. Each stock entry pairs one card design (Issuing Design) with the embosser that physically holds those blanks, and its balance tells you how many blanks are still available to be embossed.
Read-only. You never create or edit a stock directly — Stark Infra opens one for each design/embosser pair you have. You can only Query it, Get it by id, and read its Logs.
Raising the balance. To add more blanks, register an Issuing Restock: each restock increases the matching stock's balance by the ordered amount once the blanks arrive at the embosser.
Low-balance alerts. Embossing a Issuing Embossing Request consumes blanks and lowers the balance. Set an Issuing Stock Rule to be warned (via webhook) before a stock runs out, so you can restock in time.
Stock Balance
The balance is the count of card blanks currently available for embossing. It is computed on demand, so it is not returned by default — inform expand=balance on Query or Get to include it.
Without expand=balance a stock returns only its identifiers (id, designId, embosserId, embosserName) and timestamps.
Stock Logs
Every time a stock's balance shifts, Stark Infra creates a Log entry. Logs let you audit how a stock reached its current balance — each restock that came in and each batch of blanks that was embossed or written off.
Each log carries a top-level count (the signed shift in balance for that event) and a nested stock object (a representation of the stock the log refers to). The log type is one of:
| Type | Description |
|---|---|
| created | The stock was opened for a design/embosser pair, seeding its initial balance. |
| restocked | An Issuing Restock arrived at the embosser and raised the balance. |
| spent | Blanks were consumed to emboss cards, lowering the balance. |
| lost | Blanks were written off (damaged or otherwise unusable), lowering the balance. |
Query the stock logs with GET /v2/issuing-stock/log (filter by stockIds, types, after / before), or fetch a single one with GET /v2/issuing-stock/log/:id.
Querying Stocks
List your stocks, newest first, in pages of up to 100. Filter by "designIds", "embosserIds", "ids" or by creation date with "after" / "before".
Inform "expand=balance" to include each stock's current blank count — it is omitted otherwise (see the Stock Balance note above).
Parameters
Python
import starkinfra
stocks = starkinfra.issuingstock.query(limit=10)
for stock in stocks:
print(stock)
Javascript
const starkinfra = require('starkinfra');
(async() => {
let stocks = await starkinfra.issuingStock.query({ limit: 10 });
for await (let stock of stocks) {
console.log(stock);
}
})();
PHP
$stocks = StarkInfra\IssuingStock::query(["limit" => 10]);
foreach ($stocks as $stock) {
print_r($stock);
}
Java
import com.starkinfra.*; import java.util.HashMap; HashMapparams = new HashMap<>(); params.put("limit", 10); Generator stocks = IssuingStock.query(params); for (IssuingStock stock : stocks) { System.out.println(stock); }
Ruby
require('starkinfra')
stocks = StarkInfra::IssuingStock.query(limit: 10)
stocks.each do |stock|
puts stock
end
Elixir
stocks = StarkInfra.IssuingStock.query!(limit: 10) stocks |> Enum.each(&IO.inspect/1)
C#
using System; using System.Collections.Generic; IEnumerablestocks = StarkInfra.IssuingStock.Query(limit: 10); foreach (StarkInfra.IssuingStock stock in stocks) { Console.WriteLine(stock); }
Go
package main
import (
"fmt"
"github.com/starkinfra/sdk-go/starkinfra/issuingstock"
)
func main() {
var params = map[string]interface{}{}
params["limit"] = 10
stocks, errorChannel := issuingstock.Query(params, nil)
loop:
for {
select {
case err := <-errorChannel:
if err.Errors != nil {
for _, e := range err.Errors {
fmt.Printf("code: %s, message: %s", e.Code, e.Message)
}
}
case stock, ok := <-stocks:
if !ok {
break loop
}
fmt.Printf("%+v", stock)
}
}
}
Clojure
Not yet available. Please contact us if you need this SDK.
Curl
curl --location --request GET '{{baseUrl}}/v2/issuing-stock?limit=10&expand=balance' \
--header 'Access-Id: {{accessId}}' \
--header 'Access-Time: {{accessTime}}' \
--header 'Access-Signature: {{accessSignature}}'
Python
IssuingStock(
id=5715709195239424,
design_id=6724771005489152,
embosser_id=7834882116598271,
embosser_name=Stark Embosser,
balance=500,
created=2022-01-01 00:00:00,
updated=2022-01-01 00:00:00
)
Javascript
IssuingStock {
id: '5715709195239424',
designId: '6724771005489152',
embosserId: '7834882116598271',
embosserName: 'Stark Embosser',
balance: 500,
created: '2022-01-01T00:00:00.000000+00:00',
updated: '2022-01-01T00:00:00.000000+00:00'
}
PHP
StarkInfra\IssuingStock Object
(
[id] => 5715709195239424
[designId] => 6724771005489152
[embosserId] => 7834882116598271
[embosserName] => Stark Embosser
[balance] => 500
[created] => DateTime Object ( [date] => 2022-01-01 00:00:00.000000 )
[updated] => DateTime Object ( [date] => 2022-01-01 00:00:00.000000 )
)
Java
IssuingStock({
"id": "5715709195239424",
"designId": "6724771005489152",
"embosserId": "7834882116598271",
"embosserName": "Stark Embosser",
"balance": 500,
"created": "2022-01-01T00:00:00.000000+00:00",
"updated": "2022-01-01T00:00:00.000000+00:00"
})
Ruby
issuingstock(
id: 5715709195239424,
design_id: 6724771005489152,
embosser_id: 7834882116598271,
embosser_name: Stark Embosser,
balance: 500,
created: 2022-01-01T00:00:00+00:00,
updated: 2022-01-01T00:00:00+00:00
)
Elixir
%StarkInfra.IssuingStock{
id: "5715709195239424",
design_id: "6724771005489152",
embosser_id: "7834882116598271",
embosser_name: "Stark Embosser",
balance: 500,
created: "2022-01-01T00:00:00.000000+00:00",
updated: "2022-01-01T00:00:00.000000+00:00"
}
C#
IssuingStock(
Id: 5715709195239424,
DesignId: 6724771005489152,
EmbosserId: 7834882116598271,
EmbosserName: Stark Embosser,
Balance: 500,
Created: 01/01/2022 00:00:00,
Updated: 01/01/2022 00:00:00
)
Go
{
Id:5715709195239424
Balance:500
DesignId:6724771005489152
EmbosserId:7834882116598271
EmbosserName:Stark Embosser
Updated:2022-01-01 00:00:00 +0000 +0000
Created:2022-01-01 00:00:00 +0000 +0000
}
Clojure
Not yet available. Please contact us if you need this SDK.
Curl
{
"cursor": null,
"stocks": [
{
"id": "5715709195239424",
"designId": "6724771005489152",
"embosserId": "7834882116598271",
"embosserName": "Stark Embosser",
"balance": 500,
"created": "2022-01-01T00:00:00.000000+00:00",
"updated": "2022-01-01T00:00:00.000000+00:00"
}
]
}
Getting a Stock
Fetch a single stock by its id. As with Query, inform "expand=balance" to include its current blank count.
Parameters
Python
import starkinfra
stock = starkinfra.issuingstock.get("5715709195239424")
print(stock)
Javascript
const starkinfra = require('starkinfra');
(async() => {
let stock = await starkinfra.issuingStock.get('5715709195239424');
console.log(stock);
})();
PHP
$stock = StarkInfra\IssuingStock::get("5715709195239424");
print_r($stock);
Java
import com.starkinfra.*;
IssuingStock stock = IssuingStock.get("5715709195239424");
System.out.println(stock);
Ruby
require('starkinfra')
stock = StarkInfra::IssuingStock.get("5715709195239424")
puts stock
Elixir
stock = StarkInfra.IssuingStock.get!("5715709195239424")
IO.inspect(stock)
C#
using System;
StarkInfra.IssuingStock stock = StarkInfra.IssuingStock.Get("5715709195239424");
Console.WriteLine(stock);
Go
package main
import (
"fmt"
"github.com/starkinfra/sdk-go/starkinfra/issuingstock"
)
func main() {
stock, err := issuingstock.Get("5715709195239424", nil, nil)
if err.Errors != nil {
for _, e := range err.Errors {
fmt.Printf("code: %s, message: %s", e.Code, e.Message)
}
}
fmt.Printf("%+v", stock)
}
Clojure
Not yet available. Please contact us if you need this SDK.
Curl
curl --location --request GET '{{baseUrl}}/v2/issuing-stock/5715709195239424?expand=balance' \
--header 'Access-Id: {{accessId}}' \
--header 'Access-Time: {{accessTime}}' \
--header 'Access-Signature: {{accessSignature}}'
Python
IssuingStock(
id=5715709195239424,
design_id=6724771005489152,
embosser_id=7834882116598271,
embosser_name=Stark Embosser,
balance=500,
created=2022-01-01 00:00:00,
updated=2022-01-01 00:00:00
)
Javascript
IssuingStock {
id: '5715709195239424',
designId: '6724771005489152',
embosserId: '7834882116598271',
embosserName: 'Stark Embosser',
balance: 500,
created: '2022-01-01T00:00:00.000000+00:00',
updated: '2022-01-01T00:00:00.000000+00:00'
}
PHP
StarkInfra\IssuingStock Object
(
[id] => 5715709195239424
[designId] => 6724771005489152
[embosserId] => 7834882116598271
[embosserName] => Stark Embosser
[balance] => 500
[created] => DateTime Object ( [date] => 2022-01-01 00:00:00.000000 )
[updated] => DateTime Object ( [date] => 2022-01-01 00:00:00.000000 )
)
Java
IssuingStock({
"id": "5715709195239424",
"designId": "6724771005489152",
"embosserId": "7834882116598271",
"embosserName": "Stark Embosser",
"balance": 500,
"created": "2022-01-01T00:00:00.000000+00:00",
"updated": "2022-01-01T00:00:00.000000+00:00"
})
Ruby
issuingstock(
id: 5715709195239424,
design_id: 6724771005489152,
embosser_id: 7834882116598271,
embosser_name: Stark Embosser,
balance: 500,
created: 2022-01-01T00:00:00+00:00,
updated: 2022-01-01T00:00:00+00:00
)
Elixir
%StarkInfra.IssuingStock{
id: "5715709195239424",
design_id: "6724771005489152",
embosser_id: "7834882116598271",
embosser_name: "Stark Embosser",
balance: 500,
created: "2022-01-01T00:00:00.000000+00:00",
updated: "2022-01-01T00:00:00.000000+00:00"
}
C#
IssuingStock(
Id: 5715709195239424,
DesignId: 6724771005489152,
EmbosserId: 7834882116598271,
EmbosserName: Stark Embosser,
Balance: 500,
Created: 01/01/2022 00:00:00,
Updated: 01/01/2022 00:00:00
)
Go
{
Id:5715709195239424
Balance:500
DesignId:6724771005489152
EmbosserId:7834882116598271
EmbosserName:Stark Embosser
Updated:2022-01-01 00:00:00 +0000 +0000
Created:2022-01-01 00:00:00 +0000 +0000
}
Clojure
Not yet available. Please contact us if you need this SDK.
Curl
{
"stock": {
"id": "5715709195239424",
"designId": "6724771005489152",
"embosserId": "7834882116598271",
"embosserName": "Stark Embosser",
"balance": 500,
"created": "2022-01-01T00:00:00.000000+00:00",
"updated": "2022-01-01T00:00:00.000000+00:00"
}
}
Getting a Stock's Logs
Audit a stock's balance history by querying its logs with the "stockIds" filter. Each balance shift creates a Log — a stock that was created, restocked and then partly embossed returns one log per event. The "stock" field in each log is a representation of the Issuing Stock the log refers to.
You can also filter by "types" (created, restocked, spent, lost) and "after" / "before", or fetch a single log with GET /v2/issuing-stock/log/:id.
Parameters
Python
import starkinfra
logs = starkinfra.issuingstock.log.query(stock_ids=["5715709195239424"])
for log in logs:
print(log)
Javascript
const starkinfra = require('starkinfra');
(async() => {
let logs = await starkinfra.issuingStock.log.query({ stockIds: ['5715709195239424'] });
for await (let log of logs) {
console.log(log);
}
})();
PHP
$logs = StarkInfra\IssuingStock\Log::query(["stockIds" => ["5715709195239424"]]);
foreach ($logs as $log) {
print_r($log);
}
Java
import com.starkinfra.*; import java.util.HashMap; HashMapparams = new HashMap<>(); params.put("stockIds", new String[]{"5715709195239424"}); Generator logs = IssuingStock.Log.query(params); for (IssuingStock.Log log : logs) { System.out.println(log); }
Ruby
require('starkinfra')
logs = StarkInfra::IssuingStock::Log.query(stock_ids: ["5715709195239424"])
logs.each do |log|
puts log
end
Elixir
logs = StarkInfra.IssuingStock.Log.query!(stock_ids: ["5715709195239424"]) logs |> Enum.each(&IO.inspect/1)
C#
using System; using System.Collections.Generic; IEnumerablelogs = StarkInfra.IssuingStock.Log.Query( stockIds: new List { "5715709195239424" } ); foreach (StarkInfra.IssuingStock.Log log in logs) { Console.WriteLine(log); }
Go
package main
import (
"fmt"
"github.com/starkinfra/sdk-go/starkinfra/issuingstock/log"
)
func main() {
var params = map[string]interface{}{}
params["stockIds"] = []string{"5715709195239424"}
logs, errorChannel := log.Query(params, nil)
loop:
for {
select {
case err := <-errorChannel:
if err.Errors != nil {
for _, e := range err.Errors {
fmt.Printf("code: %s, message: %s", e.Code, e.Message)
}
}
case stockLog, ok := <-logs:
if !ok {
break loop
}
fmt.Printf("%+v", stockLog)
}
}
}
Clojure
Not yet available. Please contact us if you need this SDK.
Curl
curl --location --request GET '{{baseUrl}}/v2/issuing-stock/log?stockIds=5715709195239424' \
--header 'Access-Id: {{accessId}}' \
--header 'Access-Time: {{accessTime}}' \
--header 'Access-Signature: {{accessSignature}}'
Python
Log(
id=6724771005489152,
type=created,
stock=IssuingStock(id=5715709195239424, balance=500, ...),
count=500,
created=2022-01-01 00:00:00
)
Log(
id=5547499534213120,
type=restocked,
stock=IssuingStock(id=5715709195239424, balance=1500, ...),
count=1000,
created=2022-02-01 00:00:00
)
Log(
id=5189683645874176,
type=spent,
stock=IssuingStock(id=5715709195239424, balance=1450, ...),
count=-50,
created=2022-03-01 00:00:00
)
Javascript
Log {
id: '6724771005489152',
type: 'created',
stock: IssuingStock { id: '5715709195239424', balance: 500, ... },
count: 500,
created: '2022-01-01T00:00:00.000000+00:00'
}
Log {
id: '5547499534213120',
type: 'restocked',
stock: IssuingStock { id: '5715709195239424', balance: 1500, ... },
count: 1000,
created: '2022-02-01T00:00:00.000000+00:00'
}
Log {
id: '5189683645874176',
type: 'spent',
stock: IssuingStock { id: '5715709195239424', balance: 1450, ... },
count: -50,
created: '2022-03-01T00:00:00.000000+00:00'
}
PHP
StarkInfra\IssuingStock\Log Object
(
[id] => 6724771005489152
[type] => created
[stock] => StarkInfra\IssuingStock Object ( [id] => 5715709195239424 [balance] => 500 ... )
[count] => 500
[created] => DateTime Object ( [date] => 2022-01-01 00:00:00.000000 )
)
StarkInfra\IssuingStock\Log Object
(
[id] => 5547499534213120
[type] => restocked
[stock] => StarkInfra\IssuingStock Object ( [id] => 5715709195239424 [balance] => 1500 ... )
[count] => 1000
[created] => DateTime Object ( [date] => 2022-02-01 00:00:00.000000 )
)
StarkInfra\IssuingStock\Log Object
(
[id] => 5189683645874176
[type] => spent
[stock] => StarkInfra\IssuingStock Object ( [id] => 5715709195239424 [balance] => 1450 ... )
[count] => -50
[created] => DateTime Object ( [date] => 2022-03-01 00:00:00.000000 )
)
Java
IssuingStock.Log({
"id": "6724771005489152",
"type": "created",
"stock": {"id": "5715709195239424", "balance": 500, ...},
"count": 500,
"created": "2022-01-01T00:00:00.000000+00:00"
})
IssuingStock.Log({
"id": "5547499534213120",
"type": "restocked",
"stock": {"id": "5715709195239424", "balance": 1500, ...},
"count": 1000,
"created": "2022-02-01T00:00:00.000000+00:00"
})
IssuingStock.Log({
"id": "5189683645874176",
"type": "spent",
"stock": {"id": "5715709195239424", "balance": 1450, ...},
"count": -50,
"created": "2022-03-01T00:00:00.000000+00:00"
})
Ruby
log(
id: 6724771005489152,
type: created,
stock: issuingstock(id: 5715709195239424, balance: 500, ...),
count: 500,
created: 2022-01-01T00:00:00+00:00
)
log(
id: 5547499534213120,
type: restocked,
stock: issuingstock(id: 5715709195239424, balance: 1500, ...),
count: 1000,
created: 2022-02-01T00:00:00+00:00
)
log(
id: 5189683645874176,
type: spent,
stock: issuingstock(id: 5715709195239424, balance: 1450, ...),
count: -50,
created: 2022-03-01T00:00:00+00:00
)
Elixir
%StarkInfra.IssuingStock.Log{
id: "6724771005489152",
type: "created",
stock: %StarkInfra.IssuingStock{id: "5715709195239424", balance: 500, ...},
count: 500,
created: "2022-01-01T00:00:00.000000+00:00"
}
%StarkInfra.IssuingStock.Log{
id: "5547499534213120",
type: "restocked",
stock: %StarkInfra.IssuingStock{id: "5715709195239424", balance: 1500, ...},
count: 1000,
created: "2022-02-01T00:00:00.000000+00:00"
}
%StarkInfra.IssuingStock.Log{
id: "5189683645874176",
type: "spent",
stock: %StarkInfra.IssuingStock{id: "5715709195239424", balance: 1450, ...},
count: -50,
created: "2022-03-01T00:00:00.000000+00:00"
}
C#
IssuingStock.Log(
Id: 6724771005489152,
Type: created,
Stock: IssuingStock(Id: 5715709195239424, Balance: 500, ...),
Count: 500,
Created: 01/01/2022 00:00:00
)
IssuingStock.Log(
Id: 5547499534213120,
Type: restocked,
Stock: IssuingStock(Id: 5715709195239424, Balance: 1500, ...),
Count: 1000,
Created: 02/01/2022 00:00:00
)
IssuingStock.Log(
Id: 5189683645874176,
Type: spent,
Stock: IssuingStock(Id: 5715709195239424, Balance: 1450, ...),
Count: -50,
Created: 03/01/2022 00:00:00
)
Go
{
Id:6724771005489152
Type:created
Stock:{Id:5715709195239424 Balance:500 ...}
Count:500
Created:2022-01-01 00:00:00 +0000 +0000
}
{
Id:5547499534213120
Type:restocked
Stock:{Id:5715709195239424 Balance:1500 ...}
Count:1000
Created:2022-02-01 00:00:00 +0000 +0000
}
{
Id:5189683645874176
Type:spent
Stock:{Id:5715709195239424 Balance:1450 ...}
Count:-50
Created:2022-03-01 00:00:00 +0000 +0000
}
Clojure
Not yet available. Please contact us if you need this SDK.
Curl
{
"cursor": null,
"logs": [
{
"id": "6724771005489152",
"type": "created",
"stock": {"id": "5715709195239424", "balance": 500},
"count": 500,
"created": "2022-01-01T00:00:00.000000+00:00"
},
{
"id": "5547499534213120",
"type": "restocked",
"stock": {"id": "5715709195239424", "balance": 1500},
"count": 1000,
"created": "2022-02-01T00:00:00.000000+00:00"
},
{
"id": "5189683645874176",
"type": "spent",
"stock": {"id": "5715709195239424", "balance": 1450},
"count": -50,
"created": "2022-03-01T00:00:00.000000+00:00"
}
]
}
Issuing Stock Rule Overview
An Issuing Stock Rule sets a low-balance alert on one of your Issuing Stock entries. When that stock's available count drops below the rule's minimumBalance, we notify the contacts you registered so you can reorder cards before you run out.
One rule per stock. Each stock can have a single active rule at a time. The rule is tied to a stockId at creation, and that link cannot be changed afterwards — to point the alert at a different stock, cancel this rule and create a new one.
Who gets notified. A rule notifies the addresses in its "emails" list and the numbers in its "phones" list (each capped at 10). At least one email or phone must be present — a rule with no contacts is rejected.
What triggers it. minimumBalance is a stock count, not money: it is the number of remaining cards below which the alert fires. It must be a positive integer.
Stock Rule Statuses
Each Issuing Stock Rule has a status that reflects where it is in its life cycle:
| Status | Description |
|---|---|
| active | The rule is active and monitoring its stock. New rules are created in this status. Only one active rule is allowed per stock. |
| canceled | The rule was permanently canceled and no longer fires alerts. This is irreversible. |
Creating a Stock Rule
Create one or more stock rules by sending a "rules" list. Each rule needs a minimumBalance and the stockId of the Issuing Stock it watches, plus at least one contact across "emails" and "phones".
Creating a second rule for a stock that already has an active rule is rejected — cancel the existing one first.
Parameters
Python
import starkinfra
rules = starkinfra.issuingstockrule.create([
starkinfra.IssuingStockRule(
minimum_balance=1000,
stock_id="6724771005489152",
emails=["aria@stark.com"],
phones=["+5511999999999"],
tags=["stock: black-card"]
)
])
for rule in rules:
print(rule)
Javascript
const starkinfra = require('starkinfra');
(async() => {
let rules = await starkinfra.issuingStockRule.create([
new starkinfra.IssuingStockRule({
minimumBalance: 1000,
stockId: '6724771005489152',
emails: ['aria@stark.com'],
phones: ['+5511999999999'],
tags: ['stock: black-card']
})
]);
for (let rule of rules) {
console.log(rule);
}
})();
PHP
use StarkInfra\IssuingStockRule;
$rules = IssuingStockRule::create([
new IssuingStockRule([
"minimumBalance" => 1000,
"stockId" => "6724771005489152",
"emails" => ["aria@stark.com"],
"phones" => ["+5511999999999"],
"tags" => ["stock: black-card"]
])
]);
foreach ($rules as $rule) {
print_r($rule);
}
Java
import com.starkinfra.*; import java.util.Arrays; import java.util.HashMap; import java.util.List; HashMapdata = new HashMap<>(); data.put("minimumBalance", 1000); data.put("stockId", "6724771005489152"); data.put("emails", new String[]{"aria@stark.com"}); data.put("phones", new String[]{"+5511999999999"}); data.put("tags", new String[]{"stock: black-card"}); List rules = IssuingStockRule.create( Arrays.asList(new IssuingStockRule(data)) ); for (IssuingStockRule rule : rules) { System.out.println(rule); }
Ruby
require('starkinfra')
rules = StarkInfra::IssuingStockRule.create([
StarkInfra::IssuingStockRule.new(
minimum_balance: 1000,
stock_id: "6724771005489152",
emails: ["aria@stark.com"],
phones: ["+5511999999999"],
tags: ["stock: black-card"]
)
])
rules.each do |rule|
puts rule
end
Elixir
rules = StarkInfra.IssuingStockRule.create!([
%StarkInfra.IssuingStockRule{
minimum_balance: 1000,
stock_id: "6724771005489152",
emails: ["aria@stark.com"],
phones: ["+5511999999999"],
tags: ["stock: black-card"]
}
])
rules |> Enum.each(&IO.inspect/1)
C#
using System; using System.Collections.Generic; Listrules = StarkInfra.IssuingStockRule.Create( new List { new StarkInfra.IssuingStockRule( minimumBalance: 1000, stockId: "6724771005489152", emails: new List { "aria@stark.com" }, phones: new List { "+5511999999999" }, tags: new List { "stock: black-card" } ) } ); foreach (StarkInfra.IssuingStockRule rule in rules) { Console.WriteLine(rule); }
Go
package main
import (
"fmt"
"github.com/starkinfra/sdk-go/starkinfra/issuingstockrule"
)
func main() {
rules, err := issuingstockrule.Create(
[]issuingstockrule.IssuingStockRule{
{
MinimumBalance: 1000,
StockId: "6724771005489152",
Emails: []string{"aria@stark.com"},
Phones: []string{"+5511999999999"},
Tags: []string{"stock: black-card"},
},
},
nil,
)
if err.Errors != nil {
for _, e := range err.Errors {
fmt.Printf("code: %s, message: %s", e.Code, e.Message)
}
}
for _, rule := range rules {
fmt.Printf("%+v", rule)
}
}
Clojure
Not yet available. Please contact us if you need this SDK.
Curl
curl --location --request POST '{{baseUrl}}/v2/issuing-stock-rule' \
--header 'Access-Id: {{accessId}}' \
--header 'Access-Time: {{accessTime}}' \
--header 'Access-Signature: {{accessSignature}}' \
--header 'Content-Type: application/json' \
--data-raw '{
"rules": [
{
"minimumBalance": 1000,
"stockId": "6724771005489152",
"emails": ["aria@stark.com"],
"phones": ["+5511999999999"],
"tags": ["stock: black-card"]
}
]
}'
Python
IssuingStockRule(
id=5715709195239424,
minimum_balance=1000,
stock_id=6724771005489152,
emails=['aria@stark.com'],
phones=['+5511999999999'],
tags=['stock: black-card'],
status=active,
created=2022-01-01 00:00:00,
updated=2022-01-01 00:00:00
)
Javascript
IssuingStockRule {
id: '5715709195239424',
minimumBalance: 1000,
stockId: '6724771005489152',
emails: [ 'aria@stark.com' ],
phones: [ '+5511999999999' ],
tags: [ 'stock: black-card' ],
status: 'active',
created: '2022-01-01T00:00:00.000000+00:00',
updated: '2022-01-01T00:00:00.000000+00:00'
}
PHP
StarkInfra\IssuingStockRule Object
(
[id] => 5715709195239424
[minimumBalance] => 1000
[stockId] => 6724771005489152
[emails] => Array ( [0] => aria@stark.com )
[phones] => Array ( [0] => +5511999999999 )
[tags] => Array ( [0] => stock: black-card )
[status] => active
[created] => DateTime Object ( [date] => 2022-01-01 00:00:00.000000 )
[updated] => DateTime Object ( [date] => 2022-01-01 00:00:00.000000 )
)
Java
IssuingStockRule({
"id": "5715709195239424",
"minimumBalance": 1000,
"stockId": "6724771005489152",
"emails": ["aria@stark.com"],
"phones": ["+5511999999999"],
"tags": ["stock: black-card"],
"status": "active",
"created": "2022-01-01T00:00:00.000000+00:00",
"updated": "2022-01-01T00:00:00.000000+00:00"
})
Ruby
issuingstockrule(
id: 5715709195239424,
minimum_balance: 1000,
stock_id: 6724771005489152,
emails: ["aria@stark.com"],
phones: ["+5511999999999"],
tags: ["stock: black-card"],
status: active,
created: 2022-01-01T00:00:00+00:00,
updated: 2022-01-01T00:00:00+00:00
)
Elixir
%StarkInfra.IssuingStockRule{
id: "5715709195239424",
minimum_balance: 1000,
stock_id: "6724771005489152",
emails: ["aria@stark.com"],
phones: ["+5511999999999"],
tags: ["stock: black-card"],
status: "active",
created: "2022-01-01T00:00:00.000000+00:00",
updated: "2022-01-01T00:00:00.000000+00:00"
}
C#
IssuingStockRule(
Id: 5715709195239424,
MinimumBalance: 1000,
StockId: 6724771005489152,
Emails: [aria@stark.com],
Phones: [+5511999999999],
Tags: [stock: black-card],
Status: active,
Created: 01/01/2022 00:00:00,
Updated: 01/01/2022 00:00:00
)
Go
{
Id:5715709195239424
MinimumBalance:1000
StockId:6724771005489152
Emails:[aria@stark.com]
Phones:[+5511999999999]
Tags:[stock: black-card]
Status:active
Updated:2022-01-01 00:00:00 +0000 +0000
Created:2022-01-01 00:00:00 +0000 +0000
}
Clojure
Not yet available. Please contact us if you need this SDK.
Curl
{
"message": "Stock rule(s) successfully registered.",
"rules": [
{
"id": "5715709195239424",
"minimumBalance": 1000,
"stockId": "6724771005489152",
"emails": ["aria@stark.com"],
"phones": ["+5511999999999"],
"tags": ["stock: black-card"],
"status": "active",
"created": "2022-01-01T00:00:00.000000+00:00",
"updated": "2022-01-01T00:00:00.000000+00:00"
}
]
}
Querying Stock Rules
List your stock rules in chunks of at most 100. Filter by "status", "stockIds" (to find the rule watching a given stock), "ids", "tags" and "after" / "before".
Parameters
Python
import starkinfra
rules = starkinfra.issuingstockrule.query(
limit=10,
status="active"
)
for rule in rules:
print(rule)
Javascript
const starkinfra = require('starkinfra');
(async() => {
let rules = await starkinfra.issuingStockRule.query({
limit: 10,
status: 'active'
});
for await (let rule of rules) {
console.log(rule);
}
})();
PHP
$rules = StarkInfra\IssuingStockRule::query([
"limit" => 10,
"status" => "active"
]);
foreach ($rules as $rule) {
print_r($rule);
}
Java
import com.starkinfra.*; import java.util.HashMap; HashMapparams = new HashMap<>(); params.put("limit", 10); params.put("status", "active"); Generator rules = IssuingStockRule.query(params); for (IssuingStockRule rule : rules) { System.out.println(rule); }
Ruby
require('starkinfra')
rules = StarkInfra::IssuingStockRule.query(
limit: 10,
status: "active"
)
rules.each do |rule|
puts rule
end
Elixir
rules = StarkInfra.IssuingStockRule.query!(
limit: 10,
status: "active"
)
rules |> Enum.each(&IO.inspect/1)
C#
using System; using System.Collections.Generic; IEnumerablerules = StarkInfra.IssuingStockRule.Query( limit: 10, status: "active" ); foreach (StarkInfra.IssuingStockRule rule in rules) { Console.WriteLine(rule); }
Go
package main
import (
"fmt"
"github.com/starkinfra/sdk-go/starkinfra/issuingstockrule"
)
func main() {
var params = map[string]interface{}{}
params["limit"] = 10
params["status"] = "active"
rules, errorChannel := issuingstockrule.Query(params, nil)
loop:
for {
select {
case err := <-errorChannel:
if err.Errors != nil {
for _, e := range err.Errors {
fmt.Printf("code: %s, message: %s", e.Code, e.Message)
}
}
case rule, ok := <-rules:
if !ok {
break loop
}
fmt.Printf("%+v", rule)
}
}
}
Clojure
Not yet available. Please contact us if you need this SDK.
Curl
curl --location --request GET '{{baseUrl}}/v2/issuing-stock-rule?limit=10&status=active' \
--header 'Access-Id: {{accessId}}' \
--header 'Access-Time: {{accessTime}}' \
--header 'Access-Signature: {{accessSignature}}'
Python
IssuingStockRule(
id=5715709195239424,
minimum_balance=1000,
stock_id=6724771005489152,
emails=['aria@stark.com'],
phones=['+5511999999999'],
tags=['stock: black-card'],
status=active,
created=2022-01-01 00:00:00,
updated=2022-01-01 00:00:00
)
Javascript
IssuingStockRule {
id: '5715709195239424',
minimumBalance: 1000,
stockId: '6724771005489152',
emails: [ 'aria@stark.com' ],
phones: [ '+5511999999999' ],
tags: [ 'stock: black-card' ],
status: 'active',
created: '2022-01-01T00:00:00.000000+00:00',
updated: '2022-01-01T00:00:00.000000+00:00'
}
PHP
StarkInfra\IssuingStockRule Object
(
[id] => 5715709195239424
[minimumBalance] => 1000
[stockId] => 6724771005489152
[emails] => Array ( [0] => aria@stark.com )
[phones] => Array ( [0] => +5511999999999 )
[tags] => Array ( [0] => stock: black-card )
[status] => active
[created] => DateTime Object ( [date] => 2022-01-01 00:00:00.000000 )
[updated] => DateTime Object ( [date] => 2022-01-01 00:00:00.000000 )
)
Java
IssuingStockRule({
"id": "5715709195239424",
"minimumBalance": 1000,
"stockId": "6724771005489152",
"emails": ["aria@stark.com"],
"phones": ["+5511999999999"],
"tags": ["stock: black-card"],
"status": "active",
"created": "2022-01-01T00:00:00.000000+00:00",
"updated": "2022-01-01T00:00:00.000000+00:00"
})
Ruby
issuingstockrule(
id: 5715709195239424,
minimum_balance: 1000,
stock_id: 6724771005489152,
emails: ["aria@stark.com"],
phones: ["+5511999999999"],
tags: ["stock: black-card"],
status: active,
created: 2022-01-01T00:00:00+00:00,
updated: 2022-01-01T00:00:00+00:00
)
Elixir
%StarkInfra.IssuingStockRule{
id: "5715709195239424",
minimum_balance: 1000,
stock_id: "6724771005489152",
emails: ["aria@stark.com"],
phones: ["+5511999999999"],
tags: ["stock: black-card"],
status: "active",
created: "2022-01-01T00:00:00.000000+00:00",
updated: "2022-01-01T00:00:00.000000+00:00"
}
C#
IssuingStockRule(
Id: 5715709195239424,
MinimumBalance: 1000,
StockId: 6724771005489152,
Emails: [aria@stark.com],
Phones: [+5511999999999],
Tags: [stock: black-card],
Status: active,
Created: 01/01/2022 00:00:00,
Updated: 01/01/2022 00:00:00
)
Go
{
Id:5715709195239424
MinimumBalance:1000
StockId:6724771005489152
Emails:[aria@stark.com]
Phones:[+5511999999999]
Tags:[stock: black-card]
Status:active
Updated:2022-01-01 00:00:00 +0000 +0000
Created:2022-01-01 00:00:00 +0000 +0000
}
Clojure
Not yet available. Please contact us if you need this SDK.
Curl
{
"cursor": null,
"rules": [
{
"id": "5715709195239424",
"minimumBalance": 1000,
"stockId": "6724771005489152",
"emails": ["aria@stark.com"],
"phones": ["+5511999999999"],
"tags": ["stock: black-card"],
"status": "active",
"created": "2022-01-01T00:00:00.000000+00:00",
"updated": "2022-01-01T00:00:00.000000+00:00"
}
]
}
Updating a Stock Rule
Change a rule's minimumBalance, emails, phones or tags. The stockId is fixed at creation and cannot be updated.
Each list you send replaces the old one wholesale, and the combined emails + phones must still hold at least one contact. A canceled rule cannot be updated.
Parameters
Python
import starkinfra
rule = starkinfra.issuingstockrule.update(
"5715709195239424",
minimum_balance=2000,
emails=["aria@stark.com", "tony@stark.com"]
)
print(rule)
Javascript
const starkinfra = require('starkinfra');
(async() => {
let rule = await starkinfra.issuingStockRule.update(
'5715709195239424',
{
minimumBalance: 2000,
emails: ['aria@stark.com', 'tony@stark.com']
}
);
console.log(rule);
})();
PHP
$rule = StarkInfra\IssuingStockRule::update("5715709195239424", [
"minimumBalance" => 2000,
"emails" => ["aria@stark.com", "tony@stark.com"]
]);
print_r($rule);
Java
import com.starkinfra.*; import java.util.HashMap; HashMappatch = new HashMap<>(); patch.put("minimumBalance", 2000); patch.put("emails", new String[]{"aria@stark.com", "tony@stark.com"}); IssuingStockRule rule = IssuingStockRule.update("5715709195239424", patch); System.out.println(rule);
Ruby
require('starkinfra')
rule = StarkInfra::IssuingStockRule.update(
"5715709195239424",
minimum_balance: 2000,
emails: ["aria@stark.com", "tony@stark.com"]
)
puts rule
Elixir
rule = StarkInfra.IssuingStockRule.update!(
"5715709195239424",
minimum_balance: 2000,
emails: ["aria@stark.com", "tony@stark.com"]
)
IO.inspect(rule)
C#
using System; using System.Collections.Generic; Dictionarypatch = new Dictionary { { "minimumBalance", 2000 }, { "emails", new List { "aria@stark.com", "tony@stark.com" } } }; StarkInfra.IssuingStockRule rule = StarkInfra.IssuingStockRule.Update("5715709195239424", patch: patch); Console.WriteLine(rule);
Go
package main
import (
"fmt"
"github.com/starkinfra/sdk-go/starkinfra/issuingstockrule"
)
func main() {
var patch = map[string]interface{}{}
patch["minimumBalance"] = 2000
patch["emails"] = []string{"aria@stark.com", "tony@stark.com"}
rule, err := issuingstockrule.Update("5715709195239424", patch, nil)
if err.Errors != nil {
for _, e := range err.Errors {
fmt.Printf("code: %s, message: %s", e.Code, e.Message)
}
}
fmt.Printf("%+v", rule)
}
Clojure
Not yet available. Please contact us if you need this SDK.
Curl
curl --location --request PATCH '{{baseUrl}}/v2/issuing-stock-rule/5715709195239424' \
--header 'Access-Id: {{accessId}}' \
--header 'Access-Time: {{accessTime}}' \
--header 'Access-Signature: {{accessSignature}}' \
--header 'Content-Type: application/json' \
--data-raw '{
"minimumBalance": 2000,
"emails": ["aria@stark.com", "tony@stark.com"]
}'
Python
IssuingStockRule(
id=5715709195239424,
minimum_balance=2000,
stock_id=6724771005489152,
emails=['aria@stark.com', 'tony@stark.com'],
phones=['+5511999999999'],
tags=['stock: black-card'],
status=active,
created=2022-01-01 00:00:00,
updated=2022-06-01 00:00:00
)
Javascript
IssuingStockRule {
id: '5715709195239424',
minimumBalance: 2000,
stockId: '6724771005489152',
emails: [ 'aria@stark.com', 'tony@stark.com' ],
phones: [ '+5511999999999' ],
tags: [ 'stock: black-card' ],
status: 'active',
created: '2022-01-01T00:00:00.000000+00:00',
updated: '2022-06-01T00:00:00.000000+00:00'
}
PHP
StarkInfra\IssuingStockRule Object
(
[id] => 5715709195239424
[minimumBalance] => 2000
[stockId] => 6724771005489152
[emails] => Array ( [0] => aria@stark.com [1] => tony@stark.com )
[phones] => Array ( [0] => +5511999999999 )
[tags] => Array ( [0] => stock: black-card )
[status] => active
[created] => DateTime Object ( [date] => 2022-01-01 00:00:00.000000 )
[updated] => DateTime Object ( [date] => 2022-06-01 00:00:00.000000 )
)
Java
IssuingStockRule({
"id": "5715709195239424",
"minimumBalance": 2000,
"stockId": "6724771005489152",
"emails": ["aria@stark.com", "tony@stark.com"],
"phones": ["+5511999999999"],
"tags": ["stock: black-card"],
"status": "active",
"created": "2022-01-01T00:00:00.000000+00:00",
"updated": "2022-06-01T00:00:00.000000+00:00"
})
Ruby
issuingstockrule(
id: 5715709195239424,
minimum_balance: 2000,
stock_id: 6724771005489152,
emails: ["aria@stark.com", "tony@stark.com"],
phones: ["+5511999999999"],
tags: ["stock: black-card"],
status: active,
created: 2022-01-01T00:00:00+00:00,
updated: 2022-06-01T00:00:00+00:00
)
Elixir
%StarkInfra.IssuingStockRule{
id: "5715709195239424",
minimum_balance: 2000,
stock_id: "6724771005489152",
emails: ["aria@stark.com", "tony@stark.com"],
phones: ["+5511999999999"],
tags: ["stock: black-card"],
status: "active",
created: "2022-01-01T00:00:00.000000+00:00",
updated: "2022-06-01T00:00:00.000000+00:00"
}
C#
IssuingStockRule(
Id: 5715709195239424,
MinimumBalance: 2000,
StockId: 6724771005489152,
Emails: [aria@stark.com, tony@stark.com],
Phones: [+5511999999999],
Tags: [stock: black-card],
Status: active,
Created: 01/01/2022 00:00:00,
Updated: 06/01/2022 00:00:00
)
Go
{
Id:5715709195239424
MinimumBalance:2000
StockId:6724771005489152
Emails:[aria@stark.com tony@stark.com]
Phones:[+5511999999999]
Tags:[stock: black-card]
Status:active
Updated:2022-06-01 00:00:00 +0000 +0000
Created:2022-01-01 00:00:00 +0000 +0000
}
Clojure
Not yet available. Please contact us if you need this SDK.
Curl
{
"rule": {
"id": "5715709195239424",
"minimumBalance": 2000,
"stockId": "6724771005489152",
"emails": ["aria@stark.com", "tony@stark.com"],
"phones": ["+5511999999999"],
"tags": ["stock: black-card"],
"status": "active",
"created": "2022-01-01T00:00:00.000000+00:00",
"updated": "2022-06-01T00:00:00.000000+00:00"
}
}
Canceling a Stock Rule
Permanently cancel a rule by its id. Its status becomes "canceled" and it stops firing alerts. This action is irreversible, and once canceled the stock is free to receive a new active rule.
Parameters
Python
import starkinfra
rule = starkinfra.issuingstockrule.cancel("5715709195239424")
print(rule)
Javascript
const starkinfra = require('starkinfra');
(async() => {
let rule = await starkinfra.issuingStockRule.cancel('5715709195239424');
console.log(rule);
})();
PHP
$rule = StarkInfra\IssuingStockRule::cancel("5715709195239424");
print_r($rule);
Java
import com.starkinfra.*;
IssuingStockRule rule = IssuingStockRule.cancel("5715709195239424");
System.out.println(rule);
Ruby
require('starkinfra')
rule = StarkInfra::IssuingStockRule.cancel("5715709195239424")
puts rule
Elixir
rule = StarkInfra.IssuingStockRule.cancel!("5715709195239424")
IO.inspect(rule)
C#
using System;
StarkInfra.IssuingStockRule rule = StarkInfra.IssuingStockRule.Cancel("5715709195239424");
Console.WriteLine(rule);
Go
package main
import (
"fmt"
"github.com/starkinfra/sdk-go/starkinfra/issuingstockrule"
)
func main() {
rule, err := issuingstockrule.Cancel("5715709195239424", nil)
if err.Errors != nil {
for _, e := range err.Errors {
fmt.Printf("code: %s, message: %s", e.Code, e.Message)
}
}
fmt.Printf("%+v", rule)
}
Clojure
Not yet available. Please contact us if you need this SDK.
Curl
curl --location --request DELETE '{{baseUrl}}/v2/issuing-stock-rule/5715709195239424' \
--header 'Access-Id: {{accessId}}' \
--header 'Access-Time: {{accessTime}}' \
--header 'Access-Signature: {{accessSignature}}'
Python
IssuingStockRule(
id=5715709195239424,
minimum_balance=2000,
stock_id=6724771005489152,
emails=['aria@stark.com', 'tony@stark.com'],
phones=['+5511999999999'],
tags=['stock: black-card'],
status=canceled,
created=2022-01-01 00:00:00,
updated=2022-06-01 00:00:00
)
Javascript
IssuingStockRule {
id: '5715709195239424',
minimumBalance: 2000,
stockId: '6724771005489152',
emails: [ 'aria@stark.com', 'tony@stark.com' ],
phones: [ '+5511999999999' ],
tags: [ 'stock: black-card' ],
status: 'canceled',
created: '2022-01-01T00:00:00.000000+00:00',
updated: '2022-06-01T00:00:00.000000+00:00'
}
PHP
StarkInfra\IssuingStockRule Object
(
[id] => 5715709195239424
[minimumBalance] => 2000
[stockId] => 6724771005489152
[emails] => Array ( [0] => aria@stark.com [1] => tony@stark.com )
[phones] => Array ( [0] => +5511999999999 )
[tags] => Array ( [0] => stock: black-card )
[status] => canceled
[created] => DateTime Object ( [date] => 2022-01-01 00:00:00.000000 )
[updated] => DateTime Object ( [date] => 2022-06-01 00:00:00.000000 )
)
Java
IssuingStockRule({
"id": "5715709195239424",
"minimumBalance": 2000,
"stockId": "6724771005489152",
"emails": ["aria@stark.com", "tony@stark.com"],
"phones": ["+5511999999999"],
"tags": ["stock: black-card"],
"status": "canceled",
"created": "2022-01-01T00:00:00.000000+00:00",
"updated": "2022-06-01T00:00:00.000000+00:00"
})
Ruby
issuingstockrule(
id: 5715709195239424,
minimum_balance: 2000,
stock_id: 6724771005489152,
emails: ["aria@stark.com", "tony@stark.com"],
phones: ["+5511999999999"],
tags: ["stock: black-card"],
status: canceled,
created: 2022-01-01T00:00:00+00:00,
updated: 2022-06-01T00:00:00+00:00
)
Elixir
%StarkInfra.IssuingStockRule{
id: "5715709195239424",
minimum_balance: 2000,
stock_id: "6724771005489152",
emails: ["aria@stark.com", "tony@stark.com"],
phones: ["+5511999999999"],
tags: ["stock: black-card"],
status: "canceled",
created: "2022-01-01T00:00:00.000000+00:00",
updated: "2022-06-01T00:00:00.000000+00:00"
}
C#
IssuingStockRule(
Id: 5715709195239424,
MinimumBalance: 2000,
StockId: 6724771005489152,
Emails: [aria@stark.com, tony@stark.com],
Phones: [+5511999999999],
Tags: [stock: black-card],
Status: canceled,
Created: 01/01/2022 00:00:00,
Updated: 06/01/2022 00:00:00
)
Go
{
Id:5715709195239424
MinimumBalance:2000
StockId:6724771005489152
Emails:[aria@stark.com tony@stark.com]
Phones:[+5511999999999]
Tags:[stock: black-card]
Status:canceled
Updated:2022-06-01 00:00:00 +0000 +0000
Created:2022-01-01 00:00:00 +0000 +0000
}
Clojure
Not yet available. Please contact us if you need this SDK.
Curl
{
"message": "Stock rule successfully canceled.",
"rule": {
"id": "5715709195239424",
"minimumBalance": 2000,
"stockId": "6724771005489152",
"emails": ["aria@stark.com", "tony@stark.com"],
"phones": ["+5511999999999"],
"tags": ["stock: black-card"],
"status": "canceled",
"created": "2022-01-01T00:00:00.000000+00:00",
"updated": "2022-06-01T00:00:00.000000+00:00"
}
}
Issuing Restock Overview
An Issuing Restock is an order you place to replenish your Issuing Stock of blank cards. Each physical card you emboss consumes one blank from that stock — when it runs low, create a Restock to request more.
What you send. A restock needs only a count (how many blanks to order) and the stockId of the Issuing Stock to top up. You can create up to 100 restocks in a single request by sending more entries in the "restocks" list.
Fulfillment is asynchronous. Creating a restock does not add blanks to your stock immediately. The order starts as "created", moves to "processing" while it is being fulfilled, and reaches "confirmed" once the blanks have been added to your stock. You don't change a restock's status yourself — it advances on its own and is reflected back to you through its status and its Logs.
Read-only after creation. A restock has no update or cancel endpoint. Once placed, you can only query it, fetch it by id, or follow its Logs to track fulfillment.
Restock Statuses
Each Issuing Restock has a status that reflects where its order is in the fulfillment flow:
| Status | Description |
|---|---|
| created | The restock order was registered and is waiting to be fulfilled. |
| processing | The order is being fulfilled — the requested blanks are being added to your stock. |
| confirmed | The order was fulfilled: the blanks are now part of your stock and available for embossing. |
| canceled | The order was canceled and its blanks were not added to your stock. |
Restock Logs
Every time a restock advances through its fulfillment flow, we create a Log entry. Logs let you follow an order from placement to confirmation without polling the restock itself — you get one log per step the order goes through (created, processing, confirmed).
Query the restock logs with GET /v2/issuing-restock/log (filter by restockIds, types, after / before), or fetch a single one with GET /v2/issuing-restock/log/:id. Each log carries the "restock" it refers to (shown abbreviated with "...").
Creating a Restock
Order blank cards by sending a "restocks" list. Each entry needs a count (the number of blanks to order) and the stockId of the Issuing Stock to replenish. Optionally tag each restock for later queries.
New restocks come back with status "created" — they are queued for fulfillment, not yet added to your stock.
Parameters
Python
import starkinfra
restocks = starkinfra.issuingrestock.create([
starkinfra.IssuingRestock(
count=100,
stock_id="5715709195239424",
tags=["department: tech"]
)
])
for restock in restocks:
print(restock)
Javascript
const starkinfra = require('starkinfra');
(async() => {
let restocks = await starkinfra.issuingRestock.create([{
count: 100,
stockId: '5715709195239424',
tags: ['department: tech']
}]);
for (let restock of restocks) {
console.log(restock);
}
})();
PHP
$restocks = StarkInfra\IssuingRestock::create([
new StarkInfra\IssuingRestock([
"count" => 100,
"stockId" => "5715709195239424",
"tags" => ["department: tech"]
])
]);
foreach ($restocks as $restock) {
print_r($restock);
}
Java
import com.starkinfra.*; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; Mapdata = new HashMap<>(); data.put("count", 100); data.put("stockId", "5715709195239424"); data.put("tags", new String[]{"department: tech"}); List restocks = IssuingRestock.create( new ArrayList () {{ add(new IssuingRestock(data)); }} ); for (IssuingRestock restock : restocks) { System.out.println(restock); }
Ruby
require('starkinfra')
restocks = StarkInfra::IssuingRestock.create([
StarkInfra::IssuingRestock.new(
count: 100,
stock_id: "5715709195239424",
tags: ["department: tech"]
)
])
restocks.each do |restock|
puts restock
end
Elixir
restocks = StarkInfra.IssuingRestock.create!([
%StarkInfra.IssuingRestock{
count: 100,
stock_id: "5715709195239424",
tags: ["department: tech"]
}
])
restocks |> Enum.each(&IO.inspect/1)
C#
using System; using System.Collections.Generic; Listrestocks = StarkInfra.IssuingRestock.Create( new List { new StarkInfra.IssuingRestock( count: 100, stockID: "5715709195239424", tags: new List { "department: tech" } ) } ); foreach (StarkInfra.IssuingRestock restock in restocks) { Console.WriteLine(restock); }
Go
package main
import (
"fmt"
"github.com/starkinfra/sdk-go/starkinfra/issuingrestock"
)
func main() {
restocks, err := issuingrestock.Create(
[]issuingrestock.IssuingRestock{
{
Count: 100,
StockId: "5715709195239424",
Tags: []string{"department: tech"},
},
},
nil,
)
if err.Errors != nil {
for _, e := range err.Errors {
fmt.Printf("code: %s, message: %s", e.Code, e.Message)
}
}
for _, restock := range restocks {
fmt.Printf("%+v", restock)
}
}
Clojure
Not yet available. Please contact us if you need this SDK.
Curl
curl --location --request POST '{{baseUrl}}/v2/issuing-restock' \
--header 'Access-Id: {{accessId}}' \
--header 'Access-Time: {{accessTime}}' \
--header 'Access-Signature: {{accessSignature}}' \
--header 'Content-Type: application/json' \
--data-raw '{
"restocks": [
{
"count": 100,
"stockId": "5715709195239424",
"tags": ["department: tech"]
}
]
}'
Python
IssuingRestock(
id=6724771005489152,
count=100,
stock_id=5715709195239424,
status=created,
tags=['department: tech'],
created=2022-01-01 00:00:00,
updated=2022-01-01 00:00:00
)
Javascript
IssuingRestock {
id: '6724771005489152',
count: 100,
stockId: '5715709195239424',
status: 'created',
tags: [ 'department: tech' ],
created: '2022-01-01T00:00:00.000000+00:00',
updated: '2022-01-01T00:00:00.000000+00:00'
}
PHP
StarkInfra\IssuingRestock Object
(
[id] => 6724771005489152
[count] => 100
[stockId] => 5715709195239424
[status] => created
[tags] => Array ( [0] => department: tech )
[created] => DateTime Object ( [date] => 2022-01-01 00:00:00.000000 )
[updated] => DateTime Object ( [date] => 2022-01-01 00:00:00.000000 )
)
Java
IssuingRestock({
"id": "6724771005489152",
"count": 100,
"stockId": "5715709195239424",
"status": "created",
"tags": ["department: tech"],
"created": "2022-01-01T00:00:00.000000+00:00",
"updated": "2022-01-01T00:00:00.000000+00:00"
})
Ruby
issuingrestock(
id: 6724771005489152,
count: 100,
stock_id: 5715709195239424,
status: created,
tags: ["department: tech"],
created: 2022-01-01T00:00:00+00:00,
updated: 2022-01-01T00:00:00+00:00
)
Elixir
%StarkInfra.IssuingRestock{
id: "6724771005489152",
count: 100,
stock_id: "5715709195239424",
status: "created",
tags: ["department: tech"],
created: "2022-01-01T00:00:00.000000+00:00",
updated: "2022-01-01T00:00:00.000000+00:00"
}
C#
IssuingRestock(
Id: 6724771005489152,
Count: 100,
StockId: 5715709195239424,
Status: created,
Tags: [department: tech],
Created: 01/01/2022 00:00:00,
Updated: 01/01/2022 00:00:00
)
Go
{
Count:100
StockId:5715709195239424
Tags:[department: tech]
Id:6724771005489152
Status:created
Updated:2022-01-01 00:00:00 +0000 +0000
Created:2022-01-01 00:00:00 +0000 +0000
}
Clojure
Not yet available. Please contact us if you need this SDK.
Curl
{
"message": "Restock(s) successfully created.",
"restocks": [
{
"id": "6724771005489152",
"count": 100,
"stockId": "5715709195239424",
"status": "created",
"tags": ["department: tech"],
"created": "2022-01-01T00:00:00.000000+00:00",
"updated": "2022-01-01T00:00:00.000000+00:00"
}
]
}
Querying Restocks
List your restocks in pages of up to 100. Narrow the results with "status", "stockIds", "ids", "tags" and the "after" / "before" date filters.
For example, filter by "status=created" to find orders still awaiting fulfillment, or by a "stockIds" value to see every restock placed against a given stock.
Parameters
Python
import starkinfra
restocks = starkinfra.issuingrestock.query(status="created")
for restock in restocks:
print(restock)
Javascript
const starkinfra = require('starkinfra');
(async() => {
let restocks = await starkinfra.issuingRestock.query({ status: 'created' });
for await (let restock of restocks) {
console.log(restock);
}
})();
PHP
$restocks = StarkInfra\IssuingRestock::query(["status" => "created"]);
foreach ($restocks as $restock) {
print_r($restock);
}
Java
import com.starkinfra.*; import java.util.HashMap; HashMapparams = new HashMap<>(); params.put("status", "created"); Generator restocks = IssuingRestock.query(params); for (IssuingRestock restock : restocks) { System.out.println(restock); }
Ruby
require('starkinfra')
restocks = StarkInfra::IssuingRestock.query(status: "created")
restocks.each do |restock|
puts restock
end
Elixir
restocks = StarkInfra.IssuingRestock.query!(status: "created") restocks |> Enum.each(&IO.inspect/1)
C#
using System; using System.Collections.Generic; IEnumerablerestocks = StarkInfra.IssuingRestock.Query(status: "created"); foreach (StarkInfra.IssuingRestock restock in restocks) { Console.WriteLine(restock); }
Go
package main
import (
"fmt"
"github.com/starkinfra/sdk-go/starkinfra/issuingrestock"
)
func main() {
var params = map[string]interface{}{}
params["status"] = "created"
restocks, errorChannel := issuingrestock.Query(params, nil)
for restock := range restocks {
fmt.Printf("%+v", restock)
}
for err := range errorChannel {
fmt.Println(err)
}
}
Clojure
Not yet available. Please contact us if you need this SDK.
Curl
curl --location --request GET '{{baseUrl}}/v2/issuing-restock?status=created' \
--header 'Access-Id: {{accessId}}' \
--header 'Access-Time: {{accessTime}}' \
--header 'Access-Signature: {{accessSignature}}'
Python
IssuingRestock(
id=6724771005489152,
count=100,
stock_id=5715709195239424,
status=created,
tags=['department: tech'],
created=2022-01-01 00:00:00,
updated=2022-01-01 00:00:00
)
Javascript
IssuingRestock {
id: '6724771005489152',
count: 100,
stockId: '5715709195239424',
status: 'created',
tags: [ 'department: tech' ],
created: '2022-01-01T00:00:00.000000+00:00',
updated: '2022-01-01T00:00:00.000000+00:00'
}
PHP
StarkInfra\IssuingRestock Object
(
[id] => 6724771005489152
[count] => 100
[stockId] => 5715709195239424
[status] => created
[tags] => Array ( [0] => department: tech )
[created] => DateTime Object ( [date] => 2022-01-01 00:00:00.000000 )
[updated] => DateTime Object ( [date] => 2022-01-01 00:00:00.000000 )
)
Java
IssuingRestock({
"id": "6724771005489152",
"count": 100,
"stockId": "5715709195239424",
"status": "created",
"tags": ["department: tech"],
"created": "2022-01-01T00:00:00.000000+00:00",
"updated": "2022-01-01T00:00:00.000000+00:00"
})
Ruby
issuingrestock(
id: 6724771005489152,
count: 100,
stock_id: 5715709195239424,
status: created,
tags: ["department: tech"],
created: 2022-01-01T00:00:00+00:00,
updated: 2022-01-01T00:00:00+00:00
)
Elixir
%StarkInfra.IssuingRestock{
id: "6724771005489152",
count: 100,
stock_id: "5715709195239424",
status: "created",
tags: ["department: tech"],
created: "2022-01-01T00:00:00.000000+00:00",
updated: "2022-01-01T00:00:00.000000+00:00"
}
C#
IssuingRestock(
Id: 6724771005489152,
Count: 100,
StockId: 5715709195239424,
Status: created,
Tags: [department: tech],
Created: 01/01/2022 00:00:00,
Updated: 01/01/2022 00:00:00
)
Go
{
Count:100
StockId:5715709195239424
Tags:[department: tech]
Id:6724771005489152
Status:created
Updated:2022-01-01 00:00:00 +0000 +0000
Created:2022-01-01 00:00:00 +0000 +0000
}
Clojure
Not yet available. Please contact us if you need this SDK.
Curl
{
"cursor": null,
"restocks": [
{
"id": "6724771005489152",
"count": 100,
"stockId": "5715709195239424",
"status": "created",
"tags": ["department: tech"],
"created": "2022-01-01T00:00:00.000000+00:00",
"updated": "2022-01-01T00:00:00.000000+00:00"
}
]
}
Getting a Restock
Fetch a single restock by its id to check its current status and count.
Parameters
Python
import starkinfra
restock = starkinfra.issuingrestock.get("6724771005489152")
print(restock)
Javascript
const starkinfra = require('starkinfra');
(async() => {
let restock = await starkinfra.issuingRestock.get('6724771005489152');
console.log(restock);
})();
PHP
$restock = StarkInfra\IssuingRestock::get("6724771005489152");
print_r($restock);
Java
import com.starkinfra.*;
IssuingRestock restock = IssuingRestock.get("6724771005489152");
System.out.println(restock);
Ruby
require('starkinfra')
restock = StarkInfra::IssuingRestock.get("6724771005489152")
puts restock
Elixir
restock = StarkInfra.IssuingRestock.get!("6724771005489152")
IO.inspect(restock)
C#
using System;
StarkInfra.IssuingRestock restock = StarkInfra.IssuingRestock.Get("6724771005489152");
Console.WriteLine(restock);
Go
package main
import (
"fmt"
"github.com/starkinfra/sdk-go/starkinfra/issuingrestock"
)
func main() {
restock, err := issuingrestock.Get("6724771005489152", nil)
if err.Errors != nil {
for _, e := range err.Errors {
fmt.Printf("code: %s, message: %s", e.Code, e.Message)
}
}
fmt.Printf("%+v", restock)
}
Clojure
Not yet available. Please contact us if you need this SDK.
Curl
curl --location --request GET '{{baseUrl}}/v2/issuing-restock/6724771005489152' \
--header 'Access-Id: {{accessId}}' \
--header 'Access-Time: {{accessTime}}' \
--header 'Access-Signature: {{accessSignature}}'
Python
IssuingRestock(
id=6724771005489152,
count=100,
stock_id=5715709195239424,
status=confirmed,
tags=['department: tech'],
created=2022-01-01 00:00:00,
updated=2022-06-01 00:00:00
)
Javascript
IssuingRestock {
id: '6724771005489152',
count: 100,
stockId: '5715709195239424',
status: 'confirmed',
tags: [ 'department: tech' ],
created: '2022-01-01T00:00:00.000000+00:00',
updated: '2022-06-01T00:00:00.000000+00:00'
}
PHP
StarkInfra\IssuingRestock Object
(
[id] => 6724771005489152
[count] => 100
[stockId] => 5715709195239424
[status] => confirmed
[tags] => Array ( [0] => department: tech )
[created] => DateTime Object ( [date] => 2022-01-01 00:00:00.000000 )
[updated] => DateTime Object ( [date] => 2022-06-01 00:00:00.000000 )
)
Java
IssuingRestock({
"id": "6724771005489152",
"count": 100,
"stockId": "5715709195239424",
"status": "confirmed",
"tags": ["department: tech"],
"created": "2022-01-01T00:00:00.000000+00:00",
"updated": "2022-06-01T00:00:00.000000+00:00"
})
Ruby
issuingrestock(
id: 6724771005489152,
count: 100,
stock_id: 5715709195239424,
status: confirmed,
tags: ["department: tech"],
created: 2022-01-01T00:00:00+00:00,
updated: 2022-06-01T00:00:00+00:00
)
Elixir
%StarkInfra.IssuingRestock{
id: "6724771005489152",
count: 100,
stock_id: "5715709195239424",
status: "confirmed",
tags: ["department: tech"],
created: "2022-01-01T00:00:00.000000+00:00",
updated: "2022-06-01T00:00:00.000000+00:00"
}
C#
IssuingRestock(
Id: 6724771005489152,
Count: 100,
StockId: 5715709195239424,
Status: confirmed,
Tags: [department: tech],
Created: 01/01/2022 00:00:00,
Updated: 01/06/2022 00:00:00
)
Go
{
Count:100
StockId:5715709195239424
Tags:[department: tech]
Id:6724771005489152
Status:confirmed
Updated:2022-06-01 00:00:00 +0000 +0000
Created:2022-01-01 00:00:00 +0000 +0000
}
Clojure
Not yet available. Please contact us if you need this SDK.
Curl
{
"restock": {
"id": "6724771005489152",
"count": 100,
"stockId": "5715709195239424",
"status": "confirmed",
"tags": ["department: tech"],
"created": "2022-01-01T00:00:00.000000+00:00",
"updated": "2022-06-01T00:00:00.000000+00:00"
}
}
Getting a Restock's Logs
Follow an order's fulfillment by querying its logs with the "restockIds" filter. A restock that was created, then processed, then confirmed returns one log per step.
You can also filter by "types" (created, processing, confirmed) and "after" / "before", or fetch a single log with GET /v2/issuing-restock/log/:id.
Parameters
Python
import starkinfra
logs = starkinfra.issuingrestock.log.query(restock_ids=["6724771005489152"])
for log in logs:
print(log)
Javascript
const starkinfra = require('starkinfra');
(async() => {
let logs = await starkinfra.issuingRestock.log.query({ restockIds: ['6724771005489152'] });
for await (let log of logs) {
console.log(log);
}
})();
PHP
$logs = StarkInfra\IssuingRestock\Log::query(["restockIds" => ["6724771005489152"]]);
foreach ($logs as $log) {
print_r($log);
}
Java
import com.starkinfra.*; import java.util.HashMap; HashMapparams = new HashMap<>(); params.put("restockIds", new String[]{"6724771005489152"}); Generator logs = IssuingRestock.Log.query(params); for (IssuingRestock.Log log : logs) { System.out.println(log); }
Ruby
require('starkinfra')
logs = StarkInfra::IssuingRestock::Log.query(restock_ids: ["6724771005489152"])
logs.each do |log|
puts log
end
Elixir
logs = StarkInfra.IssuingRestock.Log.query!(restock_ids: ["6724771005489152"]) logs |> Enum.each(&IO.inspect/1)
C#
using System; using System.Collections.Generic; IEnumerablelogs = StarkInfra.IssuingRestock.Log.Query( restockIds: new List { "6724771005489152" } ); foreach (StarkInfra.IssuingRestock.Log log in logs) { Console.WriteLine(log); }
Go
package main
import (
"fmt"
"github.com/starkinfra/sdk-go/starkinfra/issuingrestock/log"
)
func main() {
var params = map[string]interface{}{}
params["restockIds"] = []string{"6724771005489152"}
logs, errorChannel := log.Query(params, nil)
for log := range logs {
fmt.Printf("%+v", log)
}
for err := range errorChannel {
fmt.Println(err)
}
}
Clojure
Not yet available. Please contact us if you need this SDK.
Curl
curl --location --request GET '{{baseUrl}}/v2/issuing-restock/log?restockIds=6724771005489152' \
--header 'Access-Id: {{accessId}}' \
--header 'Access-Time: {{accessTime}}' \
--header 'Access-Signature: {{accessSignature}}'
Python
Log(
id=7834882116598271,
type=created,
restock=IssuingRestock(id=6724771005489152, status=created, ...),
created=2022-01-01 00:00:00
)
Log(
id=5189683645874176,
type=processing,
restock=IssuingRestock(id=6724771005489152, status=processing, ...),
created=2022-03-01 00:00:00
)
Log(
id=6284441486065664,
type=confirmed,
restock=IssuingRestock(id=6724771005489152, status=confirmed, ...),
created=2022-06-01 00:00:00
)
Javascript
Log {
id: '7834882116598271',
type: 'created',
restock: IssuingRestock { id: '6724771005489152', status: 'created', ... },
created: '2022-01-01T00:00:00.000000+00:00'
}
Log {
id: '5189683645874176',
type: 'processing',
restock: IssuingRestock { id: '6724771005489152', status: 'processing', ... },
created: '2022-03-01T00:00:00.000000+00:00'
}
Log {
id: '6284441486065664',
type: 'confirmed',
restock: IssuingRestock { id: '6724771005489152', status: 'confirmed', ... },
created: '2022-06-01T00:00:00.000000+00:00'
}
PHP
StarkInfra\IssuingRestock\Log Object
(
[id] => 7834882116598271
[type] => created
[restock] => StarkInfra\IssuingRestock Object ( [id] => 6724771005489152 [status] => created ... )
[created] => DateTime Object ( [date] => 2022-01-01 00:00:00.000000 )
)
StarkInfra\IssuingRestock\Log Object
(
[id] => 5189683645874176
[type] => processing
[restock] => StarkInfra\IssuingRestock Object ( [id] => 6724771005489152 [status] => processing ... )
[created] => DateTime Object ( [date] => 2022-03-01 00:00:00.000000 )
)
StarkInfra\IssuingRestock\Log Object
(
[id] => 6284441486065664
[type] => confirmed
[restock] => StarkInfra\IssuingRestock Object ( [id] => 6724771005489152 [status] => confirmed ... )
[created] => DateTime Object ( [date] => 2022-06-01 00:00:00.000000 )
)
Java
IssuingRestock.Log({
"id": "7834882116598271",
"type": "created",
"restock": {"id": "6724771005489152", "status": "created", ...},
"created": "2022-01-01T00:00:00.000000+00:00"
})
IssuingRestock.Log({
"id": "5189683645874176",
"type": "processing",
"restock": {"id": "6724771005489152", "status": "processing", ...},
"created": "2022-03-01T00:00:00.000000+00:00"
})
IssuingRestock.Log({
"id": "6284441486065664",
"type": "confirmed",
"restock": {"id": "6724771005489152", "status": "confirmed", ...},
"created": "2022-06-01T00:00:00.000000+00:00"
})
Ruby
log(
id: 7834882116598271,
type: created,
restock: issuingrestock(id: 6724771005489152, status: created, ...),
created: 2022-01-01T00:00:00+00:00
)
log(
id: 5189683645874176,
type: processing,
restock: issuingrestock(id: 6724771005489152, status: processing, ...),
created: 2022-03-01T00:00:00+00:00
)
log(
id: 6284441486065664,
type: confirmed,
restock: issuingrestock(id: 6724771005489152, status: confirmed, ...),
created: 2022-06-01T00:00:00+00:00
)
Elixir
%StarkInfra.IssuingRestock.Log{
id: "7834882116598271",
type: "created",
restock: %StarkInfra.IssuingRestock{id: "6724771005489152", status: "created", ...},
created: "2022-01-01T00:00:00.000000+00:00"
}
%StarkInfra.IssuingRestock.Log{
id: "5189683645874176",
type: "processing",
restock: %StarkInfra.IssuingRestock{id: "6724771005489152", status: "processing", ...},
created: "2022-03-01T00:00:00.000000+00:00"
}
%StarkInfra.IssuingRestock.Log{
id: "6284441486065664",
type: "confirmed",
restock: %StarkInfra.IssuingRestock{id: "6724771005489152", status: "confirmed", ...},
created: "2022-06-01T00:00:00.000000+00:00"
}
C#
IssuingRestock.Log(
Id: 7834882116598271,
Type: created,
Restock: IssuingRestock(Id: 6724771005489152, Status: created, ...),
Created: 01/01/2022 00:00:00
)
IssuingRestock.Log(
Id: 5189683645874176,
Type: processing,
Restock: IssuingRestock(Id: 6724771005489152, Status: processing, ...),
Created: 01/03/2022 00:00:00
)
IssuingRestock.Log(
Id: 6284441486065664,
Type: confirmed,
Restock: IssuingRestock(Id: 6724771005489152, Status: confirmed, ...),
Created: 01/06/2022 00:00:00
)
Go
{
Id:7834882116598271
Type:created
Restock:{Id:6724771005489152 Status:created ...}
Created:2022-01-01 00:00:00 +0000 +0000
}
{
Id:5189683645874176
Type:processing
Restock:{Id:6724771005489152 Status:processing ...}
Created:2022-03-01 00:00:00 +0000 +0000
}
{
Id:6284441486065664
Type:confirmed
Restock:{Id:6724771005489152 Status:confirmed ...}
Created:2022-06-01 00:00:00 +0000 +0000
}
Clojure
Not yet available. Please contact us if you need this SDK.
Curl
{
"cursor": null,
"logs": [
{
"id": "7834882116598271",
"type": "created",
"restock": {"id": "6724771005489152", "status": "created", ...},
"created": "2022-01-01T00:00:00.000000+00:00"
},
{
"id": "5189683645874176",
"type": "processing",
"restock": {"id": "6724771005489152", "status": "processing", ...},
"created": "2022-03-01T00:00:00.000000+00:00"
},
{
"id": "6284441486065664",
"type": "confirmed",
"restock": {"id": "6724771005489152", "status": "confirmed", ...},
"created": "2022-06-01T00:00:00.000000+00:00"
}
]
}
Issuing Embossing Request Overview
An Issuing Embossing Request is the order to physically produce and ship a physical Issuing Card. After you create a physical card (which starts as "pending"), you submit an embossing request to have it printed, packaged and shipped to the holder.
Prerequisites. You need an existing physical Issuing Card (its cardId), an Issuing Embossing Kit (the kitId — the plastic, packaging and design to print), and available stock for that kit. Once the card reaches the holder, it is activated separately by setting its status to "active" together with a PIN.
Batch. Send a "requests" list to order up to 100 at once. Each request needs the cardId and kitId, the name embossed on the card (displayName1), and the full shipping address plus shippingService (the carrier, e.g. "loggi") and a shippingTrackingNumber. Optional fields: embosserId, displayName2 / displayName3, shippingPhone and tags.
Tracking the shipment. shippingTrackingNumber is the code you use to follow the parcel with the carrier; the request's status and Logs tell you how production and dispatch are progressing.
Embossing Request Statuses
Each Issuing Embossing Request has a status that reflects where its order is in the production and shipping flow:
| Status | Description |
|---|---|
| created | The request was registered and is queued for production. |
| processing | The card is being embossed and prepared for shipping. |
| success | The card was embossed and shipped. |
| failed | The request could not be fulfilled. |
Embossing Request Logs
Every time an embossing request advances through production and dispatch, we create a Log entry, so you can follow an order without polling the request itself. The "request" field in each log is a representation of the Issuing Embossing Request as it was at that point (shown abbreviated with "...").
The log types are: created, sending, sent, success and failed. Query the logs with GET /v2/issuing-embossing-request/log (filter by requestIds, types, after / before), or fetch a single one with GET /v2/issuing-embossing-request/log/:id.
Creating an Embossing Request
Order the physical production and shipping of one or more cards by sending a "requests" list. Each entry needs cardId, kitId, displayName1, the shipping address (shippingStreetLine1, shippingStreetLine2, shippingDistrict, shippingCity, shippingStateCode, shippingZipCode, shippingCountryCode), shippingService and shippingTrackingNumber.
New requests come back with status "created" — they are queued for production, not yet embossed.
Parameters
Python
import starkinfra
requests = starkinfra.issuingembossingrequest.create([
starkinfra.IssuingEmbossingRequest(
card_id="5715709195239424",
kit_id="6724771005489152",
display_name_1="TONY STARK",
shipping_city="Sao Paulo",
shipping_country_code="BRA",
shipping_district="Bela Vista",
shipping_service="loggi",
shipping_state_code="SP",
shipping_street_line_1="Av. Paulista, 1000",
shipping_street_line_2="Apto 101",
shipping_tracking_number="BR1234567890",
shipping_zip_code="01311-000",
tags=["department: tech"]
)
])
for request in requests:
print(request)
Javascript
const starkinfra = require('starkinfra');
(async() => {
let requests = await starkinfra.issuingEmbossingRequest.create([
new starkinfra.IssuingEmbossingRequest({
cardId: '5715709195239424',
kitId: '6724771005489152',
displayName1: 'TONY STARK',
shippingCity: 'Sao Paulo',
shippingCountryCode: 'BRA',
shippingDistrict: 'Bela Vista',
shippingService: 'loggi',
shippingStateCode: 'SP',
shippingStreetLine1: 'Av. Paulista, 1000',
shippingStreetLine2: 'Apto 101',
shippingTrackingNumber: 'BR1234567890',
shippingZipCode: '01311-000',
tags: ['department: tech']
})
]);
for await (let request of requests) {
console.log(request);
}
})();
PHP
$requests = StarkInfra\IssuingEmbossingRequest::create([
new StarkInfra\IssuingEmbossingRequest([
"cardId" => "5715709195239424",
"kitId" => "6724771005489152",
"displayName1" => "TONY STARK",
"shippingCity" => "Sao Paulo",
"shippingCountryCode" => "BRA",
"shippingDistrict" => "Bela Vista",
"shippingService" => "loggi",
"shippingStateCode" => "SP",
"shippingStreetLine1" => "Av. Paulista, 1000",
"shippingStreetLine2" => "Apto 101",
"shippingPhone" => "+5511999999999",
"shippingTrackingNumber" => "BR1234567890",
"shippingZipCode" => "01311-000",
"tags" => ["department: tech"]
])
]);
foreach ($requests as $request) {
print_r($request);
}
Java
import com.starkinfra.*; import java.util.ArrayList; import java.util.HashMap; import java.util.List; Listrequests = new ArrayList<>(); HashMap data = new HashMap<>(); data.put("cardId", "5715709195239424"); data.put("kitId", "6724771005489152"); data.put("displayName1", "TONY STARK"); data.put("shippingCity", "Sao Paulo"); data.put("shippingCountryCode", "BRA"); data.put("shippingDistrict", "Bela Vista"); data.put("shippingService", "loggi"); data.put("shippingStateCode", "SP"); data.put("shippingStreetLine1", "Av. Paulista, 1000"); data.put("shippingStreetLine2", "Apto 101"); data.put("shippingTrackingNumber", "BR1234567890"); data.put("shippingZipCode", "01311-000"); data.put("tags", new String[]{"department: tech"}); requests.add(new IssuingEmbossingRequest(data)); requests = IssuingEmbossingRequest.create(requests); for (IssuingEmbossingRequest request : requests) { System.out.println(request); }
Ruby
require('starkinfra')
requests = StarkInfra::IssuingEmbossingRequest.create([
StarkInfra::IssuingEmbossingRequest.new(
card_id: "5715709195239424",
kit_id: "6724771005489152",
display_name_1: "TONY STARK",
shipping_city: "Sao Paulo",
shipping_country_code: "BRA",
shipping_district: "Bela Vista",
shipping_service: "loggi",
shipping_state_code: "SP",
shipping_street_line_1: "Av. Paulista, 1000",
shipping_street_line_2: "Apto 101",
shipping_tracking_number: "BR1234567890",
shipping_zip_code: "01311-000",
tags: ["department: tech"]
)
])
requests.each do |request|
puts request
end
Elixir
requests = StarkInfra.IssuingEmbossingRequest.create!([
%StarkInfra.IssuingEmbossingRequest{
card_id: "5715709195239424",
kit_id: "6724771005489152",
display_name_1: "TONY STARK",
shipping_city: "Sao Paulo",
shipping_country_code: "BRA",
shipping_district: "Bela Vista",
shipping_service: "loggi",
shipping_state_code: "SP",
shipping_street_line_1: "Av. Paulista, 1000",
shipping_street_line_2: "Apto 101",
shipping_tracking_number: "BR1234567890",
shipping_zip_code: "01311-000",
tags: ["department: tech"]
}
])
requests |> Enum.each(&IO.inspect/1)
C#
using System; using System.Collections.Generic; Listrequests = StarkInfra.IssuingEmbossingRequest.Create( new List { new StarkInfra.IssuingEmbossingRequest( cardID: "5715709195239424", kitID: "6724771005489152", displayName1: "TONY STARK", shippingCity: "Sao Paulo", shippingCountryCode: "BRA", shippingDistrict: "Bela Vista", shippingService: "loggi", shippingStateCode: "SP", shippingStreetLine1: "Av. Paulista, 1000", shippingStreetLine2: "Apto 101", shippingTrackingNumber: "BR1234567890", shippingZipCode: "01311-000", tags: new List { "department: tech" } ) } ); foreach (StarkInfra.IssuingEmbossingRequest request in requests) { Console.WriteLine(request); }
Go
package main
import (
"fmt"
"github.com/starkinfra/sdk-go/starkinfra/issuingembossingrequest"
)
func main() {
requests, err := issuingembossingrequest.Create(
[]issuingembossingrequest.IssuingEmbossingRequest{
{
CardId: "5715709195239424",
KitId: "6724771005489152",
DisplayName1: "TONY STARK",
ShippingCity: "Sao Paulo",
ShippingCountryCode: "BRA",
ShippingDistrict: "Bela Vista",
ShippingService: "loggi",
ShippingStateCode: "SP",
ShippingStreetLine1: "Av. Paulista, 1000",
ShippingStreetLine2: "Apto 101",
ShippingTrackingNumber: "BR1234567890",
ShippingZipCode: "01311-000",
Tags: []string{"department: tech"},
},
},
nil,
)
if err.Errors != nil {
for _, e := range err.Errors {
fmt.Printf("code: %s, message: %s", e.Code, e.Message)
}
}
for _, request := range requests {
fmt.Printf("%+v", request)
}
}
Clojure
Not yet available. Please contact us if you need this SDK.
Curl
curl --location --request POST '{{baseUrl}}/v2/issuing-embossing-request' \
--header 'Access-Id: {{accessId}}' \
--header 'Access-Time: {{accessTime}}' \
--header 'Access-Signature: {{accessSignature}}' \
--header 'Content-Type: application/json' \
--data-raw '{
"requests": [
{
"cardId": "5715709195239424",
"kitId": "6724771005489152",
"displayName1": "TONY STARK",
"shippingCity": "Sao Paulo",
"shippingCountryCode": "BRA",
"shippingDistrict": "Bela Vista",
"shippingService": "loggi",
"shippingStateCode": "SP",
"shippingStreetLine1": "Av. Paulista, 1000",
"shippingStreetLine2": "Apto 101",
"shippingTrackingNumber": "BR1234567890",
"shippingZipCode": "01311-000",
"tags": ["department: tech"]
}
]
}'
Python
IssuingEmbossingRequest(
id=7834882116598271,
card_id=5715709195239424,
kit_id=6724771005489152,
display_name_1=TONY STARK,
display_name_2=None,
display_name_3=None,
shipping_city=Sao Paulo,
shipping_country_code=BRA,
shipping_district=Bela Vista,
shipping_phone=+5511999999999,
shipping_service=loggi,
shipping_state_code=SP,
shipping_street_line_1=Av. Paulista, 1000,
shipping_street_line_2=Apto 101,
shipping_tracking_number=BR1234567890,
shipping_zip_code=01311-000,
embosser_id=5656565656565656,
fee=0,
status=created,
tags=['department: tech'],
created=2022-01-01 00:00:00,
updated=2022-01-01 00:00:00
)
Javascript
IssuingEmbossingRequest {
id: '7834882116598271',
cardId: '5715709195239424',
kitId: '6724771005489152',
displayName1: 'TONY STARK',
displayName2: null,
displayName3: null,
shippingCity: 'Sao Paulo',
shippingCountryCode: 'BRA',
shippingDistrict: 'Bela Vista',
shippingPhone: '+5511999999999',
shippingService: 'loggi',
shippingStateCode: 'SP',
shippingStreetLine1: 'Av. Paulista, 1000',
shippingStreetLine2: 'Apto 101',
shippingTrackingNumber: 'BR1234567890',
shippingZipCode: '01311-000',
embosserId: '5656565656565656',
fee: 0,
status: 'created',
tags: [ 'department: tech' ],
created: '2022-01-01T00:00:00.000000+00:00',
updated: '2022-01-01T00:00:00.000000+00:00'
}
PHP
StarkInfra\IssuingEmbossingRequest Object
(
[id] => 7834882116598271
[fee] => 0
[cardId] => 5715709195239424
[embosserId] => 5656565656565656
[kitId] => 6724771005489152
[displayName1] => TONY STARK
[displayName2] =>
[displayName3] =>
[shippingCity] => Sao Paulo
[shippingCountryCode] => BRA
[shippingDistrict] => Bela Vista
[shippingPhone] => +5511999999999
[shippingService] => loggi
[shippingStateCode] => SP
[shippingStreetLine1] => Av. Paulista, 1000
[shippingStreetLine2] => Apto 101
[shippingTrackingNumber] => BR1234567890
[shippingZipCode] => 01311-000
[status] => created
[tags] => Array ( [0] => department: tech )
[created] => DateTime Object ( [date] => 2022-01-01 00:00:00.000000 )
[updated] => DateTime Object ( [date] => 2022-01-01 00:00:00.000000 )
)
Java
IssuingEmbossingRequest({
"id": "7834882116598271",
"fee": 0,
"cardId": "5715709195239424",
"embosserId": "5656565656565656",
"kitId": "6724771005489152",
"displayName1": "TONY STARK",
"displayName2": null,
"displayName3": null,
"shippingCity": "Sao Paulo",
"shippingCountryCode": "BRA",
"shippingDistrict": "Bela Vista",
"shippingPhone": "+5511999999999",
"shippingService": "loggi",
"shippingStateCode": "SP",
"shippingStreetLine1": "Av. Paulista, 1000",
"shippingStreetLine2": "Apto 101",
"shippingTrackingNumber": "BR1234567890",
"shippingZipCode": "01311-000",
"status": "created",
"tags": ["department: tech"],
"created": "2022-01-01T00:00:00.000000+00:00",
"updated": "2022-01-01T00:00:00.000000+00:00"
})
Ruby
issuingembossingrequest(
id: 7834882116598271,
card_id: 5715709195239424,
kit_id: 6724771005489152,
display_name_1: TONY STARK,
display_name_2: nil,
display_name_3: nil,
shipping_city: Sao Paulo,
shipping_country_code: BRA,
shipping_district: Bela Vista,
shipping_phone: +5511999999999,
shipping_service: loggi,
shipping_state_code: SP,
shipping_street_line_1: Av. Paulista, 1000,
shipping_street_line_2: Apto 101,
shipping_tracking_number: BR1234567890,
shipping_zip_code: 01311-000,
embosser_id: 5656565656565656,
fee: 0,
status: created,
tags: ["department: tech"],
created: 2022-01-01T00:00:00+00:00,
updated: 2022-01-01T00:00:00+00:00
)
Elixir
%StarkInfra.IssuingEmbossingRequest{
id: "7834882116598271",
fee: 0,
card_id: "5715709195239424",
embosser_id: "5656565656565656",
kit_id: "6724771005489152",
display_name_1: "TONY STARK",
display_name_2: nil,
display_name_3: nil,
shipping_city: "Sao Paulo",
shipping_country_code: "BRA",
shipping_district: "Bela Vista",
shipping_phone: "+5511999999999",
shipping_service: "loggi",
shipping_state_code: "SP",
shipping_street_line_1: "Av. Paulista, 1000",
shipping_street_line_2: "Apto 101",
shipping_tracking_number: "BR1234567890",
shipping_zip_code: "01311-000",
status: "created",
tags: ["department: tech"],
created: "2022-01-01T00:00:00.000000+00:00",
updated: "2022-01-01T00:00:00.000000+00:00"
}
C#
IssuingEmbossingRequest(
Id: 7834882116598271,
Fee: 0,
CardId: 5715709195239424,
EmbosserId: 5656565656565656,
KitId: 6724771005489152,
DisplayName1: TONY STARK,
DisplayName2: ,
DisplayName3: ,
ShippingCity: Sao Paulo,
ShippingCountryCode: BRA,
ShippingDistrict: Bela Vista,
ShippingPhone: +5511999999999,
ShippingService: loggi,
ShippingStateCode: SP,
ShippingStreetLine1: Av. Paulista, 1000,
ShippingStreetLine2: Apto 101,
ShippingTrackingNumber: BR1234567890,
ShippingZipCode: 01311-000,
Status: created,
Tags: [department: tech],
Created: 01/01/2022 00:00:00,
Updated: 01/01/2022 00:00:00
)
Go
{
CardId:5715709195239424
KitId:6724771005489152
DisplayName1:TONY STARK
DisplayName2:
DisplayName3:
ShippingCity:Sao Paulo
ShippingCountryCode:BRA
ShippingDistrict:Bela Vista
ShippingStateCode:SP
ShippingStreetLine1:Av. Paulista, 1000
ShippingStreetLine2:Apto 101
ShippingService:loggi
ShippingTrackingNumber:BR1234567890
ShippingZipCode:01311-000
EmbosserId:5656565656565656
ShippingPhone:+5511999999999
Tags:[department: tech]
Id:7834882116598271
Fee:0
Status:created
Updated:2022-01-01 00:00:00 +0000 +0000
Created:2022-01-01 00:00:00 +0000 +0000
}
Clojure
Not yet available. Please contact us if you need this SDK.
Curl
{
"requests": [
{
"id": "7834882116598271",
"fee": 0,
"cardId": "5715709195239424",
"embosserId": "5656565656565656",
"kitId": "6724771005489152",
"displayName1": "TONY STARK",
"displayName2": null,
"displayName3": null,
"shippingCity": "Sao Paulo",
"shippingCountryCode": "BRA",
"shippingDistrict": "Bela Vista",
"shippingPhone": "+5511999999999",
"shippingService": "loggi",
"shippingStateCode": "SP",
"shippingStreetLine1": "Av. Paulista, 1000",
"shippingStreetLine2": "Apto 101",
"shippingTrackingNumber": "BR1234567890",
"shippingZipCode": "01311-000",
"status": "created",
"tags": ["department: tech"],
"created": "2022-01-01T00:00:00.000000+00:00",
"updated": "2022-01-01T00:00:00.000000+00:00"
}
]
}
Querying Embossing Requests
List your embossing requests in pages of up to 100. Filter by "status", "cardIds", "ids", "tags" and "after" / "before". Page through results with the returned "cursor".
Parameters
Python
import starkinfra
requests = starkinfra.issuingembossingrequest.query(
limit=10,
status="processing"
)
for request in requests:
print(request)
Javascript
const starkinfra = require('starkinfra');
(async() => {
let requests = await starkinfra.issuingEmbossingRequest.query({
limit: 10,
status: 'processing'
});
for await (let request of requests) {
console.log(request);
}
})();
PHP
$requests = StarkInfra\IssuingEmbossingRequest::query([
"limit" => 10,
"status" => "processing"
]);
foreach ($requests as $request) {
print_r($request);
}
Java
import com.starkinfra.*; import java.util.HashMap; HashMapparams = new HashMap<>(); params.put("limit", 10); params.put("status", "processing"); Generator requests = IssuingEmbossingRequest.query(params); for (IssuingEmbossingRequest request : requests) { System.out.println(request); }
Ruby
require('starkinfra')
requests = StarkInfra::IssuingEmbossingRequest.query(
limit: 10,
status: "processing"
)
requests.each do |request|
puts request
end
Elixir
requests = StarkInfra.IssuingEmbossingRequest.query!(
limit: 10,
status: "processing"
)
requests |> Enum.each(&IO.inspect/1)
C#
using System; using System.Collections.Generic; IEnumerablerequests = StarkInfra.IssuingEmbossingRequest.Query( limit: 10, status: "processing" ); foreach (StarkInfra.IssuingEmbossingRequest request in requests) { Console.WriteLine(request); }
Go
package main
import (
"fmt"
"github.com/starkinfra/sdk-go/starkinfra/issuingembossingrequest"
)
func main() {
var params = map[string]interface{}{}
params["limit"] = 10
params["status"] = "processing"
requests, errorChannel := issuingembossingrequest.Query(params, nil)
for request := range requests {
fmt.Printf("%+v", request)
}
for err := range errorChannel {
fmt.Printf("%+v", err)
}
}
Clojure
Not yet available. Please contact us if you need this SDK.
Curl
curl --location --request GET '{{baseUrl}}/v2/issuing-embossing-request?limit=10&status=processing' \
--header 'Access-Id: {{accessId}}' \
--header 'Access-Time: {{accessTime}}' \
--header 'Access-Signature: {{accessSignature}}'
Python
IssuingEmbossingRequest(
id=7834882116598271,
card_id=5715709195239424,
kit_id=6724771005489152,
display_name_1=TONY STARK,
display_name_2=None,
display_name_3=None,
shipping_city=Sao Paulo,
shipping_country_code=BRA,
shipping_district=Bela Vista,
shipping_phone=+5511999999999,
shipping_service=loggi,
shipping_state_code=SP,
shipping_street_line_1=Av. Paulista, 1000,
shipping_street_line_2=Apto 101,
shipping_tracking_number=BR1234567890,
shipping_zip_code=01311-000,
embosser_id=5656565656565656,
fee=0,
status=processing,
tags=['department: tech'],
created=2022-01-01 00:00:00,
updated=2022-01-01 00:00:00
)
Javascript
IssuingEmbossingRequest {
id: '7834882116598271',
cardId: '5715709195239424',
kitId: '6724771005489152',
displayName1: 'TONY STARK',
displayName2: null,
displayName3: null,
shippingCity: 'Sao Paulo',
shippingCountryCode: 'BRA',
shippingDistrict: 'Bela Vista',
shippingPhone: '+5511999999999',
shippingService: 'loggi',
shippingStateCode: 'SP',
shippingStreetLine1: 'Av. Paulista, 1000',
shippingStreetLine2: 'Apto 101',
shippingTrackingNumber: 'BR1234567890',
shippingZipCode: '01311-000',
embosserId: '5656565656565656',
fee: 0,
status: 'processing',
tags: [ 'department: tech' ],
created: '2022-01-01T00:00:00.000000+00:00',
updated: '2022-01-01T00:00:00.000000+00:00'
}
PHP
StarkInfra\IssuingEmbossingRequest Object
(
[id] => 7834882116598271
[fee] => 0
[cardId] => 5715709195239424
[embosserId] => 5656565656565656
[kitId] => 6724771005489152
[displayName1] => TONY STARK
[displayName2] =>
[displayName3] =>
[shippingCity] => Sao Paulo
[shippingCountryCode] => BRA
[shippingDistrict] => Bela Vista
[shippingPhone] => +5511999999999
[shippingService] => loggi
[shippingStateCode] => SP
[shippingStreetLine1] => Av. Paulista, 1000
[shippingStreetLine2] => Apto 101
[shippingTrackingNumber] => BR1234567890
[shippingZipCode] => 01311-000
[status] => processing
[tags] => Array ( [0] => department: tech )
[created] => DateTime Object ( [date] => 2022-01-01 00:00:00.000000 )
[updated] => DateTime Object ( [date] => 2022-01-01 00:00:00.000000 )
)
Java
IssuingEmbossingRequest({
"id": "7834882116598271",
"fee": 0,
"cardId": "5715709195239424",
"embosserId": "5656565656565656",
"kitId": "6724771005489152",
"displayName1": "TONY STARK",
"displayName2": null,
"displayName3": null,
"shippingCity": "Sao Paulo",
"shippingCountryCode": "BRA",
"shippingDistrict": "Bela Vista",
"shippingPhone": "+5511999999999",
"shippingService": "loggi",
"shippingStateCode": "SP",
"shippingStreetLine1": "Av. Paulista, 1000",
"shippingStreetLine2": "Apto 101",
"shippingTrackingNumber": "BR1234567890",
"shippingZipCode": "01311-000",
"status": "processing",
"tags": ["department: tech"],
"created": "2022-01-01T00:00:00.000000+00:00",
"updated": "2022-01-01T00:00:00.000000+00:00"
})
Ruby
issuingembossingrequest(
id: 7834882116598271,
card_id: 5715709195239424,
kit_id: 6724771005489152,
display_name_1: TONY STARK,
display_name_2: nil,
display_name_3: nil,
shipping_city: Sao Paulo,
shipping_country_code: BRA,
shipping_district: Bela Vista,
shipping_phone: +5511999999999,
shipping_service: loggi,
shipping_state_code: SP,
shipping_street_line_1: Av. Paulista, 1000,
shipping_street_line_2: Apto 101,
shipping_tracking_number: BR1234567890,
shipping_zip_code: 01311-000,
embosser_id: 5656565656565656,
fee: 0,
status: processing,
tags: ["department: tech"],
created: 2022-01-01T00:00:00+00:00,
updated: 2022-01-01T00:00:00+00:00
)
Elixir
%StarkInfra.IssuingEmbossingRequest{
id: "7834882116598271",
fee: 0,
card_id: "5715709195239424",
embosser_id: "5656565656565656",
kit_id: "6724771005489152",
display_name_1: "TONY STARK",
display_name_2: nil,
display_name_3: nil,
shipping_city: "Sao Paulo",
shipping_country_code: "BRA",
shipping_district: "Bela Vista",
shipping_phone: "+5511999999999",
shipping_service: "loggi",
shipping_state_code: "SP",
shipping_street_line_1: "Av. Paulista, 1000",
shipping_street_line_2: "Apto 101",
shipping_tracking_number: "BR1234567890",
shipping_zip_code: "01311-000",
status: "processing",
tags: ["department: tech"],
created: "2022-01-01T00:00:00.000000+00:00",
updated: "2022-01-01T00:00:00.000000+00:00"
}
C#
IssuingEmbossingRequest(
Id: 7834882116598271,
Fee: 0,
CardId: 5715709195239424,
EmbosserId: 5656565656565656,
KitId: 6724771005489152,
DisplayName1: TONY STARK,
DisplayName2: ,
DisplayName3: ,
ShippingCity: Sao Paulo,
ShippingCountryCode: BRA,
ShippingDistrict: Bela Vista,
ShippingPhone: +5511999999999,
ShippingService: loggi,
ShippingStateCode: SP,
ShippingStreetLine1: Av. Paulista, 1000,
ShippingStreetLine2: Apto 101,
ShippingTrackingNumber: BR1234567890,
ShippingZipCode: 01311-000,
Status: processing,
Tags: [department: tech],
Created: 01/01/2022 00:00:00,
Updated: 01/01/2022 00:00:00
)
Go
{
CardId:5715709195239424
KitId:6724771005489152
DisplayName1:TONY STARK
DisplayName2:
DisplayName3:
ShippingCity:Sao Paulo
ShippingCountryCode:BRA
ShippingDistrict:Bela Vista
ShippingStateCode:SP
ShippingStreetLine1:Av. Paulista, 1000
ShippingStreetLine2:Apto 101
ShippingService:loggi
ShippingTrackingNumber:BR1234567890
ShippingZipCode:01311-000
EmbosserId:5656565656565656
ShippingPhone:+5511999999999
Tags:[department: tech]
Id:7834882116598271
Fee:0
Status:processing
Updated:2022-01-01 00:00:00 +0000 +0000
Created:2022-01-01 00:00:00 +0000 +0000
}
Clojure
Not yet available. Please contact us if you need this SDK.
Curl
{
"cursor": null,
"requests": [
{
"id": "7834882116598271",
"fee": 0,
"cardId": "5715709195239424",
"embosserId": "5656565656565656",
"kitId": "6724771005489152",
"displayName1": "TONY STARK",
"displayName2": null,
"displayName3": null,
"shippingCity": "Sao Paulo",
"shippingCountryCode": "BRA",
"shippingDistrict": "Bela Vista",
"shippingPhone": "+5511999999999",
"shippingService": "loggi",
"shippingStateCode": "SP",
"shippingStreetLine1": "Av. Paulista, 1000",
"shippingStreetLine2": "Apto 101",
"shippingTrackingNumber": "BR1234567890",
"shippingZipCode": "01311-000",
"status": "processing",
"tags": ["department: tech"],
"created": "2022-01-01T00:00:00.000000+00:00",
"updated": "2022-01-01T00:00:00.000000+00:00"
}
]
}
Getting an Embossing Request
Fetch a single embossing request by its id to check its current status and shipping details.
Parameters
Python
import starkinfra
request = starkinfra.issuingembossingrequest.get("7834882116598271")
print(request)
Javascript
const starkinfra = require('starkinfra');
(async() => {
let request = await starkinfra.issuingEmbossingRequest.get('7834882116598271');
console.log(request);
})();
PHP
$request = StarkInfra\IssuingEmbossingRequest::get("7834882116598271");
print_r($request);
Java
import com.starkinfra.*;
IssuingEmbossingRequest request = IssuingEmbossingRequest.get("7834882116598271");
System.out.println(request);
Ruby
require('starkinfra')
request = StarkInfra::IssuingEmbossingRequest.get("7834882116598271")
puts request
Elixir
request = StarkInfra.IssuingEmbossingRequest.get!("7834882116598271")
IO.inspect(request)
C#
using System;
StarkInfra.IssuingEmbossingRequest request = StarkInfra.IssuingEmbossingRequest.Get("7834882116598271");
Console.WriteLine(request);
Go
package main
import (
"fmt"
"github.com/starkinfra/sdk-go/starkinfra/issuingembossingrequest"
)
func main() {
request, err := issuingembossingrequest.Get("7834882116598271", nil)
if err.Errors != nil {
for _, e := range err.Errors {
fmt.Printf("code: %s, message: %s", e.Code, e.Message)
}
}
fmt.Printf("%+v", request)
}
Clojure
Not yet available. Please contact us if you need this SDK.
Curl
curl --location --request GET '{{baseUrl}}/v2/issuing-embossing-request/7834882116598271' \
--header 'Access-Id: {{accessId}}' \
--header 'Access-Time: {{accessTime}}' \
--header 'Access-Signature: {{accessSignature}}'
Python
IssuingEmbossingRequest(
id=7834882116598271,
card_id=5715709195239424,
kit_id=6724771005489152,
display_name_1=TONY STARK,
display_name_2=None,
display_name_3=None,
shipping_city=Sao Paulo,
shipping_country_code=BRA,
shipping_district=Bela Vista,
shipping_phone=+5511999999999,
shipping_service=loggi,
shipping_state_code=SP,
shipping_street_line_1=Av. Paulista, 1000,
shipping_street_line_2=Apto 101,
shipping_tracking_number=BR1234567890,
shipping_zip_code=01311-000,
embosser_id=5656565656565656,
fee=0,
status=success,
tags=['department: tech'],
created=2022-01-01 00:00:00,
updated=2022-06-01 00:00:00
)
Javascript
IssuingEmbossingRequest {
id: '7834882116598271',
cardId: '5715709195239424',
kitId: '6724771005489152',
displayName1: 'TONY STARK',
displayName2: null,
displayName3: null,
shippingCity: 'Sao Paulo',
shippingCountryCode: 'BRA',
shippingDistrict: 'Bela Vista',
shippingPhone: '+5511999999999',
shippingService: 'loggi',
shippingStateCode: 'SP',
shippingStreetLine1: 'Av. Paulista, 1000',
shippingStreetLine2: 'Apto 101',
shippingTrackingNumber: 'BR1234567890',
shippingZipCode: '01311-000',
embosserId: '5656565656565656',
fee: 0,
status: 'success',
tags: [ 'department: tech' ],
created: '2022-01-01T00:00:00.000000+00:00',
updated: '2022-06-01T00:00:00.000000+00:00'
}
PHP
StarkInfra\IssuingEmbossingRequest Object
(
[id] => 7834882116598271
[fee] => 0
[cardId] => 5715709195239424
[embosserId] => 5656565656565656
[kitId] => 6724771005489152
[displayName1] => TONY STARK
[displayName2] =>
[displayName3] =>
[shippingCity] => Sao Paulo
[shippingCountryCode] => BRA
[shippingDistrict] => Bela Vista
[shippingPhone] => +5511999999999
[shippingService] => loggi
[shippingStateCode] => SP
[shippingStreetLine1] => Av. Paulista, 1000
[shippingStreetLine2] => Apto 101
[shippingTrackingNumber] => BR1234567890
[shippingZipCode] => 01311-000
[status] => success
[tags] => Array ( [0] => department: tech )
[created] => DateTime Object ( [date] => 2022-01-01 00:00:00.000000 )
[updated] => DateTime Object ( [date] => 2022-06-01 00:00:00.000000 )
)
Java
IssuingEmbossingRequest({
"id": "7834882116598271",
"fee": 0,
"cardId": "5715709195239424",
"embosserId": "5656565656565656",
"kitId": "6724771005489152",
"displayName1": "TONY STARK",
"displayName2": null,
"displayName3": null,
"shippingCity": "Sao Paulo",
"shippingCountryCode": "BRA",
"shippingDistrict": "Bela Vista",
"shippingPhone": "+5511999999999",
"shippingService": "loggi",
"shippingStateCode": "SP",
"shippingStreetLine1": "Av. Paulista, 1000",
"shippingStreetLine2": "Apto 101",
"shippingTrackingNumber": "BR1234567890",
"shippingZipCode": "01311-000",
"status": "success",
"tags": ["department: tech"],
"created": "2022-01-01T00:00:00.000000+00:00",
"updated": "2022-06-01T00:00:00.000000+00:00"
})
Ruby
issuingembossingrequest(
id: 7834882116598271,
card_id: 5715709195239424,
kit_id: 6724771005489152,
display_name_1: TONY STARK,
display_name_2: nil,
display_name_3: nil,
shipping_city: Sao Paulo,
shipping_country_code: BRA,
shipping_district: Bela Vista,
shipping_phone: +5511999999999,
shipping_service: loggi,
shipping_state_code: SP,
shipping_street_line_1: Av. Paulista, 1000,
shipping_street_line_2: Apto 101,
shipping_tracking_number: BR1234567890,
shipping_zip_code: 01311-000,
embosser_id: 5656565656565656,
fee: 0,
status: success,
tags: ["department: tech"],
created: 2022-01-01T00:00:00+00:00,
updated: 2022-06-01T00:00:00+00:00
)
Elixir
%StarkInfra.IssuingEmbossingRequest{
id: "7834882116598271",
fee: 0,
card_id: "5715709195239424",
embosser_id: "5656565656565656",
kit_id: "6724771005489152",
display_name_1: "TONY STARK",
display_name_2: nil,
display_name_3: nil,
shipping_city: "Sao Paulo",
shipping_country_code: "BRA",
shipping_district: "Bela Vista",
shipping_phone: "+5511999999999",
shipping_service: "loggi",
shipping_state_code: "SP",
shipping_street_line_1: "Av. Paulista, 1000",
shipping_street_line_2: "Apto 101",
shipping_tracking_number: "BR1234567890",
shipping_zip_code: "01311-000",
status: "success",
tags: ["department: tech"],
created: "2022-01-01T00:00:00.000000+00:00",
updated: "2022-06-01T00:00:00.000000+00:00"
}
C#
IssuingEmbossingRequest(
Id: 7834882116598271,
Fee: 0,
CardId: 5715709195239424,
EmbosserId: 5656565656565656,
KitId: 6724771005489152,
DisplayName1: TONY STARK,
DisplayName2: ,
DisplayName3: ,
ShippingCity: Sao Paulo,
ShippingCountryCode: BRA,
ShippingDistrict: Bela Vista,
ShippingPhone: +5511999999999,
ShippingService: loggi,
ShippingStateCode: SP,
ShippingStreetLine1: Av. Paulista, 1000,
ShippingStreetLine2: Apto 101,
ShippingTrackingNumber: BR1234567890,
ShippingZipCode: 01311-000,
Status: success,
Tags: [department: tech],
Created: 01/01/2022 00:00:00,
Updated: 01/06/2022 00:00:00
)
Go
{
CardId:5715709195239424
KitId:6724771005489152
DisplayName1:TONY STARK
DisplayName2:
DisplayName3:
ShippingCity:Sao Paulo
ShippingCountryCode:BRA
ShippingDistrict:Bela Vista
ShippingStateCode:SP
ShippingStreetLine1:Av. Paulista, 1000
ShippingStreetLine2:Apto 101
ShippingService:loggi
ShippingTrackingNumber:BR1234567890
ShippingZipCode:01311-000
EmbosserId:5656565656565656
ShippingPhone:+5511999999999
Tags:[department: tech]
Id:7834882116598271
Fee:0
Status:success
Updated:2022-06-01 00:00:00 +0000 +0000
Created:2022-01-01 00:00:00 +0000 +0000
}
Clojure
Not yet available. Please contact us if you need this SDK.
Curl
{
"request": {
"id": "7834882116598271",
"fee": 0,
"cardId": "5715709195239424",
"embosserId": "5656565656565656",
"kitId": "6724771005489152",
"displayName1": "TONY STARK",
"displayName2": null,
"displayName3": null,
"shippingCity": "Sao Paulo",
"shippingCountryCode": "BRA",
"shippingDistrict": "Bela Vista",
"shippingPhone": "+5511999999999",
"shippingService": "loggi",
"shippingStateCode": "SP",
"shippingStreetLine1": "Av. Paulista, 1000",
"shippingStreetLine2": "Apto 101",
"shippingTrackingNumber": "BR1234567890",
"shippingZipCode": "01311-000",
"status": "success",
"tags": ["department: tech"],
"created": "2022-01-01T00:00:00.000000+00:00",
"updated": "2022-06-01T00:00:00.000000+00:00"
}
}
Getting an Embossing Request's Logs
Follow an order's production and dispatch by querying its logs with the "requestIds" filter. You can also filter by "types" (created, sending, sent, success, failed) and "after" / "before", or fetch a single log with GET /v2/issuing-embossing-request/log/:id.
Parameters
Python
import starkinfra
logs = starkinfra.issuingembossingrequest.log.query(
limit=10,
request_ids=["7834882116598271"]
)
for log in logs:
print(log)
Javascript
const starkinfra = require('starkinfra');
(async() => {
let logs = await starkinfra.issuingEmbossingRequest.log.query({
limit: 10,
requestIds: ['7834882116598271']
});
for await (let log of logs) {
console.log(log);
}
})();
PHP
$logs = StarkInfra\IssuingEmbossingRequest\Log::query([
"limit" => 10,
"requestIds" => ["7834882116598271"]
]);
foreach ($logs as $log) {
print_r($log);
}
Java
import com.starkinfra.*; import java.util.HashMap; HashMapparams = new HashMap<>(); params.put("limit", 10); params.put("requestIds", new String[]{"7834882116598271"}); Generator logs = IssuingEmbossingRequest.Log.query(params); for (IssuingEmbossingRequest.Log log : logs) { System.out.println(log); }
Ruby
require('starkinfra')
logs = StarkInfra::IssuingEmbossingRequest::Log.query(
limit: 10,
request_ids: ["7834882116598271"]
)
logs.each do |log|
puts log
end
Elixir
logs = StarkInfra.IssuingEmbossingRequest.Log.query!(
limit: 10,
request_ids: ["7834882116598271"]
)
logs |> Enum.each(&IO.inspect/1)
C#
using System; using System.Collections.Generic; IEnumerablelogs = StarkInfra.IssuingEmbossingRequest.Log.Query( limit: 10, requestIds: new List { "7834882116598271" } ); foreach (StarkInfra.IssuingEmbossingRequest.Log log in logs) { Console.WriteLine(log); }
Go
package main
import (
"fmt"
"github.com/starkinfra/sdk-go/starkinfra/issuingembossingrequest/log"
)
func main() {
var params = map[string]interface{}{}
params["limit"] = 10
params["requestIds"] = []string{"7834882116598271"}
logs, errorChannel := log.Query(params, nil)
for log := range logs {
fmt.Printf("%+v", log)
}
for err := range errorChannel {
fmt.Printf("%+v", err)
}
}
Clojure
Not yet available. Please contact us if you need this SDK.
Curl
curl --location --request GET '{{baseUrl}}/v2/issuing-embossing-request/log?limit=10&requestIds=7834882116598271' \
--header 'Access-Id: {{accessId}}' \
--header 'Access-Time: {{accessTime}}' \
--header 'Access-Signature: {{accessSignature}}'
Python
Log(
id=8945993227707382,
type=created,
request=IssuingEmbossingRequest(id=7834882116598271, status=created, ...),
created=2022-01-01 00:00:00
)
Log(
id=5547499534213120,
type=sent,
request=IssuingEmbossingRequest(id=7834882116598271, status=processing, ...),
created=2022-02-01 00:00:00
)
Javascript
Log {
id: '8945993227707382',
type: 'created',
request: IssuingEmbossingRequest { id: '7834882116598271', status: 'created', ... },
created: '2022-01-01T00:00:00.000000+00:00'
}
Log {
id: '5547499534213120',
type: 'sent',
request: IssuingEmbossingRequest { id: '7834882116598271', status: 'processing', ... },
created: '2022-02-01T00:00:00.000000+00:00'
}
PHP
StarkInfra\IssuingEmbossingRequest\Log Object
(
[id] => 8945993227707382
[type] => created
[request] => StarkInfra\IssuingEmbossingRequest Object ( [id] => 7834882116598271 [status] => created ... )
[created] => DateTime Object ( [date] => 2022-01-01 00:00:00.000000 )
)
StarkInfra\IssuingEmbossingRequest\Log Object
(
[id] => 5547499534213120
[type] => sent
[request] => StarkInfra\IssuingEmbossingRequest Object ( [id] => 7834882116598271 [status] => processing ... )
[created] => DateTime Object ( [date] => 2022-02-01 00:00:00.000000 )
)
Java
IssuingEmbossingRequest.Log({
"id": "8945993227707382",
"type": "created",
"request": {"id": "7834882116598271", "status": "created", ...},
"created": "2022-01-01T00:00:00.000000+00:00"
})
IssuingEmbossingRequest.Log({
"id": "5547499534213120",
"type": "sent",
"request": {"id": "7834882116598271", "status": "processing", ...},
"created": "2022-02-01T00:00:00.000000+00:00"
})
Ruby
log(
id: 8945993227707382,
type: created,
request: issuingembossingrequest(id: 7834882116598271, status: created, ...),
created: 2022-01-01T00:00:00+00:00
)
log(
id: 5547499534213120,
type: sent,
request: issuingembossingrequest(id: 7834882116598271, status: processing, ...),
created: 2022-02-01T00:00:00+00:00
)
Elixir
%StarkInfra.IssuingEmbossingRequest.Log{
id: "8945993227707382",
type: "created",
request: %StarkInfra.IssuingEmbossingRequest{id: "7834882116598271", status: "created", ...},
created: "2022-01-01T00:00:00.000000+00:00"
}
%StarkInfra.IssuingEmbossingRequest.Log{
id: "5547499534213120",
type: "sent",
request: %StarkInfra.IssuingEmbossingRequest{id: "7834882116598271", status: "processing", ...},
created: "2022-02-01T00:00:00.000000+00:00"
}
C#
IssuingEmbossingRequest.Log(
Id: 8945993227707382,
Type: created,
Request: IssuingEmbossingRequest(Id: 7834882116598271, Status: created, ...),
Created: 01/01/2022 00:00:00
)
IssuingEmbossingRequest.Log(
Id: 5547499534213120,
Type: sent,
Request: IssuingEmbossingRequest(Id: 7834882116598271, Status: processing, ...),
Created: 01/02/2022 00:00:00
)
Go
{
Id:8945993227707382
Type:created
Request:{Id:7834882116598271 Status:created ...}
Created:2022-01-01 00:00:00 +0000 +0000
}
{
Id:5547499534213120
Type:sent
Request:{Id:7834882116598271 Status:processing ...}
Created:2022-02-01 00:00:00 +0000 +0000
}
Clojure
Not yet available. Please contact us if you need this SDK.
Curl
{
"cursor": null,
"logs": [
{
"id": "8945993227707382",
"type": "created",
"request": {"id": "7834882116598271", "status": "created", "...": "..."},
"created": "2022-01-01T00:00:00.000000+00:00"
},
{
"id": "5547499534213120",
"type": "sent",
"request": {"id": "7834882116598271", "status": "processing", "...": "..."},
"created": "2022-02-01T00:00:00.000000+00:00"
}
]
}
Issuing Token Overview
An Issuing Token is an Issuing Card provisioned into a digital wallet — Apple Pay or Google Pay. The token is a wallet-specific stand-in for the card: purchases run through it without ever exposing the real card number.
You do not create a token here. Tokens are created through the Issuing Token Request provisioning flow, when a cardholder adds the card to a wallet. This section covers what you do afterwards: listing tokens, inspecting one, blocking or unblocking it, canceling it, and auditing its history.
Reading the object. walletId / walletName identify the wallet the card was added to (e.g. "apple" / "Apple Pay"). cardId points back to the Issuing Card that was tokenized, and merchantId is set only when the token is merchant-specific. externalId is the wallet's own identifier for the token. walletDeviceScore and walletAccountScore are risk scores the wallet reports at provisioning time — they are null when the wallet did not send them.
Token Statuses
Each Issuing Token has a status that reflects where it is in its life cycle:
| Status | Description |
|---|---|
| pending | The wallet requested provisioning and the token is awaiting approval. It cannot be used for purchases yet. |
| active | The token was provisioned and can be used for purchases. |
| frozen | The wallet has temporarily suspended the token (for example, the device was locked or the card was suspended in the wallet). This state is driven by the wallet, not by this API. |
| blocked | The token is blocked and declines purchases. Unblock it by setting its status back to "active". |
| denied | The provisioning request was rejected, so the token was never activated. |
| canceled | The token was permanently canceled and removed from the wallet. This is irreversible. |
Token Logs
Every change to an Issuing Token — including the wallet-driven provisioning steps — creates a Log entry, so you can audit a token's full history. The "token" field in each log is a representation of the Issuing Token as it was at that point (shown abbreviated with "...").
Each log carries a "type". The possible types are: created, denied, updated, unblocking, unblocked, blocking, blocked, frozen, unfrozen, canceling, canceled and failed. The transient "-ing" types (unblocking, blocking, canceling) mark a state change that was requested with the wallet and is still being confirmed; the matching past-tense type is emitted once it settles. "failed" marks a provisioning or status change the wallet rejected.
Query the token logs with GET /v2/issuing-token/log (filter by tokenIds, types, tokenTags, after / before), or fetch a single one with GET /v2/issuing-token/log/:id.
Listing Tokens
List the tokens that have been provisioned from your cards, in chunks of at most 100. Filter by "status", "cardIds" (to see every wallet a given card was added to), "externalIds", "tags" or "after" / "before".
Use the returned "cursor" to page through results — pass it back as the "cursor" parameter to get the next batch. A null cursor means there are no more pages.
Parameters
Python
import starkinfra
tokens = starkinfra.issuingtoken.query(
limit=10,
status="active"
)
for token in tokens:
print(token)
Javascript
const starkinfra = require('starkinfra');
(async() => {
let tokens = await starkinfra.issuingToken.query({
limit: 10,
status: 'active'
});
for await (let token of tokens) {
console.log(token);
}
})();
PHP
$tokens = StarkInfra\IssuingToken::query([
"limit" => 10,
"status" => "active"
]);
foreach ($tokens as $token) {
print_r($token);
}
Java
import com.starkinfra.*; import java.util.HashMap; HashMapparams = new HashMap<>(); params.put("limit", 10); params.put("status", "active"); Generator tokens = IssuingToken.query(params); for (IssuingToken token : tokens) { System.out.println(token); }
Ruby
require('starkinfra')
tokens = StarkInfra::IssuingToken.query(
limit: 10,
status: "active"
)
tokens.each do |token|
puts token
end
Elixir
tokens = StarkInfra.IssuingToken.query!(
limit: 10,
status: "active"
)
tokens |> Enum.each(&IO.inspect/1)
C#
using System; using System.Collections.Generic; IEnumerabletokens = StarkInfra.IssuingToken.Query( limit: 10, status: "active" ); foreach (StarkInfra.IssuingToken token in tokens) { Console.WriteLine(token); }
Go
package main
import (
"fmt"
"github.com/starkinfra/sdk-go/starkinfra/issuingtoken"
)
func main() {
tokens := issuingtoken.Query(
&issuingtoken.Query{
Limit: 10,
Status: "active",
},
nil,
)
for token := range tokens {
fmt.Printf("%+v", token)
}
}
Clojure
(def tokens
(starkinfra.issuing-token/query
{:limit 10
:status "active"}))
(doseq [token tokens]
(println token))
Curl
curl --location --request GET '{{baseUrl}}/v2/issuing-token?limit=10&status=active' \
--header 'Access-Id: {{accessId}}' \
--header 'Access-Time: {{accessTime}}' \
--header 'Access-Signature: {{accessSignature}}'
Python
IssuingToken(
id=5715709195239424,
card_id=6724771005489152,
wallet_id=apple,
wallet_name=Apple Pay,
merchant_id=5656565656565656,
external_id=DNITHE301234567890123456789012345678,
wallet_device_score=None,
wallet_account_score=None,
status=active,
tags=['department: tech'],
created=2022-01-01 00:00:00,
updated=2022-01-01 00:00:00
)
Javascript
IssuingToken {
id: '5715709195239424',
cardId: '6724771005489152',
walletId: 'apple',
walletName: 'Apple Pay',
merchantId: '5656565656565656',
externalId: 'DNITHE301234567890123456789012345678',
walletDeviceScore: null,
walletAccountScore: null,
status: 'active',
tags: [ 'department: tech' ],
created: '2022-01-01T00:00:00.000000+00:00',
updated: '2022-01-01T00:00:00.000000+00:00'
}
PHP
StarkInfra\IssuingToken Object
(
[id] => 5715709195239424
[status] => active
[cardId] => 6724771005489152
[walletId] => apple
[walletName] => Apple Pay
[merchantId] => 5656565656565656
[externalId] => DNITHE301234567890123456789012345678
[walletDeviceScore] =>
[walletAccountScore] =>
[tags] => Array ( [0] => department: tech )
[created] => DateTime Object ( [date] => 2022-01-01 00:00:00.000000 )
[updated] => DateTime Object ( [date] => 2022-01-01 00:00:00.000000 )
)
Java
IssuingToken({
"id": "5715709195239424",
"cardId": "6724771005489152",
"walletId": "apple",
"walletName": "Apple Pay",
"merchantId": "5656565656565656",
"externalId": "DNITHE301234567890123456789012345678",
"walletDeviceScore": null,
"walletAccountScore": null,
"status": "active",
"tags": ["department: tech"],
"created": "2022-01-01T00:00:00.000000+00:00",
"updated": "2022-01-01T00:00:00.000000+00:00"
})
Ruby
issuingtoken(
id: 5715709195239424,
status: active,
card_id: 6724771005489152,
wallet_id: apple,
wallet_name: Apple Pay,
merchant_id: 5656565656565656,
external_id: DNITHE301234567890123456789012345678,
wallet_device_score: nil,
wallet_account_score: nil,
tags: ["department: tech"],
created: 2022-01-01T00:00:00+00:00,
updated: 2022-01-01T00:00:00+00:00
)
Elixir
%StarkInfra.IssuingToken{
id: "5715709195239424",
card_id: "6724771005489152",
wallet_id: "apple",
wallet_name: "Apple Pay",
merchant_id: "5656565656565656",
external_id: "DNITHE301234567890123456789012345678",
wallet_device_score: nil,
wallet_account_score: nil,
status: "active",
tags: ["department: tech"],
created: "2022-01-01T00:00:00.000000+00:00",
updated: "2022-01-01T00:00:00.000000+00:00"
}
C#
IssuingToken(
Id: 5715709195239424,
CardId: 6724771005489152,
WalletId: apple,
WalletName: Apple Pay,
MerchantId: 5656565656565656,
ExternalId: DNITHE301234567890123456789012345678,
WalletDeviceScore: ,
WalletAccountScore: ,
Status: active,
Tags: [department: tech],
Created: 01/01/2022 00:00:00,
Updated: 01/01/2022 00:00:00
)
Go
{
Id:5715709195239424
CardId:6724771005489152
WalletId:apple
WalletName:Apple Pay
MerchantId:5656565656565656
ExternalId:DNITHE301234567890123456789012345678
WalletDeviceScore:
WalletAccountScore:
Status:active
Tags:[department: tech]
Created:2022-01-01 00:00:00 +0000 +0000
Updated:2022-01-01 00:00:00 +0000 +0000
}
Clojure
{:id "5715709195239424",
:card-id "6724771005489152",
:wallet-id "apple",
:wallet-name "Apple Pay",
:status "active",
:tags ["department: tech"],
:created "2022-01-01T00:00:00.000000+00:00",
:updated "2022-01-01T00:00:00.000000+00:00"}
Curl
{
"cursor": null,
"tokens": [
{
"id": "5715709195239424",
"status": "active",
"cardId": "6724771005489152",
"walletId": "apple",
"walletName": "Apple Pay",
"merchantId": "5656565656565656",
"externalId": "DNITHE301234567890123456789012345678",
"walletDeviceScore": null,
"walletAccountScore": null,
"tags": ["department: tech"],
"created": "2022-01-01T00:00:00.000000+00:00",
"updated": "2022-01-01T00:00:00.000000+00:00"
}
]
}
Getting a Token
Fetch a single token by its id to inspect which card and wallet it belongs to and its current status.
Parameters
Python
import starkinfra
token = starkinfra.issuingtoken.get("5715709195239424")
print(token)
Javascript
const starkinfra = require('starkinfra');
(async() => {
let token = await starkinfra.issuingToken.get('5715709195239424');
console.log(token);
})();
PHP
$token = StarkInfra\IssuingToken::get("5715709195239424");
print_r($token);
Java
import com.starkinfra.*;
IssuingToken token = IssuingToken.get("5715709195239424");
System.out.println(token);
Ruby
require('starkinfra')
token = StarkInfra::IssuingToken.get("5715709195239424")
puts token
Elixir
token = StarkInfra.IssuingToken.get!("5715709195239424")
IO.inspect(token)
C#
using System;
StarkInfra.IssuingToken token = StarkInfra.IssuingToken.Get("5715709195239424");
Console.WriteLine(token);
Go
package main
import (
"fmt"
"github.com/starkinfra/sdk-go/starkinfra/issuingtoken"
)
func main() {
token, err := issuingtoken.Get("5715709195239424", nil)
if err.Errors != nil {
for _, e := range err.Errors {
fmt.Printf("code: %s, message: %s", e.Code, e.Message)
}
}
fmt.Printf("%+v", token)
}
Clojure
(def token (starkinfra.issuing-token/get "5715709195239424")) (println token)
Curl
curl --location --request GET '{{baseUrl}}/v2/issuing-token/5715709195239424' \
--header 'Access-Id: {{accessId}}' \
--header 'Access-Time: {{accessTime}}' \
--header 'Access-Signature: {{accessSignature}}'
Python
IssuingToken(
id=5715709195239424,
card_id=6724771005489152,
wallet_id=apple,
wallet_name=Apple Pay,
merchant_id=5656565656565656,
external_id=DNITHE301234567890123456789012345678,
wallet_device_score=None,
wallet_account_score=None,
status=active,
tags=['department: tech'],
created=2022-01-01 00:00:00,
updated=2022-01-01 00:00:00
)
Javascript
IssuingToken {
id: '5715709195239424',
cardId: '6724771005489152',
walletId: 'apple',
walletName: 'Apple Pay',
merchantId: '5656565656565656',
externalId: 'DNITHE301234567890123456789012345678',
walletDeviceScore: null,
walletAccountScore: null,
status: 'active',
tags: [ 'department: tech' ],
created: '2022-01-01T00:00:00.000000+00:00',
updated: '2022-01-01T00:00:00.000000+00:00'
}
PHP
StarkInfra\IssuingToken Object
(
[id] => 5715709195239424
[status] => active
[cardId] => 6724771005489152
[walletId] => apple
[walletName] => Apple Pay
[merchantId] => 5656565656565656
[externalId] => DNITHE301234567890123456789012345678
[walletDeviceScore] =>
[walletAccountScore] =>
[tags] => Array ( [0] => department: tech )
[created] => DateTime Object ( [date] => 2022-01-01 00:00:00.000000 )
[updated] => DateTime Object ( [date] => 2022-01-01 00:00:00.000000 )
)
Java
IssuingToken({
"id": "5715709195239424",
"cardId": "6724771005489152",
"walletId": "apple",
"walletName": "Apple Pay",
"merchantId": "5656565656565656",
"externalId": "DNITHE301234567890123456789012345678",
"walletDeviceScore": null,
"walletAccountScore": null,
"status": "active",
"tags": ["department: tech"],
"created": "2022-01-01T00:00:00.000000+00:00",
"updated": "2022-01-01T00:00:00.000000+00:00"
})
Ruby
issuingtoken(
id: 5715709195239424,
status: active,
card_id: 6724771005489152,
wallet_id: apple,
wallet_name: Apple Pay,
merchant_id: 5656565656565656,
external_id: DNITHE301234567890123456789012345678,
wallet_device_score: nil,
wallet_account_score: nil,
tags: ["department: tech"],
created: 2022-01-01T00:00:00+00:00,
updated: 2022-01-01T00:00:00+00:00
)
Elixir
%StarkInfra.IssuingToken{
id: "5715709195239424",
card_id: "6724771005489152",
wallet_id: "apple",
wallet_name: "Apple Pay",
merchant_id: "5656565656565656",
external_id: "DNITHE301234567890123456789012345678",
wallet_device_score: nil,
wallet_account_score: nil,
status: "active",
tags: ["department: tech"],
created: "2022-01-01T00:00:00.000000+00:00",
updated: "2022-01-01T00:00:00.000000+00:00"
}
C#
IssuingToken(
Id: 5715709195239424,
CardId: 6724771005489152,
WalletId: apple,
WalletName: Apple Pay,
MerchantId: 5656565656565656,
ExternalId: DNITHE301234567890123456789012345678,
WalletDeviceScore: ,
WalletAccountScore: ,
Status: active,
Tags: [department: tech],
Created: 01/01/2022 00:00:00,
Updated: 01/01/2022 00:00:00
)
Go
{
Id:5715709195239424
CardId:6724771005489152
WalletId:apple
WalletName:Apple Pay
MerchantId:5656565656565656
ExternalId:DNITHE301234567890123456789012345678
WalletDeviceScore:
WalletAccountScore:
Status:active
Tags:[department: tech]
Created:2022-01-01 00:00:00 +0000 +0000
Updated:2022-01-01 00:00:00 +0000 +0000
}
Clojure
{:id "5715709195239424",
:card-id "6724771005489152",
:wallet-id "apple",
:wallet-name "Apple Pay",
:status "active",
:tags ["department: tech"],
:created "2022-01-01T00:00:00.000000+00:00",
:updated "2022-01-01T00:00:00.000000+00:00"}
Curl
{
"token": {
"id": "5715709195239424",
"status": "active",
"cardId": "6724771005489152",
"walletId": "apple",
"walletName": "Apple Pay",
"merchantId": "5656565656565656",
"externalId": "DNITHE301234567890123456789012345678",
"walletDeviceScore": null,
"walletAccountScore": null,
"tags": ["department: tech"],
"created": "2022-01-01T00:00:00.000000+00:00",
"updated": "2022-01-01T00:00:00.000000+00:00"
}
}
Blocking a Token
Block a token by setting its status to "blocked". A blocked token declines purchases through that wallet until you unblock it; the underlying Issuing Card and any other wallets keep working. You can also send a new "tags" array on the same request.
Parameters
Python
import starkinfra
token = starkinfra.issuingtoken.update(
id="5715709195239424",
status="blocked"
)
print(token)
Javascript
const starkinfra = require('starkinfra');
(async() => {
let token = await starkinfra.issuingToken.update('5715709195239424', {
status: 'blocked'
});
console.log(token);
})();
PHP
$token = StarkInfra\IssuingToken::update("5715709195239424", [
"status" => "blocked"
]);
print_r($token);
Java
import com.starkinfra.*; import java.util.HashMap; HashMappatchData = new HashMap<>(); patchData.put("status", "blocked"); IssuingToken token = IssuingToken.update("5715709195239424", patchData); System.out.println(token);
Ruby
require('starkinfra')
token = StarkInfra::IssuingToken.update(
"5715709195239424",
status: "blocked"
)
puts token
Elixir
token = StarkInfra.IssuingToken.update!(
"5715709195239424",
status: "blocked"
)
IO.inspect(token)
C#
using System;
StarkInfra.IssuingToken token = StarkInfra.IssuingToken.Update(
"5715709195239424",
status: "blocked"
);
Console.WriteLine(token);
Go
package main
import (
"fmt"
"github.com/starkinfra/sdk-go/starkinfra/issuingtoken"
)
func main() {
token, err := issuingtoken.Update(
"5715709195239424",
map[string]interface{}{
"status": "blocked",
},
nil,
)
if err.Errors != nil {
for _, e := range err.Errors {
fmt.Printf("code: %s, message: %s", e.Code, e.Message)
}
}
fmt.Printf("%+v", token)
}
Clojure
(def token
(starkinfra.issuing-token/update
"5715709195239424"
{:status "blocked"}))
(println token)
Curl
curl --location --request PATCH '{{baseUrl}}/v2/issuing-token/5715709195239424' \
--header 'Access-Id: {{accessId}}' \
--header 'Access-Time: {{accessTime}}' \
--header 'Access-Signature: {{accessSignature}}' \
--header 'Content-Type: application/json' \
--data-raw '{
"status": "blocked"
}'
Python
IssuingToken(
id=5715709195239424,
card_id=6724771005489152,
wallet_id=apple,
wallet_name=Apple Pay,
merchant_id=5656565656565656,
external_id=DNITHE301234567890123456789012345678,
wallet_device_score=None,
wallet_account_score=None,
status=blocked,
tags=['department: tech'],
created=2022-01-01 00:00:00,
updated=2022-06-01 00:00:00
)
Javascript
IssuingToken {
id: '5715709195239424',
cardId: '6724771005489152',
walletId: 'apple',
walletName: 'Apple Pay',
merchantId: '5656565656565656',
externalId: 'DNITHE301234567890123456789012345678',
walletDeviceScore: null,
walletAccountScore: null,
status: 'blocked',
tags: [ 'department: tech' ],
created: '2022-01-01T00:00:00.000000+00:00',
updated: '2022-06-01T00:00:00.000000+00:00'
}
PHP
StarkInfra\IssuingToken Object
(
[id] => 5715709195239424
[status] => blocked
[cardId] => 6724771005489152
[walletId] => apple
[walletName] => Apple Pay
[merchantId] => 5656565656565656
[externalId] => DNITHE301234567890123456789012345678
[walletDeviceScore] =>
[walletAccountScore] =>
[tags] => Array ( [0] => department: tech )
[created] => DateTime Object ( [date] => 2022-01-01 00:00:00.000000 )
[updated] => DateTime Object ( [date] => 2022-06-01 00:00:00.000000 )
)
Java
IssuingToken({
"id": "5715709195239424",
"cardId": "6724771005489152",
"walletId": "apple",
"walletName": "Apple Pay",
"merchantId": "5656565656565656",
"externalId": "DNITHE301234567890123456789012345678",
"walletDeviceScore": null,
"walletAccountScore": null,
"status": "blocked",
"tags": ["department: tech"],
"created": "2022-01-01T00:00:00.000000+00:00",
"updated": "2022-06-01T00:00:00.000000+00:00"
})
Ruby
issuingtoken(
id: 5715709195239424,
status: blocked,
card_id: 6724771005489152,
wallet_id: apple,
wallet_name: Apple Pay,
merchant_id: 5656565656565656,
external_id: DNITHE301234567890123456789012345678,
wallet_device_score: nil,
wallet_account_score: nil,
tags: ["department: tech"],
created: 2022-01-01T00:00:00+00:00,
updated: 2022-06-01T00:00:00+00:00
)
Elixir
%StarkInfra.IssuingToken{
id: "5715709195239424",
card_id: "6724771005489152",
wallet_id: "apple",
wallet_name: "Apple Pay",
merchant_id: "5656565656565656",
external_id: "DNITHE301234567890123456789012345678",
wallet_device_score: nil,
wallet_account_score: nil,
status: "blocked",
tags: ["department: tech"],
created: "2022-01-01T00:00:00.000000+00:00",
updated: "2022-06-01T00:00:00.000000+00:00"
}
C#
IssuingToken(
Id: 5715709195239424,
CardId: 6724771005489152,
WalletId: apple,
WalletName: Apple Pay,
MerchantId: 5656565656565656,
ExternalId: DNITHE301234567890123456789012345678,
WalletDeviceScore: ,
WalletAccountScore: ,
Status: blocked,
Tags: [department: tech],
Created: 01/01/2022 00:00:00,
Updated: 06/01/2022 00:00:00
)
Go
{
Id:5715709195239424
CardId:6724771005489152
WalletId:apple
WalletName:Apple Pay
MerchantId:5656565656565656
ExternalId:DNITHE301234567890123456789012345678
WalletDeviceScore:
WalletAccountScore:
Status:blocked
Tags:[department: tech]
Created:2022-01-01 00:00:00 +0000 +0000
Updated:2022-06-01 00:00:00 +0000 +0000
}
Clojure
{:id "5715709195239424",
:card-id "6724771005489152",
:wallet-id "apple",
:wallet-name "Apple Pay",
:status "blocked",
:tags ["department: tech"],
:created "2022-01-01T00:00:00.000000+00:00",
:updated "2022-06-01T00:00:00.000000+00:00"}
Curl
{
"token": {
"id": "5715709195239424",
"status": "blocked",
"cardId": "6724771005489152",
"walletId": "apple",
"walletName": "Apple Pay",
"merchantId": "5656565656565656",
"externalId": "DNITHE301234567890123456789012345678",
"walletDeviceScore": null,
"walletAccountScore": null,
"tags": ["department: tech"],
"created": "2022-01-01T00:00:00.000000+00:00",
"updated": "2022-06-01T00:00:00.000000+00:00"
}
}
Unblocking a Token
Unblock a previously blocked token by setting its status back to "active".
Parameters
Python
import starkinfra
token = starkinfra.issuingtoken.update(
id="5715709195239424",
status="active"
)
print(token)
Javascript
const starkinfra = require('starkinfra');
(async() => {
let token = await starkinfra.issuingToken.update('5715709195239424', {
status: 'active'
});
console.log(token);
})();
PHP
$token = StarkInfra\IssuingToken::update("5715709195239424", [
"status" => "active"
]);
print_r($token);
Java
import com.starkinfra.*; import java.util.HashMap; HashMappatchData = new HashMap<>(); patchData.put("status", "active"); IssuingToken token = IssuingToken.update("5715709195239424", patchData); System.out.println(token);
Ruby
require('starkinfra')
token = StarkInfra::IssuingToken.update(
"5715709195239424",
status: "active"
)
puts token
Elixir
token = StarkInfra.IssuingToken.update!(
"5715709195239424",
status: "active"
)
IO.inspect(token)
C#
using System;
StarkInfra.IssuingToken token = StarkInfra.IssuingToken.Update(
"5715709195239424",
status: "active"
);
Console.WriteLine(token);
Go
package main
import (
"fmt"
"github.com/starkinfra/sdk-go/starkinfra/issuingtoken"
)
func main() {
token, err := issuingtoken.Update(
"5715709195239424",
map[string]interface{}{
"status": "active",
},
nil,
)
if err.Errors != nil {
for _, e := range err.Errors {
fmt.Printf("code: %s, message: %s", e.Code, e.Message)
}
}
fmt.Printf("%+v", token)
}
Clojure
(def token
(starkinfra.issuing-token/update
"5715709195239424"
{:status "active"}))
(println token)
Curl
curl --location --request PATCH '{{baseUrl}}/v2/issuing-token/5715709195239424' \
--header 'Access-Id: {{accessId}}' \
--header 'Access-Time: {{accessTime}}' \
--header 'Access-Signature: {{accessSignature}}' \
--header 'Content-Type: application/json' \
--data-raw '{
"status": "active"
}'
Python
IssuingToken(
id=5715709195239424,
card_id=6724771005489152,
wallet_id=apple,
wallet_name=Apple Pay,
merchant_id=5656565656565656,
external_id=DNITHE301234567890123456789012345678,
wallet_device_score=None,
wallet_account_score=None,
status=active,
tags=['department: tech'],
created=2022-01-01 00:00:00,
updated=2022-06-01 00:00:00
)
Javascript
IssuingToken {
id: '5715709195239424',
cardId: '6724771005489152',
walletId: 'apple',
walletName: 'Apple Pay',
merchantId: '5656565656565656',
externalId: 'DNITHE301234567890123456789012345678',
walletDeviceScore: null,
walletAccountScore: null,
status: 'active',
tags: [ 'department: tech' ],
created: '2022-01-01T00:00:00.000000+00:00',
updated: '2022-06-01T00:00:00.000000+00:00'
}
PHP
StarkInfra\IssuingToken Object
(
[id] => 5715709195239424
[status] => active
[cardId] => 6724771005489152
[walletId] => apple
[walletName] => Apple Pay
[merchantId] => 5656565656565656
[externalId] => DNITHE301234567890123456789012345678
[walletDeviceScore] =>
[walletAccountScore] =>
[tags] => Array ( [0] => department: tech )
[created] => DateTime Object ( [date] => 2022-01-01 00:00:00.000000 )
[updated] => DateTime Object ( [date] => 2022-06-01 00:00:00.000000 )
)
Java
IssuingToken({
"id": "5715709195239424",
"cardId": "6724771005489152",
"walletId": "apple",
"walletName": "Apple Pay",
"merchantId": "5656565656565656",
"externalId": "DNITHE301234567890123456789012345678",
"walletDeviceScore": null,
"walletAccountScore": null,
"status": "active",
"tags": ["department: tech"],
"created": "2022-01-01T00:00:00.000000+00:00",
"updated": "2022-06-01T00:00:00.000000+00:00"
})
Ruby
issuingtoken(
id: 5715709195239424,
status: active,
card_id: 6724771005489152,
wallet_id: apple,
wallet_name: Apple Pay,
merchant_id: 5656565656565656,
external_id: DNITHE301234567890123456789012345678,
wallet_device_score: nil,
wallet_account_score: nil,
tags: ["department: tech"],
created: 2022-01-01T00:00:00+00:00,
updated: 2022-06-01T00:00:00+00:00
)
Elixir
%StarkInfra.IssuingToken{
id: "5715709195239424",
card_id: "6724771005489152",
wallet_id: "apple",
wallet_name: "Apple Pay",
merchant_id: "5656565656565656",
external_id: "DNITHE301234567890123456789012345678",
wallet_device_score: nil,
wallet_account_score: nil,
status: "active",
tags: ["department: tech"],
created: "2022-01-01T00:00:00.000000+00:00",
updated: "2022-06-01T00:00:00.000000+00:00"
}
C#
IssuingToken(
Id: 5715709195239424,
CardId: 6724771005489152,
WalletId: apple,
WalletName: Apple Pay,
MerchantId: 5656565656565656,
ExternalId: DNITHE301234567890123456789012345678,
WalletDeviceScore: ,
WalletAccountScore: ,
Status: active,
Tags: [department: tech],
Created: 01/01/2022 00:00:00,
Updated: 06/01/2022 00:00:00
)
Go
{
Id:5715709195239424
CardId:6724771005489152
WalletId:apple
WalletName:Apple Pay
MerchantId:5656565656565656
ExternalId:DNITHE301234567890123456789012345678
WalletDeviceScore:
WalletAccountScore:
Status:active
Tags:[department: tech]
Created:2022-01-01 00:00:00 +0000 +0000
Updated:2022-06-01 00:00:00 +0000 +0000
}
Clojure
{:id "5715709195239424",
:card-id "6724771005489152",
:wallet-id "apple",
:wallet-name "Apple Pay",
:status "active",
:tags ["department: tech"],
:created "2022-01-01T00:00:00.000000+00:00",
:updated "2022-06-01T00:00:00.000000+00:00"}
Curl
{
"token": {
"id": "5715709195239424",
"status": "active",
"cardId": "6724771005489152",
"walletId": "apple",
"walletName": "Apple Pay",
"merchantId": "5656565656565656",
"externalId": "DNITHE301234567890123456789012345678",
"walletDeviceScore": null,
"walletAccountScore": null,
"tags": ["department: tech"],
"created": "2022-01-01T00:00:00.000000+00:00",
"updated": "2022-06-01T00:00:00.000000+00:00"
}
}
Canceling a Token
Permanently cancel a token by its id. Its status becomes "canceled" and it is removed from the wallet. This action is irreversible — a token that is already canceled cannot be canceled again.
Parameters
Python
import starkinfra
token = starkinfra.issuingtoken.cancel("5715709195239424")
print(token)
Javascript
const starkinfra = require('starkinfra');
(async() => {
let token = await starkinfra.issuingToken.cancel('5715709195239424');
console.log(token);
})();
PHP
$token = StarkInfra\IssuingToken::cancel("5715709195239424");
print_r($token);
Java
import com.starkinfra.*;
IssuingToken token = IssuingToken.cancel("5715709195239424");
System.out.println(token);
Ruby
require('starkinfra')
token = StarkInfra::IssuingToken.cancel("5715709195239424")
puts token
Elixir
token = StarkInfra.IssuingToken.cancel!("5715709195239424")
IO.inspect(token)
C#
using System;
StarkInfra.IssuingToken token = StarkInfra.IssuingToken.Cancel("5715709195239424");
Console.WriteLine(token);
Go
package main
import (
"fmt"
"github.com/starkinfra/sdk-go/starkinfra/issuingtoken"
)
func main() {
token, err := issuingtoken.Cancel("5715709195239424", nil)
if err.Errors != nil {
for _, e := range err.Errors {
fmt.Printf("code: %s, message: %s", e.Code, e.Message)
}
}
fmt.Printf("%+v", token)
}
Clojure
(def token (starkinfra.issuing-token/cancel "5715709195239424")) (println token)
Curl
curl --location --request DELETE '{{baseUrl}}/v2/issuing-token/5715709195239424' \
--header 'Access-Id: {{accessId}}' \
--header 'Access-Time: {{accessTime}}' \
--header 'Access-Signature: {{accessSignature}}'
Python
IssuingToken(
id=5715709195239424,
card_id=6724771005489152,
wallet_id=apple,
wallet_name=Apple Pay,
merchant_id=5656565656565656,
external_id=DNITHE301234567890123456789012345678,
wallet_device_score=None,
wallet_account_score=None,
status=canceled,
tags=['department: tech'],
created=2022-01-01 00:00:00,
updated=2022-06-01 00:00:00
)
Javascript
IssuingToken {
id: '5715709195239424',
cardId: '6724771005489152',
walletId: 'apple',
walletName: 'Apple Pay',
merchantId: '5656565656565656',
externalId: 'DNITHE301234567890123456789012345678',
walletDeviceScore: null,
walletAccountScore: null,
status: 'canceled',
tags: [ 'department: tech' ],
created: '2022-01-01T00:00:00.000000+00:00',
updated: '2022-06-01T00:00:00.000000+00:00'
}
PHP
StarkInfra\IssuingToken Object
(
[id] => 5715709195239424
[status] => canceled
[cardId] => 6724771005489152
[walletId] => apple
[walletName] => Apple Pay
[merchantId] => 5656565656565656
[externalId] => DNITHE301234567890123456789012345678
[walletDeviceScore] =>
[walletAccountScore] =>
[tags] => Array ( [0] => department: tech )
[created] => DateTime Object ( [date] => 2022-01-01 00:00:00.000000 )
[updated] => DateTime Object ( [date] => 2022-06-01 00:00:00.000000 )
)
Java
IssuingToken({
"id": "5715709195239424",
"cardId": "6724771005489152",
"walletId": "apple",
"walletName": "Apple Pay",
"merchantId": "5656565656565656",
"externalId": "DNITHE301234567890123456789012345678",
"walletDeviceScore": null,
"walletAccountScore": null,
"status": "canceled",
"tags": ["department: tech"],
"created": "2022-01-01T00:00:00.000000+00:00",
"updated": "2022-06-01T00:00:00.000000+00:00"
})
Ruby
issuingtoken(
id: 5715709195239424,
status: canceled,
card_id: 6724771005489152,
wallet_id: apple,
wallet_name: Apple Pay,
merchant_id: 5656565656565656,
external_id: DNITHE301234567890123456789012345678,
wallet_device_score: nil,
wallet_account_score: nil,
tags: ["department: tech"],
created: 2022-01-01T00:00:00+00:00,
updated: 2022-06-01T00:00:00+00:00
)
Elixir
%StarkInfra.IssuingToken{
id: "5715709195239424",
card_id: "6724771005489152",
wallet_id: "apple",
wallet_name: "Apple Pay",
merchant_id: "5656565656565656",
external_id: "DNITHE301234567890123456789012345678",
wallet_device_score: nil,
wallet_account_score: nil,
status: "canceled",
tags: ["department: tech"],
created: "2022-01-01T00:00:00.000000+00:00",
updated: "2022-06-01T00:00:00.000000+00:00"
}
C#
IssuingToken(
Id: 5715709195239424,
CardId: 6724771005489152,
WalletId: apple,
WalletName: Apple Pay,
MerchantId: 5656565656565656,
ExternalId: DNITHE301234567890123456789012345678,
WalletDeviceScore: ,
WalletAccountScore: ,
Status: canceled,
Tags: [department: tech],
Created: 01/01/2022 00:00:00,
Updated: 06/01/2022 00:00:00
)
Go
{
Id:5715709195239424
CardId:6724771005489152
WalletId:apple
WalletName:Apple Pay
MerchantId:5656565656565656
ExternalId:DNITHE301234567890123456789012345678
WalletDeviceScore:
WalletAccountScore:
Status:canceled
Tags:[department: tech]
Created:2022-01-01 00:00:00 +0000 +0000
Updated:2022-06-01 00:00:00 +0000 +0000
}
Clojure
{:id "5715709195239424",
:card-id "6724771005489152",
:wallet-id "apple",
:wallet-name "Apple Pay",
:status "canceled",
:tags ["department: tech"],
:created "2022-01-01T00:00:00.000000+00:00",
:updated "2022-06-01T00:00:00.000000+00:00"}
Curl
{
"token": {
"id": "5715709195239424",
"status": "canceled",
"cardId": "6724771005489152",
"walletId": "apple",
"walletName": "Apple Pay",
"merchantId": "5656565656565656",
"externalId": "DNITHE301234567890123456789012345678",
"walletDeviceScore": null,
"walletAccountScore": null,
"tags": ["department: tech"],
"created": "2022-01-01T00:00:00.000000+00:00",
"updated": "2022-06-01T00:00:00.000000+00:00"
}
}
Getting a Token's Logs
Audit a token's history by querying its logs with the "tokenIds" filter. Each step — provisioning, blocking, canceling and so on — produces one log. You can also filter by "types", "tokenTags" and "after" / "before", or fetch a single log with GET /v2/issuing-token/log/:id.
Parameters
Python
import starkinfra
logs = starkinfra.issuingtoken.log.query(
limit=10,
token_ids=["5715709195239424"]
)
for log in logs:
print(log)
Javascript
const starkinfra = require('starkinfra');
(async() => {
let logs = await starkinfra.issuingToken.log.query({
limit: 10,
tokenIds: ['5715709195239424']
});
for await (let log of logs) {
console.log(log);
}
})();
PHP
$logs = StarkInfra\IssuingToken\Log::query([
"limit" => 10,
"tokenIds" => ["5715709195239424"]
]);
foreach ($logs as $log) {
print_r($log);
}
Java
import com.starkinfra.*; import java.util.HashMap; HashMapparams = new HashMap<>(); params.put("limit", 10); params.put("tokenIds", new String[]{"5715709195239424"}); Generator logs = IssuingToken.Log.query(params); for (IssuingToken.Log log : logs) { System.out.println(log); }
Ruby
require('starkinfra')
logs = StarkInfra::IssuingToken::Log.query(
limit: 10,
token_ids: ["5715709195239424"]
)
logs.each do |log|
puts log
end
Elixir
logs = StarkInfra.IssuingToken.Log.query!(
limit: 10,
token_ids: ["5715709195239424"]
)
logs |> Enum.each(&IO.inspect/1)
C#
using System; using System.Collections.Generic; IEnumerablelogs = StarkInfra.IssuingToken.Log.Query( limit: 10, tokenIds: new List { "5715709195239424" } ); foreach (StarkInfra.IssuingToken.Log log in logs) { Console.WriteLine(log); }
Go
package main
import (
"fmt"
"github.com/starkinfra/sdk-go/starkinfra/issuingtoken/log"
)
func main() {
logs := log.Query(
&log.Query{
Limit: 10,
TokenIds: []string{"5715709195239424"},
},
nil,
)
for log := range logs {
fmt.Printf("%+v", log)
}
}
Clojure
(def logs
(starkinfra.issuing-token.log/query
{:limit 10
:token-ids ["5715709195239424"]}))
(doseq [log logs]
(println log))
Curl
curl --location --request GET '{{baseUrl}}/v2/issuing-token/log?limit=10&tokenIds=5715709195239424' \
--header 'Access-Id: {{accessId}}' \
--header 'Access-Time: {{accessTime}}' \
--header 'Access-Signature: {{accessSignature}}'
Python
Log(
id=6724771005489152,
type=created,
errors=[],
token=IssuingToken(id=5715709195239424, status=active, ...),
created=2022-01-01 00:00:00
)
Log(
id=5547499534213120,
type=blocked,
errors=[],
token=IssuingToken(id=5715709195239424, status=blocked, ...),
created=2022-02-01 00:00:00
)
Javascript
Log {
id: '6724771005489152',
type: 'created',
errors: [],
token: IssuingToken { id: '5715709195239424', status: 'active', ... },
created: '2022-01-01T00:00:00.000000+00:00'
}
Log {
id: '5547499534213120',
type: 'blocked',
errors: [],
token: IssuingToken { id: '5715709195239424', status: 'blocked', ... },
created: '2022-02-01T00:00:00.000000+00:00'
}
PHP
StarkInfra\IssuingToken\Log Object
(
[id] => 6724771005489152
[type] => created
[errors] => Array ( )
[token] => StarkInfra\IssuingToken Object ( [id] => 5715709195239424 [status] => active ... )
[created] => DateTime Object ( [date] => 2022-01-01 00:00:00.000000 )
)
StarkInfra\IssuingToken\Log Object
(
[id] => 5547499534213120
[type] => blocked
[errors] => Array ( )
[token] => StarkInfra\IssuingToken Object ( [id] => 5715709195239424 [status] => blocked ... )
[created] => DateTime Object ( [date] => 2022-02-01 00:00:00.000000 )
)
Java
IssuingToken.Log({
"id": "6724771005489152",
"type": "created",
"errors": [],
"token": {"id": "5715709195239424", "status": "active", "...": "..."},
"created": "2022-01-01T00:00:00.000000+00:00"
})
IssuingToken.Log({
"id": "5547499534213120",
"type": "blocked",
"errors": [],
"token": {"id": "5715709195239424", "status": "blocked", "...": "..."},
"created": "2022-02-01T00:00:00.000000+00:00"
})
Ruby
log(
id: 6724771005489152,
type: created,
errors: [],
token: issuingtoken(id: 5715709195239424, status: active, ...),
created: 2022-01-01T00:00:00+00:00
)
log(
id: 5547499534213120,
type: blocked,
errors: [],
token: issuingtoken(id: 5715709195239424, status: blocked, ...),
created: 2022-02-01T00:00:00+00:00
)
Elixir
%StarkInfra.IssuingToken.Log{
id: "6724771005489152",
type: "created",
errors: [],
token: %StarkInfra.IssuingToken{id: "5715709195239424", status: "active", ...},
created: "2022-01-01T00:00:00.000000+00:00"
}
%StarkInfra.IssuingToken.Log{
id: "5547499534213120",
type: "blocked",
errors: [],
token: %StarkInfra.IssuingToken{id: "5715709195239424", status: "blocked", ...},
created: "2022-02-01T00:00:00.000000+00:00"
}
C#
IssuingToken.Log(
Id: 6724771005489152,
Type: created,
Errors: [],
Token: IssuingToken(Id: 5715709195239424, Status: active, ...),
Created: 01/01/2022 00:00:00
)
IssuingToken.Log(
Id: 5547499534213120,
Type: blocked,
Errors: [],
Token: IssuingToken(Id: 5715709195239424, Status: blocked, ...),
Created: 02/01/2022 00:00:00
)
Go
{
Id:6724771005489152
Type:created
Errors:[]
Token:{Id:5715709195239424 Status:active ...}
Created:2022-01-01 00:00:00 +0000 +0000
}
{
Id:5547499534213120
Type:blocked
Errors:[]
Token:{Id:5715709195239424 Status:blocked ...}
Created:2022-02-01 00:00:00 +0000 +0000
}
Clojure
{:id "6724771005489152",
:type "created",
:errors [],
:token {:id "5715709195239424", :status "active", ...},
:created "2022-01-01T00:00:00.000000+00:00"}
{:id "5547499534213120",
:type "blocked",
:errors [],
:token {:id "5715709195239424", :status "blocked", ...},
:created "2022-02-01T00:00:00.000000+00:00"}
Curl
{
"cursor": null,
"logs": [
{
"id": "6724771005489152",
"type": "created",
"errors": [],
"token": {"id": "5715709195239424", "status": "active", "...": "..."},
"created": "2022-01-01T00:00:00.000000+00:00"
},
{
"id": "5547499534213120",
"type": "blocked",
"errors": [],
"token": {"id": "5715709195239424", "status": "blocked", "...": "..."},
"created": "2022-02-01T00:00:00.000000+00:00"
}
]
}
Issuing Token Request Overview
An Issuing Token Request starts the provisioning of an Issuing Card into a digital wallet (Apple Pay, Google Pay or a merchant wallet). It is the first step of tokenization: you call it, get back a signed payload, and hand that payload to the wallet's SDK on the device to finish adding the card.
The card is identified by its id (cardId) — the id Stark Infra returned when you created the Issuing Card.
walletId. This is NOT a token or a JWT — it is the wallet the card is being added to. Send one of "apple", "google" or "merchant".
methodCode. The provisioning method: "app" (in-app provisioning, where your app drives the flow through the wallet SDK) or "manual" (the cardholder types the card details into the wallet themselves).
The returned payload. The response gives you a "content" and a "signature". These are the inputs the wallet SDK expects to complete provisioning on the device. Stark Infra does not store a token request as a queryable resource — there is no status, no lifecycle and no log: once you have the content and signature, the rest of the flow happens between the device and the wallet, producing an Issuing Token.
Starting a tokenization
Send the card's id (cardId), the target walletId ("apple", "google" or "merchant") and the methodCode ("app" or "manual"). You may also attach a "metadata" object to carry your own data through the flow.
The response echoes back what you sent plus the "content" and "signature" you forward to the wallet SDK on the device. The result is wrapped in a "request" object.
Parameters
Python
import starkinfra
token_request = starkinfra.issuingtokenrequest.create(
starkinfra.IssuingTokenRequest(
card_id="5715709195239424",
wallet_id="apple",
method_code="app"
)
)
print(token_request)
Javascript
const starkinfra = require('starkinfra');
(async() => {
let tokenRequest = await starkinfra.issuingTokenRequest.create(
new starkinfra.IssuingTokenRequest({
cardId: '5715709195239424',
walletId: 'apple',
methodCode: 'app'
})
);
console.log(tokenRequest);
})();
PHP
$tokenRequest = StarkInfra\IssuingTokenRequest::create(
new StarkInfra\IssuingTokenRequest([
"cardId" => "5715709195239424",
"walletId" => "apple",
"methodCode" => "app"
])
);
print_r($tokenRequest);
Java
import com.starkinfra.*; import java.util.HashMap; HashMapdata = new HashMap<>(); data.put("cardId", "5715709195239424"); data.put("walletId", "apple"); data.put("methodCode", "app"); IssuingTokenRequest tokenRequest = IssuingTokenRequest.create(new IssuingTokenRequest(data)); System.out.println(tokenRequest);
Ruby
require('starkinfra')
token_request = StarkInfra::IssuingTokenRequest.create(
StarkInfra::IssuingTokenRequest.new(
card_id: "5715709195239424",
wallet_id: "apple",
method_code: "app"
)
)
puts token_request
Elixir
token_request = StarkInfra.IssuingTokenRequest.create!(
%StarkInfra.IssuingTokenRequest{
card_id: "5715709195239424",
wallet_id: "apple",
method_code: "app"
}
)
IO.inspect(token_request)
C#
using System;
StarkInfra.IssuingTokenRequest tokenRequest = StarkInfra.IssuingTokenRequest.Create(
new StarkInfra.IssuingTokenRequest(
cardId: "5715709195239424",
walletId: "apple",
methodCode: "app"
)
);
Console.WriteLine(tokenRequest);
Go
package main
import (
"fmt"
"github.com/starkinfra/sdk-go/starkinfra/issuingtokenrequest"
)
func main() {
tokenRequest, err := issuingtokenrequest.Create(
issuingtokenrequest.IssuingTokenRequest{
CardId: "5715709195239424",
WalletId: "apple",
MethodCode: "app",
},
nil,
)
if err.Errors != nil {
for _, e := range err.Errors {
fmt.Printf("code: %s, message: %s", e.Code, e.Message)
}
}
fmt.Printf("%+v", tokenRequest)
}
Clojure
(def token-request
(starkinfra.issuing-token-request/create
{:card-id "5715709195239424"
:wallet-id "apple"
:method-code "app"}))
(println token-request)
Curl
curl --location --request POST '{{baseUrl}}/v2/issuing-token-request' \
--header 'Access-Id: {{accessId}}' \
--header 'Access-Time: {{accessTime}}' \
--header 'Access-Signature: {{accessSignature}}' \
--header 'Content-Type: application/json' \
--data-raw '{
"cardId": "5715709195239424",
"walletId": "apple",
"methodCode": "app"
}'
Python
IssuingTokenRequest(
card_id=5715709195239424,
wallet_id=apple,
method_code=app,
content=eyJhcHBsaWNhdGlvbklkIjoiY29tLmFwcGxl...,
signature=MEUCIQDp3GTGqsqDeKLN9aLhxAZ...,
metadata={}
)
Javascript
IssuingTokenRequest {
cardId: '5715709195239424',
walletId: 'apple',
methodCode: 'app',
content: 'eyJhcHBsaWNhdGlvbklkIjoiY29tLmFwcGxl...',
signature: 'MEUCIQDp3GTGqsqDeKLN9aLhxAZ...',
metadata: {}
}
PHP
StarkInfra\IssuingTokenRequest Object
(
[cardId] => 5715709195239424
[walletId] => apple
[methodCode] => app
[content] => eyJhcHBsaWNhdGlvbklkIjoiY29tLmFwcGxl...
[signature] => MEUCIQDp3GTGqsqDeKLN9aLhxAZ...
[metadata] => Array ( )
)
Java
IssuingTokenRequest({
"cardId": "5715709195239424",
"walletId": "apple",
"methodCode": "app",
"content": "eyJhcHBsaWNhdGlvbklkIjoiY29tLmFwcGxl...",
"signature": "MEUCIQDp3GTGqsqDeKLN9aLhxAZ...",
"metadata": {}
})
Ruby
issuingtokenrequest(
card_id: 5715709195239424,
wallet_id: apple,
method_code: app,
content: eyJhcHBsaWNhdGlvbklkIjoiY29tLmFwcGxl...,
signature: MEUCIQDp3GTGqsqDeKLN9aLhxAZ...,
metadata: {}
)
Elixir
%StarkInfra.IssuingTokenRequest{
card_id: "5715709195239424",
wallet_id: "apple",
method_code: "app",
content: "eyJhcHBsaWNhdGlvbklkIjoiY29tLmFwcGxl...",
signature: "MEUCIQDp3GTGqsqDeKLN9aLhxAZ...",
metadata: %{}
}
C#
IssuingTokenRequest(
CardId: 5715709195239424,
WalletId: apple,
MethodCode: app,
Content: eyJhcHBsaWNhdGlvbklkIjoiY29tLmFwcGxl...,
Signature: MEUCIQDp3GTGqsqDeKLN9aLhxAZ...,
Metadata: {}
)
Go
{
CardId:5715709195239424
WalletId:apple
MethodCode:app
Content:eyJhcHBsaWNhdGlvbklkIjoiY29tLmFwcGxl...
Signature:MEUCIQDp3GTGqsqDeKLN9aLhxAZ...
Metadata:map[]
}
Clojure
{:card-id "5715709195239424",
:wallet-id "apple",
:method-code "app",
:content "eyJhcHBsaWNhdGlvbklkIjoiY29tLmFwcGxl...",
:signature "MEUCIQDp3GTGqsqDeKLN9aLhxAZ...",
:metadata {}}
Curl
{
"request": {
"cardId": "5715709195239424",
"walletId": "apple",
"methodCode": "app",
"content": "eyJhcHBsaWNhdGlvbklkIjoiY29tLmFwcGxl...",
"signature": "MEUCIQDp3GTGqsqDeKLN9aLhxAZ...",
"metadata": {}
}
}
Issuing Token Design Overview
An Issuing Token Design controls how a card looks inside a digital wallet — it is the artwork displayed for an Issuing Token once an Issuing Card has been tokenized into Apple Pay or Google Pay.
You provide the artwork; Stark Infra provisions it. The card design itself comes from you, the sub-issuer: send your artwork to help@starkinfra.com and Stark Infra provisions it with your card networks and makes the resulting Token Design available to your workspace.
Read-only through the API. Token designs are not created, changed or deleted through the API. Once provisioned, the API only lets you list the designs available to your workspace, fetch one by its id, and download its artwork as a PDF.
What you get back. Each design is a thin record: an id you reference when requesting a token, a human-readable name (e.g. "Apple Pay Card Art"), and created / updated datetimes. The visual asset itself is not part of the JSON — fetch it through the PDF endpoint.
Listing Token Designs
List the token designs available to your workspace. Filter by "ids" to fetch specific designs, and page through results with "limit" (max 100) and "cursor".
Use the "id" of the design you want when requesting an Issuing Token, so the tokenized card shows the right artwork in the wallet.
Parameters
Python
import starkinfra
designs = starkinfra.issuingtokendesign.query(limit=10)
for design in designs:
print(design)
Javascript
const starkinfra = require('starkinfra');
(async() => {
let designs = await starkinfra.issuingTokenDesign.query({ limit: 10 });
for await (let design of designs) {
console.log(design);
}
})();
PHP
$designs = StarkInfra\IssuingTokenDesign::query(["limit" => 10]);
foreach ($designs as $design) {
print_r($design);
}
Java
import com.starkinfra.*; import java.util.HashMap; HashMapparams = new HashMap<>(); params.put("limit", 10); Generator designs = IssuingTokenDesign.query(params); for (IssuingTokenDesign design : designs) { System.out.println(design); }
Ruby
require('starkinfra')
designs = StarkInfra::IssuingTokenDesign.query(limit: 10)
designs.each do |design|
puts design
end
Elixir
designs = StarkInfra.IssuingTokenDesign.query!(limit: 10) designs |> Enum.each(&IO.inspect/1)
C#
using System; using System.Collections.Generic; IEnumerabledesigns = StarkInfra.IssuingTokenDesign.Query(limit: 10); foreach (StarkInfra.IssuingTokenDesign design in designs) { Console.WriteLine(design); }
Go
package main
import (
"fmt"
"github.com/starkinfra/sdk-go/starkinfra/issuingtokendesign"
)
func main() {
designs := issuingtokendesign.Query(
&issuingtokendesign.Query{Limit: 10},
nil,
)
for design := range designs {
fmt.Printf("%+v", design)
}
}
Clojure
(def designs
(starkinfra.issuing-token-design/query {:limit 10}))
(doseq [design designs]
(println design))
Curl
curl --location --request GET '{{baseUrl}}/v2/issuing-token-design?limit=10' \
--header 'Access-Id: {{accessId}}' \
--header 'Access-Time: {{accessTime}}' \
--header 'Access-Signature: {{accessSignature}}'
Python
IssuingTokenDesign(
id=5715709195239424,
name=Apple Pay Card Art,
created=2022-01-01 00:00:00,
updated=2022-01-01 00:00:00
)
Javascript
IssuingTokenDesign {
id: '5715709195239424',
name: 'Apple Pay Card Art',
created: '2022-01-01T00:00:00.000000+00:00',
updated: '2022-01-01T00:00:00.000000+00:00'
}
PHP
StarkInfra\IssuingTokenDesign Object
(
[id] => 5715709195239424
[name] => Apple Pay Card Art
[created] => DateTime Object ( [date] => 2022-01-01 00:00:00.000000 )
[updated] => DateTime Object ( [date] => 2022-01-01 00:00:00.000000 )
)
Java
IssuingTokenDesign({
"id": "5715709195239424",
"name": "Apple Pay Card Art",
"created": "2022-01-01T00:00:00.000000+00:00",
"updated": "2022-01-01T00:00:00.000000+00:00"
})
Ruby
issuingtokendesign(
id: 5715709195239424,
name: Apple Pay Card Art,
created: 2022-01-01T00:00:00+00:00,
updated: 2022-01-01T00:00:00+00:00
)
Elixir
%StarkInfra.IssuingTokenDesign{
id: "5715709195239424",
name: "Apple Pay Card Art",
created: "2022-01-01T00:00:00.000000+00:00",
updated: "2022-01-01T00:00:00.000000+00:00"
}
C#
IssuingTokenDesign(
Id: 5715709195239424,
Name: Apple Pay Card Art,
Created: 01/01/2022 00:00:00,
Updated: 01/01/2022 00:00:00
)
Go
{
Id:5715709195239424
Name:Apple Pay Card Art
Created:2022-01-01 00:00:00 +0000 +0000
Updated:2022-01-01 00:00:00 +0000 +0000
}
Clojure
{:id "5715709195239424",
:name "Apple Pay Card Art",
:created "2022-01-01T00:00:00.000000+00:00",
:updated "2022-01-01T00:00:00.000000+00:00"}
Curl
{
"cursor": null,
"designs": [
{
"id": "5715709195239424",
"name": "Apple Pay Card Art",
"created": "2022-01-01T00:00:00.000000+00:00",
"updated": "2022-01-01T00:00:00.000000+00:00"
}
]
}
Getting a Token Design
Fetch a single token design by its id. A design only resolves if it belongs to your sub-issuer — fetching another sub-issuer's design is rejected.
Parameters
Python
import starkinfra
design = starkinfra.issuingtokendesign.get("5715709195239424")
print(design)
Javascript
const starkinfra = require('starkinfra');
(async() => {
let design = await starkinfra.issuingTokenDesign.get('5715709195239424');
console.log(design);
})();
PHP
$design = StarkInfra\IssuingTokenDesign::get("5715709195239424");
print_r($design);
Java
import com.starkinfra.*;
IssuingTokenDesign design = IssuingTokenDesign.get("5715709195239424");
System.out.println(design);
Ruby
require('starkinfra')
design = StarkInfra::IssuingTokenDesign.get("5715709195239424")
puts design
Elixir
design = StarkInfra.IssuingTokenDesign.get!("5715709195239424")
IO.inspect(design)
C#
using System;
StarkInfra.IssuingTokenDesign design = StarkInfra.IssuingTokenDesign.Get("5715709195239424");
Console.WriteLine(design);
Go
package main
import (
"fmt"
"github.com/starkinfra/sdk-go/starkinfra/issuingtokendesign"
)
func main() {
design, err := issuingtokendesign.Get("5715709195239424", nil)
if err.Errors != nil {
for _, e := range err.Errors {
fmt.Printf("code: %s, message: %s", e.Code, e.Message)
}
}
fmt.Printf("%+v", design)
}
Clojure
(def design (starkinfra.issuing-token-design/get "5715709195239424")) (println design)
Curl
curl --location --request GET '{{baseUrl}}/v2/issuing-token-design/5715709195239424' \
--header 'Access-Id: {{accessId}}' \
--header 'Access-Time: {{accessTime}}' \
--header 'Access-Signature: {{accessSignature}}'
Python
IssuingTokenDesign(
id=5715709195239424,
name=Apple Pay Card Art,
created=2022-01-01 00:00:00,
updated=2022-01-01 00:00:00
)
Javascript
IssuingTokenDesign {
id: '5715709195239424',
name: 'Apple Pay Card Art',
created: '2022-01-01T00:00:00.000000+00:00',
updated: '2022-01-01T00:00:00.000000+00:00'
}
PHP
StarkInfra\IssuingTokenDesign Object
(
[id] => 5715709195239424
[name] => Apple Pay Card Art
[created] => DateTime Object ( [date] => 2022-01-01 00:00:00.000000 )
[updated] => DateTime Object ( [date] => 2022-01-01 00:00:00.000000 )
)
Java
IssuingTokenDesign({
"id": "5715709195239424",
"name": "Apple Pay Card Art",
"created": "2022-01-01T00:00:00.000000+00:00",
"updated": "2022-01-01T00:00:00.000000+00:00"
})
Ruby
issuingtokendesign(
id: 5715709195239424,
name: Apple Pay Card Art,
created: 2022-01-01T00:00:00+00:00,
updated: 2022-01-01T00:00:00+00:00
)
Elixir
%StarkInfra.IssuingTokenDesign{
id: "5715709195239424",
name: "Apple Pay Card Art",
created: "2022-01-01T00:00:00.000000+00:00",
updated: "2022-01-01T00:00:00.000000+00:00"
}
C#
IssuingTokenDesign(
Id: 5715709195239424,
Name: Apple Pay Card Art,
Created: 01/01/2022 00:00:00,
Updated: 01/01/2022 00:00:00
)
Go
{
Id:5715709195239424
Name:Apple Pay Card Art
Created:2022-01-01 00:00:00 +0000 +0000
Updated:2022-01-01 00:00:00 +0000 +0000
}
Clojure
{:id "5715709195239424",
:name "Apple Pay Card Art",
:created "2022-01-01T00:00:00.000000+00:00",
:updated "2022-01-01T00:00:00.000000+00:00"}
Curl
{
"design": {
"id": "5715709195239424",
"name": "Apple Pay Card Art",
"created": "2022-01-01T00:00:00.000000+00:00",
"updated": "2022-01-01T00:00:00.000000+00:00"
}
}
Downloading the Token Design PDF
Download the design's artwork as a PDF. This endpoint returns the raw binary file (no JSON wrapper), so save it straight to disk — with curl, use "--output" to write it to a file.
Parameters
Python
import starkinfra
pdf = starkinfra.issuingtokendesign.pdf("5715709195239424")
with open("token-design.pdf", "wb") as f:
f.write(pdf)
Javascript
const starkinfra = require('starkinfra');
const fs = require('fs');
(async() => {
let pdf = await starkinfra.issuingTokenDesign.pdf('5715709195239424');
fs.writeFileSync('token-design.pdf', pdf);
})();
PHP
$pdf = StarkInfra\IssuingTokenDesign::pdf("5715709195239424");
file_put_contents("token-design.pdf", $pdf);
Java
import com.starkinfra.*;
import java.io.FileOutputStream;
byte[] pdf = IssuingTokenDesign.pdf("5715709195239424");
FileOutputStream fos = new FileOutputStream("token-design.pdf");
fos.write(pdf);
fos.close();
Ruby
require('starkinfra')
pdf = StarkInfra::IssuingTokenDesign.pdf("5715709195239424")
File.binwrite("token-design.pdf", pdf)
Elixir
pdf = StarkInfra.IssuingTokenDesign.pdf!("5715709195239424")
File.write!("token-design.pdf", pdf)
C#
using System.IO;
byte[] pdf = StarkInfra.IssuingTokenDesign.Pdf("5715709195239424");
File.WriteAllBytes("token-design.pdf", pdf);
Go
package main
import (
"os"
"github.com/starkinfra/sdk-go/starkinfra/issuingtokendesign"
)
func main() {
pdf, err := issuingtokendesign.Pdf("5715709195239424", nil)
if err.Errors != nil {
panic(err)
}
os.WriteFile("token-design.pdf", pdf, 0644)
}
Clojure
(def pdf (starkinfra.issuing-token-design/pdf "5715709195239424")) (clojure.java.io/copy pdf (clojure.java.io/file "token-design.pdf"))
Curl
curl --location --request GET '{{baseUrl}}/v2/issuing-token-design/5715709195239424/pdf' \
--header 'Access-Id: {{accessId}}' \
--header 'Access-Time: {{accessTime}}' \
--header 'Access-Signature: {{accessSignature}}' \
--output token-design.pdf
Python
b'%PDF-1.4 ...' # Binary PDF content
Javascript
// Binary PDF content
PHP
// Binary PDF content written to token-design.pdf
Java
// Binary PDF content written to token-design.pdf
Ruby
# Binary PDF content written to token-design.pdf
Elixir
# Binary PDF content written to token-design.pdf
C#
// Binary PDF content written to token-design.pdf
Go
// Binary PDF content written to token-design.pdf
Clojure
;; Binary PDF content written to token-design.pdf
Curl
// Binary PDF content saved to token-design.pdf
Handling Purchase Events
In this section we're going deeper with the Issuing Purchase Events, that will allow you to handle the scenarios mentioned earlier.
First of all, you need to create a Webhook endpoint with issuing-purchase subscription.
Creating a Webhook
Parameters
Python
import starkinfra
webhook = starkinfra.webhook.create(
url="https://winterfell.westeros.gov/events-from-stark-infra",
subscriptions=[
"issuing-purchase",
]
)
print(webhook)
Javascript
const starkinfra = require('starkinfra');
(async() => {
let webhook = await starkinfra.webhook.create({
url: 'https://winterfell.westeros.gov/events-from-stark-infra',
subscriptions: ["issuing-purchase"],
});
console.log(webhook);
})();
PHP
use StarkInfra\Webhook;
$webhook = Webhook::create(
new Webhook(
"url" => "https://winterfell.westeros.gov/events-from-stark-infra",
"subscriptions" =>["issuing-purchase"]
);
);
print_r($webhook);
Java
import com.starkinfra.*; import java.util.HashMap; HashMapdata = new HashMap<>(); data.put("url", "https://winterfell.westeros.gov/events-from-stark-infra"); data.put("subscriptions", new String[]{"issuing-purchase"}); Webhook webhook = Webhook.create(data); System.out.println(webhook);
Ruby
require('starkinfra')
webhook = StarkInfra::Webhook.create(
StarkInfra::Webhook.new(
url: 'https://webhook.site/dd784f26-1d6a-4ca6-81cb-fda0267761ec',
subscriptions: %w[pix-infraction pix-chargeback]
)
)
puts webhook
Elixir
webhook = StarkInfra.Webhook.create!(
url: "https://winterfell.westeros.gov/events-from-stark-infra",
subscriptions: [
"issuing-purchase",
]
)
webhook |> IO.inspect
C#
using System;
using System.Collections.Generic;
StarkInfra.Webhook webhook = StarkInfra.Webhook.Create(
url: "https://winterfell.westeros.gov/events-from-stark-infra",
subscriptions: new List { "issuing-purchase" }
);
Console.WriteLine(webhook);
Go
package main
import (
"fmt"
"github.com/starkinfra/sdk-go/starkinfra/webhook"
)
func main() {
webhook, err := webhook.Create(
webhook.Webhook{
Url: "https://winterfell.westeros.gov/events-from-stark-infra",
Subscriptions: []string{"issuing-purchase"},
}, nil)
if err.Errors != nil {
for _, e := range err.Errors {
fmt.Printf("code: %s, message: %s", e.Code, e.Message)
}
}
fmt.Printf("%+v", webhook)
}
Clojure
Not yet available. Please contact us if you need this SDK.
Curl
Python
Webhook(
id=6081803731337216,
subscriptions=["issuing-purchase"],
url=https://winterfell.westeros.gov/events-from-stark-infra
)
Javascript
Webhook(
id: 6081803731337216,
subscriptions: ["issuing-purchase"],
url: 'https://winterfell.westeros.gov/events-from-stark-infra'
)
PHP
StarkInfra\Webhook
(
[id] => 6081803731337216,
[subscriptions] => ["issuing-purchase"],
[url] => 'https://winterfell.westeros.gov/events-from-stark-infra'
)
Java
Webhook({
"url": "https://winterfell.westeros.gov/events-from-stark-infra",
"subscriptions": [
"issuing-purchase",
],
"id": "5717667948265472"
})
Ruby
webhook(
id: 6068989562191872,
url: https://winterfell.westeros.gov/events-from-stark-infra,
subscriptions: ["issuing-purchase"]
)
Elixir
%StarkInfra.Webhook{
id: "6081803731337216",
url: "https://winterfell.westeros.gov/events-from-stark-infra",
subscriptions: [
"issuing-purchase"
]
}
C#
Webhook(
Url: https://winterfell.westeros.gov/events-from-stark-infra,
Subscriptions: { issuing-purchase },
ID: 6081803731337216
)
Go
{
Url:https://winterfell.westeros.gov/events-from-stark-infra
Subscriptions:[issuing-purchase]
Id:6081803731337216
}
Clojure
Not yet available. Please contact us if you need this SDK.
Curl
Receiving Events
Once created, you'll start to receive the Events at the informed URL. The Event will look like this:
Parameters
Python
{
"event": {
"created": "2022-09-29T19:34:50.798935+00:00",
"id": "4673184305512448",
"log": {
"created": "2022-09-29T19:34:50.302804+00:00",
"errors": [],
"id": "5946009943277568",
"issuingTransactionId": "6227484919988224",
"purchase": {
"acquirerId": "557045",
"amount": 10000,
"cardEnding": "1787",
"cardId": "5975559855144960",
"created": "2022-09-29T19:34:50.151607+00:00",
"description": "",
"endToEndId": "60ae1ddd-ebb0-432f-88c7-ac8014ee3c5f",
"holderName": "TONY STARK",
"id": "5101585013145600",
"issuerAmount": 10000,
"issuerCurrencyCode": "BRL",
"issuerCurrencySymbol": "R$",
"issuingTransactionIds": [
"6227484919988224"
],
"merchantAmount": 10000,
"merchantCategoryCode": "miscellaneousBusinessServices",
"merchantCategoryType": "services",
"merchantCountryCode": "BRA",
"merchantCurrencyCode": "BRL",
"merchantCurrencySymbol": "R$",
"merchantFee": 0,
"merchantId": "731138412121896",
"merchantName": "GOOGLE CLOUD PLATFORM",
"methodCode": "manual",
"purpose": "purchase",
"score": 0.9992851125568876,
"status": "approved",
"tags": [
"tony",
"stark"
],
"tax": 0,
"updated": "2022-09-29T19:34:50.302847+00:00",
"walletId": "",
"zipCode": "902101234"
},
"type": "approved"
},
"subscription": "issuing-purchase",
"workspaceId": "5506710584164352"
}
}
Javascript
{
"event": {
"created": "2022-09-29T19:34:50.798935+00:00",
"id": "4673184305512448",
"log": {
"created": "2022-09-29T19:34:50.302804+00:00",
"errors": [],
"id": "5946009943277568",
"issuingTransactionId": "6227484919988224",
"purchase": {
"acquirerId": "557045",
"amount": 10000,
"cardEnding": "1787",
"cardId": "5975559855144960",
"created": "2022-09-29T19:34:50.151607+00:00",
"description": "",
"endToEndId": "60ae1ddd-ebb0-432f-88c7-ac8014ee3c5f",
"holderName": "TONY STARK",
"id": "5101585013145600",
"issuerAmount": 10000,
"issuerCurrencyCode": "BRL",
"issuerCurrencySymbol": "R$",
"issuingTransactionIds": [
"6227484919988224"
],
"merchantAmount": 10000,
"merchantCategoryCode": "miscellaneousBusinessServices",
"merchantCategoryType": "services",
"merchantCountryCode": "BRA",
"merchantCurrencyCode": "BRL",
"merchantCurrencySymbol": "R$",
"merchantFee": 0,
"merchantId": "731138412121896",
"merchantName": "GOOGLE CLOUD PLATFORM",
"methodCode": "manual",
"purpose": "purchase",
"score": 0.9992851125568876,
"status": "approved",
"tags": [
"tony",
"stark"
],
"tax": 0,
"updated": "2022-09-29T19:34:50.302847+00:00",
"walletId": "",
"zipCode": "902101234"
},
"type": "approved"
},
"subscription": "issuing-purchase",
"workspaceId": "5506710584164352"
}
}
PHP
{
"event": {
"created": "2022-09-29T19:34:50.798935+00:00",
"id": "4673184305512448",
"log": {
"created": "2022-09-29T19:34:50.302804+00:00",
"errors": [],
"id": "5946009943277568",
"issuingTransactionId": "6227484919988224",
"purchase": {
"acquirerId": "557045",
"amount": 10000,
"cardEnding": "1787",
"cardId": "5975559855144960",
"created": "2022-09-29T19:34:50.151607+00:00",
"description": "",
"endToEndId": "60ae1ddd-ebb0-432f-88c7-ac8014ee3c5f",
"holderName": "TONY STARK",
"id": "5101585013145600",
"issuerAmount": 10000,
"issuerCurrencyCode": "BRL",
"issuerCurrencySymbol": "R$",
"issuingTransactionIds": [
"6227484919988224"
],
"merchantAmount": 10000,
"merchantCategoryCode": "miscellaneousBusinessServices",
"merchantCategoryType": "services",
"merchantCountryCode": "BRA",
"merchantCurrencyCode": "BRL",
"merchantCurrencySymbol": "R$",
"merchantFee": 0,
"merchantId": "731138412121896",
"merchantName": "GOOGLE CLOUD PLATFORM",
"methodCode": "manual",
"purpose": "purchase",
"score": 0.9992851125568876,
"status": "approved",
"tags": [
"tony",
"stark"
],
"tax": 0,
"updated": "2022-09-29T19:34:50.302847+00:00",
"walletId": "",
"zipCode": "902101234"
},
"type": "approved"
},
"subscription": "issuing-purchase",
"workspaceId": "5506710584164352"
}
}
Java
{
"event": {
"created": "2022-09-29T19:34:50.798935+00:00",
"id": "4673184305512448",
"log": {
"created": "2022-09-29T19:34:50.302804+00:00",
"errors": [],
"id": "5946009943277568",
"issuingTransactionId": "6227484919988224",
"purchase": {
"acquirerId": "557045",
"amount": 10000,
"cardEnding": "1787",
"cardId": "5975559855144960",
"created": "2022-09-29T19:34:50.151607+00:00",
"description": "",
"endToEndId": "60ae1ddd-ebb0-432f-88c7-ac8014ee3c5f",
"holderName": "TONY STARK",
"id": "5101585013145600",
"issuerAmount": 10000,
"issuerCurrencyCode": "BRL",
"issuerCurrencySymbol": "R$",
"issuingTransactionIds": [
"6227484919988224"
],
"merchantAmount": 10000,
"merchantCategoryCode": "miscellaneousBusinessServices",
"merchantCategoryType": "services",
"merchantCountryCode": "BRA",
"merchantCurrencyCode": "BRL",
"merchantCurrencySymbol": "R$",
"merchantFee": 0,
"merchantId": "731138412121896",
"merchantName": "GOOGLE CLOUD PLATFORM",
"methodCode": "manual",
"purpose": "purchase",
"score": 0.9992851125568876,
"status": "approved",
"tags": [
"tony",
"stark"
],
"tax": 0,
"updated": "2022-09-29T19:34:50.302847+00:00",
"walletId": "",
"zipCode": "902101234"
},
"type": "approved"
},
"subscription": "issuing-purchase",
"workspaceId": "5506710584164352"
}
}
Ruby
{
"event": {
"created": "2022-09-29T19:34:50.798935+00:00",
"id": "4673184305512448",
"log": {
"created": "2022-09-29T19:34:50.302804+00:00",
"errors": [],
"id": "5946009943277568",
"issuingTransactionId": "6227484919988224",
"purchase": {
"acquirerId": "557045",
"amount": 10000,
"cardEnding": "1787",
"cardId": "5975559855144960",
"created": "2022-09-29T19:34:50.151607+00:00",
"description": "",
"endToEndId": "60ae1ddd-ebb0-432f-88c7-ac8014ee3c5f",
"holderName": "TONY STARK",
"id": "5101585013145600",
"issuerAmount": 10000,
"issuerCurrencyCode": "BRL",
"issuerCurrencySymbol": "R$",
"issuingTransactionIds": [
"6227484919988224"
],
"merchantAmount": 10000,
"merchantCategoryCode": "miscellaneousBusinessServices",
"merchantCategoryType": "services",
"merchantCountryCode": "BRA",
"merchantCurrencyCode": "BRL",
"merchantCurrencySymbol": "R$",
"merchantFee": 0,
"merchantId": "731138412121896",
"merchantName": "GOOGLE CLOUD PLATFORM",
"methodCode": "manual",
"purpose": "purchase",
"score": 0.9992851125568876,
"status": "approved",
"tags": [
"tony",
"stark"
],
"tax": 0,
"updated": "2022-09-29T19:34:50.302847+00:00",
"walletId": "",
"zipCode": "902101234"
},
"type": "approved"
},
"subscription": "issuing-purchase",
"workspaceId": "5506710584164352"
}
}
Elixir
{
"event": {
"created": "2022-09-29T19:34:50.798935+00:00",
"id": "4673184305512448",
"log": {
"created": "2022-09-29T19:34:50.302804+00:00",
"errors": [],
"id": "5946009943277568",
"issuingTransactionId": "6227484919988224",
"purchase": {
"acquirerId": "557045",
"amount": 10000,
"cardEnding": "1787",
"cardId": "5975559855144960",
"created": "2022-09-29T19:34:50.151607+00:00",
"description": "",
"endToEndId": "60ae1ddd-ebb0-432f-88c7-ac8014ee3c5f",
"holderName": "TONY STARK",
"id": "5101585013145600",
"issuerAmount": 10000,
"issuerCurrencyCode": "BRL",
"issuerCurrencySymbol": "R$",
"issuingTransactionIds": [
"6227484919988224"
],
"merchantAmount": 10000,
"merchantCategoryCode": "miscellaneousBusinessServices",
"merchantCategoryType": "services",
"merchantCountryCode": "BRA",
"merchantCurrencyCode": "BRL",
"merchantCurrencySymbol": "R$",
"merchantFee": 0,
"merchantId": "731138412121896",
"merchantName": "GOOGLE CLOUD PLATFORM",
"methodCode": "manual",
"purpose": "purchase",
"score": 0.9992851125568876,
"status": "approved",
"tags": [
"tony",
"stark"
],
"tax": 0,
"updated": "2022-09-29T19:34:50.302847+00:00",
"walletId": "",
"zipCode": "902101234"
},
"type": "approved"
},
"subscription": "issuing-purchase",
"workspaceId": "5506710584164352"
}
}
C#
{
"event": {
"created": "2022-09-29T19:34:50.798935+00:00",
"id": "4673184305512448",
"log": {
"created": "2022-09-29T19:34:50.302804+00:00",
"errors": [],
"id": "5946009943277568",
"issuingTransactionId": "6227484919988224",
"purchase": {
"acquirerId": "557045",
"amount": 10000,
"cardEnding": "1787",
"cardId": "5975559855144960",
"created": "2022-09-29T19:34:50.151607+00:00",
"description": "",
"endToEndId": "60ae1ddd-ebb0-432f-88c7-ac8014ee3c5f",
"holderName": "TONY STARK",
"id": "5101585013145600",
"issuerAmount": 10000,
"issuerCurrencyCode": "BRL",
"issuerCurrencySymbol": "R$",
"issuingTransactionIds": [
"6227484919988224"
],
"merchantAmount": 10000,
"merchantCategoryCode": "miscellaneousBusinessServices",
"merchantCategoryType": "services",
"merchantCountryCode": "BRA",
"merchantCurrencyCode": "BRL",
"merchantCurrencySymbol": "R$",
"merchantFee": 0,
"merchantId": "731138412121896",
"merchantName": "GOOGLE CLOUD PLATFORM",
"methodCode": "manual",
"purpose": "purchase",
"score": 0.9992851125568876,
"status": "approved",
"tags": [
"tony",
"stark"
],
"tax": 0,
"updated": "2022-09-29T19:34:50.302847+00:00",
"walletId": "",
"zipCode": "902101234"
},
"type": "approved"
},
"subscription": "issuing-purchase",
"workspaceId": "5506710584164352"
}
}
Go
{
"event": {
"created": "2022-09-29T19:34:50.798935+00:00",
"id": "4673184305512448",
"log": {
"created": "2022-09-29T19:34:50.302804+00:00",
"errors": [],
"id": "5946009943277568",
"issuingTransactionId": "6227484919988224",
"purchase": {
"acquirerId": "557045",
"amount": 10000,
"cardEnding": "1787",
"cardId": "5975559855144960",
"created": "2022-09-29T19:34:50.151607+00:00",
"description": "",
"endToEndId": "60ae1ddd-ebb0-432f-88c7-ac8014ee3c5f",
"holderName": "TONY STARK",
"id": "5101585013145600",
"issuerAmount": 10000,
"issuerCurrencyCode": "BRL",
"issuerCurrencySymbol": "R$",
"issuingTransactionIds": [
"6227484919988224"
],
"merchantAmount": 10000,
"merchantCategoryCode": "miscellaneousBusinessServices",
"merchantCategoryType": "services",
"merchantCountryCode": "BRA",
"merchantCurrencyCode": "BRL",
"merchantCurrencySymbol": "R$",
"merchantFee": 0,
"merchantId": "731138412121896",
"merchantName": "GOOGLE CLOUD PLATFORM",
"methodCode": "manual",
"purpose": "purchase",
"score": 0.9992851125568876,
"status": "approved",
"tags": [
"tony",
"stark"
],
"tax": 0,
"updated": "2022-09-29T19:34:50.302847+00:00",
"walletId": "",
"zipCode": "902101234"
},
"type": "approved"
},
"subscription": "issuing-purchase",
"workspaceId": "5506710584164352"
}
}
Clojure
{
"event": {
"created": "2022-09-29T19:34:50.798935+00:00",
"id": "4673184305512448",
"log": {
"created": "2022-09-29T19:34:50.302804+00:00",
"errors": [],
"id": "5946009943277568",
"issuingTransactionId": "6227484919988224",
"purchase": {
"acquirerId": "557045",
"amount": 10000,
"cardEnding": "1787",
"cardId": "5975559855144960",
"created": "2022-09-29T19:34:50.151607+00:00",
"description": "",
"endToEndId": "60ae1ddd-ebb0-432f-88c7-ac8014ee3c5f",
"holderName": "TONY STARK",
"id": "5101585013145600",
"issuerAmount": 10000,
"issuerCurrencyCode": "BRL",
"issuerCurrencySymbol": "R$",
"issuingTransactionIds": [
"6227484919988224"
],
"merchantAmount": 10000,
"merchantCategoryCode": "miscellaneousBusinessServices",
"merchantCategoryType": "services",
"merchantCountryCode": "BRA",
"merchantCurrencyCode": "BRL",
"merchantCurrencySymbol": "R$",
"merchantFee": 0,
"merchantId": "731138412121896",
"merchantName": "GOOGLE CLOUD PLATFORM",
"methodCode": "manual",
"purpose": "purchase",
"score": 0.9992851125568876,
"status": "approved",
"tags": [
"tony",
"stark"
],
"tax": 0,
"updated": "2022-09-29T19:34:50.302847+00:00",
"walletId": "",
"zipCode": "902101234"
},
"type": "approved"
},
"subscription": "issuing-purchase",
"workspaceId": "5506710584164352"
}
}
Curl
{
"event": {
"created": "2022-09-29T19:34:50.798935+00:00",
"id": "4673184305512448",
"log": {
"created": "2022-09-29T19:34:50.302804+00:00",
"errors": [],
"id": "5946009943277568",
"issuingTransactionId": "6227484919988224",
"purchase": {
"acquirerId": "557045",
"amount": 10000,
"cardEnding": "1787",
"cardId": "5975559855144960",
"created": "2022-09-29T19:34:50.151607+00:00",
"description": "",
"endToEndId": "60ae1ddd-ebb0-432f-88c7-ac8014ee3c5f",
"holderName": "TONY STARK",
"id": "5101585013145600",
"issuerAmount": 10000,
"issuerCurrencyCode": "BRL",
"issuerCurrencySymbol": "R$",
"issuingTransactionIds": [
"6227484919988224"
],
"merchantAmount": 10000,
"merchantCategoryCode": "miscellaneousBusinessServices",
"merchantCategoryType": "services",
"merchantCountryCode": "BRA",
"merchantCurrencyCode": "BRL",
"merchantCurrencySymbol": "R$",
"merchantFee": 0,
"merchantId": "731138412121896",
"merchantName": "GOOGLE CLOUD PLATFORM",
"methodCode": "manual",
"purpose": "purchase",
"score": 0.9992851125568876,
"status": "approved",
"tags": [
"tony",
"stark"
],
"tax": 0,
"updated": "2022-09-29T19:34:50.302847+00:00",
"walletId": "",
"zipCode": "902101234"
},
"type": "approved"
},
"subscription": "issuing-purchase",
"workspaceId": "5506710584164352"
}
}
Parsing Events
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.
Listening to Issuing Purchase Events After answering a Issuing Purchase authorization request, you can use asynchronous Webhooks to monitor status changes of the entity. Issuing Purchases will follow the following life cycle:

Every time we change an Issuing Purchase, we create a Log. Logs are pretty useful for understanding the life cycle of each Issuing Purchase. Whenever a new Log is created, we will fire a Webhook to your registered URL. Check out this diagram to understand the possible Issuing Purchase Logs:

Parameters
Python
import starkinfra
request = listen() # this is the method you made to get the events posted to your webhook endpoint
event = starkinfra.event.parse(
content=request.data.decode("utf-8"),
signature=request.headers["Digital-Signature"],
)
if "issuing-purchase" in event.subscription:
print(event.log.purchase)
Javascript
const starkinfra = require('starkinfra');
const express = require('express')
const app = express()
app.use(express.raw({type: '*/*'}));
const port = 3000
app.post('/', async (req, res) => {
try {
let event = await starkinfra.event.parse({
content: req.body.toString(),
signature: req.headers['digital-signature']
});
if (event.subscription.includes('pix-request')) {
console.log(event.log.request);
} else if (event.subscription.includes('pix-reversal')) {
console.log(event.log.reversal);
} else if (event.subscription.includes('issuing-card')) {
console.log(event.log.reversal);
} else if (event.subscription.includes('issuing-invoice')) {
console.log(event.log.reversal);
} else if (event.subscription.includes('issuing-embossing')) {
console.log(event.log.reversal);
} else if (event.subscription.includes('issuing-purchase')) {
console.log(event.log.reversal);
res.end()
}
}
catch (err) {
console.log(err)
res.status(400).end()
}
})
app.listen(port, () => console.log(`Example app listening at http://localhost:${port}`))
PHP
use StarkInfra\Event;
$response = listen() # this is the method you made to get the events posted to your webhook
$event = Event::parse($response->content, $response->headers["Digital-Signature"]);
if ($event->subscription == "pix-request.in"){
print_r($event->log->request);
} elseif ($event->subscription == "pix-claim"){
print_r($event->log->claim);
} elseif ($event->subscription == "pix-key"){
print_r($event->log->key);
} elseif ($event->subscription == "pix-infraction"){
print_r($event->log->infraction);
} elseif ($event->subscription == "pix-chargeback"){
print_r($event->log->chargeback);
} elseif ($event->subscription == "pix-request.out"){
print_r($event->log->request);
} elseif ($event->subscription == "pix-reversal.in"){
print_r($event->log->reversal);
} elseif ($event->subscription == "pix-reversal.out"){
print_r($event->log->reversal);
} elseif ($event->subscription == "issuing-card"){
print_r($event->log->card);
} elseif ($event->subscription == "issuing-invoice"){
print_r($event->log->invoice);
} elseif ($event->subscription == "issuing-purchase"){
print_r($event->log->purchase);
}
Java
import com.starkinfra.*;
Request request = Listener.listen(); // this is the method you made to get the events posted to your webhook
String content = request.content.toString();
String signature = request.headers.get("Digital-Signature");
Event event = Event.parse(content, signature);
if (event.subscription.contains("pix-request")) {
PixRequest.Log log = ((Event.PixRequestEvent) event).log;
System.out.println(log.request);
}
else if (event.subscription.contains("pix-reversal")) {
PixReversal.Log log = ((Event.PixReversalEvent) event).log;
System.out.println(log.reversal);
}
else if (event.subscription.contains("issuing-card")) {
IssuingCard.Log log = ((Event.IssuingCardEvent) event).log;
System.out.println(log.card);
}
else if (event.subscription.contains("issuing-invoice")) {
IssuingInvoice.Log log = ((Event.IssuingInvoiceEvent) event).log;
System.out.println(log.invoice);
}
else if (event.subscription.contains("issuing-purchase")) {
IssuingPurchase.Log log = ((Event.IssuingPurchaseEvent) event).log;
System.out.println(log.purchase);
}
else if (event.subscription.contains("credit-note")) {
CreditNote.Log log = ((Event.CreditNoteEvent) event).log;
System.out.println(log.note);
}
Ruby
require('starkinfra')
response = listen() # this is the method you made to get the events posted to your webhook endpoint
event = StarkInfra::Event.parse(
content: response.data.decode('utf-8'),
signature: response.headers['Digital-Signature'],
)
if event.subscription.include? 'pix-request'
puts event.log.request
elsif event.subscription.include? 'pix-reversal'
puts event.log.reversal
elsif event.subscription == 'pix-key'
puts event.log.key
elsif event.subscription == 'pix-claim'
puts event.log.claim
elsif event.subscription == 'pix-infraction'
puts event.log.infraction
elsif event.subscription == 'pix-chargeback'
puts event.log.chargeback
elsif event.subscription == 'credit-note'
puts event.log.note
elsif event.subscription == 'issuing-card'
puts event.log.card
elsif event.subscription == 'issuing-invoice'
puts event.log.invoice
elsif event.subscription == 'issuing-purchase'
puts event.log.purchase
end
Elixir
response = listen() # this is the method you made to get the events posted to your webhook endpoint
{event, cache_pid} = StarkInfra.Event.parse!(
content: response.content,
signature: response.headers["Digital-Signature"]
)
if event.subscription == "issuing-purchase" do
event.log.purchase |> IO.inspect
end
C#
using System;
Response response = listen(); // this is the method you made to get the events posted to your webhook endpoint
StarkInfra.Event parsedEvent = StarkInfra.Event.Parse(
content: response.Content,
signature: response.Headers["Digital-Signature"]
);
if (parsedEvent.Subscription == "issuing-purchase") {
StarkInfra.IssuingPurchase.Log log = parsedEvent.Log as StarkInfra.IssuingPurchase.Log;
Console.WriteLine(log.Purchase);
}
Go
package main
import (
"fmt"
"github.com/starkinfra/sdk-go/starkinfra/event"
)
func main() {
response := listen() // this is the method you made to get the events posted to your webhook endpoint
parsedEvent := event.Parse(
response.Content,
response.Headers["Digital-Signature"],
nil,
)
if parsedEvent.Subscription == "issuing-purchase" {
fmt.Printf("%+v", parsedEvent.Log.Purchase)
}
}
Clojure
Not yet available. Please contact us if you need this SDK.
Curl
Success Webhook Example
4.1. Success Webhook Example
Parameters
Python
{
"event": {
"created": "2022-09-29T19:34:50.798935+00:00",
"id": "4673184305512448",
"log": {
"created": "2022-09-29T19:34:50.302804+00:00",
"errors": [],
"id": "5946009943277568",
"issuingTransactionId": "6227484919988224",
"purchase": {
"acquirerId": "557045",
"amount": 10000,
"cardEnding": "1787",
"cardId": "5975559855144960",
"created": "2022-09-29T19:34:50.151607+00:00",
"description": "",
"endToEndId": "60ae1ddd-ebb0-432f-88c7-ac8014ee3c5f",
"holderName": "TONY STARK",
"id": "5101585013145600",
"issuerAmount": 10000,
"issuerCurrencyCode": "BRL",
"issuerCurrencySymbol": "R$",
"issuingTransactionIds": [
"6227484919988224"
],
"merchantAmount": 10000,
"merchantCategoryCode": "miscellaneousBusinessServices",
"merchantCategoryType": "services",
"merchantCountryCode": "BRA",
"merchantCurrencyCode": "BRL",
"merchantCurrencySymbol": "R$",
"merchantFee": 0,
"merchantId": "731138412121896",
"merchantName": "GOOGLE CLOUD PLATFORM",
"methodCode": "manual",
"purpose": "purchase",
"score": 0.9992851125568876,
"status": "approved",
"tags": [
"tony",
"stark"
],
"tax": 0,
"updated": "2022-09-29T19:34:50.302847+00:00",
"walletId": "",
"zipCode": "902101234"
},
"type": "approved"
},
"subscription": "issuing-purchase",
"workspaceId": "5506710588664374"
}
}
Javascript
{
"event": {
"created": "2022-09-29T19:34:50.798935+00:00",
"id": "4673184305512448",
"log": {
"created": "2022-09-29T19:34:50.302804+00:00",
"errors": [],
"id": "5946009943277568",
"issuingTransactionId": "6227484919988224",
"purchase": {
"acquirerId": "557045",
"amount": 10000,
"cardEnding": "1787",
"cardId": "5975559855144960",
"created": "2022-09-29T19:34:50.151607+00:00",
"description": "",
"endToEndId": "60ae1ddd-ebb0-432f-88c7-ac8014ee3c5f",
"holderName": "TONY STARK",
"id": "5101585013145600",
"issuerAmount": 10000,
"issuerCurrencyCode": "BRL",
"issuerCurrencySymbol": "R$",
"issuingTransactionIds": [
"6227484919988224"
],
"merchantAmount": 10000,
"merchantCategoryCode": "miscellaneousBusinessServices",
"merchantCategoryType": "services",
"merchantCountryCode": "BRA",
"merchantCurrencyCode": "BRL",
"merchantCurrencySymbol": "R$",
"merchantFee": 0,
"merchantId": "731138412121896",
"merchantName": "GOOGLE CLOUD PLATFORM",
"methodCode": "manual",
"purpose": "purchase",
"score": 0.9992851125568876,
"status": "approved",
"tags": [
"tony",
"stark"
],
"tax": 0,
"updated": "2022-09-29T19:34:50.302847+00:00",
"walletId": "",
"zipCode": "902101234"
},
"type": "approved"
},
"subscription": "issuing-purchase",
"workspaceId": "5506710588664374"
}
}
PHP
{
"event": {
"created": "2022-09-29T19:34:50.798935+00:00",
"id": "4673184305512448",
"log": {
"created": "2022-09-29T19:34:50.302804+00:00",
"errors": [],
"id": "5946009943277568",
"issuingTransactionId": "6227484919988224",
"purchase": {
"acquirerId": "557045",
"amount": 10000,
"cardEnding": "1787",
"cardId": "5975559855144960",
"created": "2022-09-29T19:34:50.151607+00:00",
"description": "",
"endToEndId": "60ae1ddd-ebb0-432f-88c7-ac8014ee3c5f",
"holderName": "TONY STARK",
"id": "5101585013145600",
"issuerAmount": 10000,
"issuerCurrencyCode": "BRL",
"issuerCurrencySymbol": "R$",
"issuingTransactionIds": [
"6227484919988224"
],
"merchantAmount": 10000,
"merchantCategoryCode": "miscellaneousBusinessServices",
"merchantCategoryType": "services",
"merchantCountryCode": "BRA",
"merchantCurrencyCode": "BRL",
"merchantCurrencySymbol": "R$",
"merchantFee": 0,
"merchantId": "731138412121896",
"merchantName": "GOOGLE CLOUD PLATFORM",
"methodCode": "manual",
"purpose": "purchase",
"score": 0.9992851125568876,
"status": "approved",
"tags": [
"tony",
"stark"
],
"tax": 0,
"updated": "2022-09-29T19:34:50.302847+00:00",
"walletId": "",
"zipCode": "902101234"
},
"type": "approved"
},
"subscription": "issuing-purchase",
"workspaceId": "5506710588664374"
}
}
Java
{
"event": {
"created": "2022-09-29T19:34:50.798935+00:00",
"id": "4673184305512448",
"log": {
"created": "2022-09-29T19:34:50.302804+00:00",
"errors": [],
"id": "5946009943277568",
"issuingTransactionId": "6227484919988224",
"purchase": {
"acquirerId": "557045",
"amount": 10000,
"cardEnding": "1787",
"cardId": "5975559855144960",
"created": "2022-09-29T19:34:50.151607+00:00",
"description": "",
"endToEndId": "60ae1ddd-ebb0-432f-88c7-ac8014ee3c5f",
"holderName": "TONY STARK",
"id": "5101585013145600",
"issuerAmount": 10000,
"issuerCurrencyCode": "BRL",
"issuerCurrencySymbol": "R$",
"issuingTransactionIds": [
"6227484919988224"
],
"merchantAmount": 10000,
"merchantCategoryCode": "miscellaneousBusinessServices",
"merchantCategoryType": "services",
"merchantCountryCode": "BRA",
"merchantCurrencyCode": "BRL",
"merchantCurrencySymbol": "R$",
"merchantFee": 0,
"merchantId": "731138412121896",
"merchantName": "GOOGLE CLOUD PLATFORM",
"methodCode": "manual",
"purpose": "purchase",
"score": 0.9992851125568876,
"status": "approved",
"tags": [
"tony",
"stark"
],
"tax": 0,
"updated": "2022-09-29T19:34:50.302847+00:00",
"walletId": "",
"zipCode": "902101234"
},
"type": "approved"
},
"subscription": "issuing-purchase",
"workspaceId": "5506710588664374"
}
}
Ruby
{
"event": {
"created": "2022-09-29T19:34:50.798935+00:00",
"id": "4673184305512448",
"log": {
"created": "2022-09-29T19:34:50.302804+00:00",
"errors": [],
"id": "5946009943277568",
"issuingTransactionId": "6227484919988224",
"purchase": {
"acquirerId": "557045",
"amount": 10000,
"cardEnding": "1787",
"cardId": "5975559855144960",
"created": "2022-09-29T19:34:50.151607+00:00",
"description": "",
"endToEndId": "60ae1ddd-ebb0-432f-88c7-ac8014ee3c5f",
"holderName": "TONY STARK",
"id": "5101585013145600",
"issuerAmount": 10000,
"issuerCurrencyCode": "BRL",
"issuerCurrencySymbol": "R$",
"issuingTransactionIds": [
"6227484919988224"
],
"merchantAmount": 10000,
"merchantCategoryCode": "miscellaneousBusinessServices",
"merchantCategoryType": "services",
"merchantCountryCode": "BRA",
"merchantCurrencyCode": "BRL",
"merchantCurrencySymbol": "R$",
"merchantFee": 0,
"merchantId": "731138412121896",
"merchantName": "GOOGLE CLOUD PLATFORM",
"methodCode": "manual",
"purpose": "purchase",
"score": 0.9992851125568876,
"status": "approved",
"tags": [
"tony",
"stark"
],
"tax": 0,
"updated": "2022-09-29T19:34:50.302847+00:00",
"walletId": "",
"zipCode": "902101234"
},
"type": "approved"
},
"subscription": "issuing-purchase",
"workspaceId": "5506710588664374"
}
}
Elixir
{
"event": {
"created": "2022-09-29T19:34:50.798935+00:00",
"id": "4673184305512448",
"log": {
"created": "2022-09-29T19:34:50.302804+00:00",
"errors": [],
"id": "5946009943277568",
"issuingTransactionId": "6227484919988224",
"purchase": {
"acquirerId": "557045",
"amount": 10000,
"cardEnding": "1787",
"cardId": "5975559855144960",
"created": "2022-09-29T19:34:50.151607+00:00",
"description": "",
"endToEndId": "60ae1ddd-ebb0-432f-88c7-ac8014ee3c5f",
"holderName": "TONY STARK",
"id": "5101585013145600",
"issuerAmount": 10000,
"issuerCurrencyCode": "BRL",
"issuerCurrencySymbol": "R$",
"issuingTransactionIds": [
"6227484919988224"
],
"merchantAmount": 10000,
"merchantCategoryCode": "miscellaneousBusinessServices",
"merchantCategoryType": "services",
"merchantCountryCode": "BRA",
"merchantCurrencyCode": "BRL",
"merchantCurrencySymbol": "R$",
"merchantFee": 0,
"merchantId": "731138412121896",
"merchantName": "GOOGLE CLOUD PLATFORM",
"methodCode": "manual",
"purpose": "purchase",
"score": 0.9992851125568876,
"status": "approved",
"tags": [
"tony",
"stark"
],
"tax": 0,
"updated": "2022-09-29T19:34:50.302847+00:00",
"walletId": "",
"zipCode": "902101234"
},
"type": "approved"
},
"subscription": "issuing-purchase",
"workspaceId": "5506710588664374"
}
}
C#
{
"event": {
"created": "2022-09-29T19:34:50.798935+00:00",
"id": "4673184305512448",
"log": {
"created": "2022-09-29T19:34:50.302804+00:00",
"errors": [],
"id": "5946009943277568",
"issuingTransactionId": "6227484919988224",
"purchase": {
"acquirerId": "557045",
"amount": 10000,
"cardEnding": "1787",
"cardId": "5975559855144960",
"created": "2022-09-29T19:34:50.151607+00:00",
"description": "",
"endToEndId": "60ae1ddd-ebb0-432f-88c7-ac8014ee3c5f",
"holderName": "TONY STARK",
"id": "5101585013145600",
"issuerAmount": 10000,
"issuerCurrencyCode": "BRL",
"issuerCurrencySymbol": "R$",
"issuingTransactionIds": [
"6227484919988224"
],
"merchantAmount": 10000,
"merchantCategoryCode": "miscellaneousBusinessServices",
"merchantCategoryType": "services",
"merchantCountryCode": "BRA",
"merchantCurrencyCode": "BRL",
"merchantCurrencySymbol": "R$",
"merchantFee": 0,
"merchantId": "731138412121896",
"merchantName": "GOOGLE CLOUD PLATFORM",
"methodCode": "manual",
"purpose": "purchase",
"score": 0.9992851125568876,
"status": "approved",
"tags": [
"tony",
"stark"
],
"tax": 0,
"updated": "2022-09-29T19:34:50.302847+00:00",
"walletId": "",
"zipCode": "902101234"
},
"type": "approved"
},
"subscription": "issuing-purchase",
"workspaceId": "5506710588664374"
}
}
Go
{
"event": {
"created": "2022-09-29T19:34:50.798935+00:00",
"id": "4673184305512448",
"log": {
"created": "2022-09-29T19:34:50.302804+00:00",
"errors": [],
"id": "5946009943277568",
"issuingTransactionId": "6227484919988224",
"purchase": {
"acquirerId": "557045",
"amount": 10000,
"cardEnding": "1787",
"cardId": "5975559855144960",
"created": "2022-09-29T19:34:50.151607+00:00",
"description": "",
"endToEndId": "60ae1ddd-ebb0-432f-88c7-ac8014ee3c5f",
"holderName": "TONY STARK",
"id": "5101585013145600",
"issuerAmount": 10000,
"issuerCurrencyCode": "BRL",
"issuerCurrencySymbol": "R$",
"issuingTransactionIds": [
"6227484919988224"
],
"merchantAmount": 10000,
"merchantCategoryCode": "miscellaneousBusinessServices",
"merchantCategoryType": "services",
"merchantCountryCode": "BRA",
"merchantCurrencyCode": "BRL",
"merchantCurrencySymbol": "R$",
"merchantFee": 0,
"merchantId": "731138412121896",
"merchantName": "GOOGLE CLOUD PLATFORM",
"methodCode": "manual",
"purpose": "purchase",
"score": 0.9992851125568876,
"status": "approved",
"tags": [
"tony",
"stark"
],
"tax": 0,
"updated": "2022-09-29T19:34:50.302847+00:00",
"walletId": "",
"zipCode": "902101234"
},
"type": "approved"
},
"subscription": "issuing-purchase",
"workspaceId": "5506710588664374"
}
}
Clojure
{
"event": {
"created": "2022-09-29T19:34:50.798935+00:00",
"id": "4673184305512448",
"log": {
"created": "2022-09-29T19:34:50.302804+00:00",
"errors": [],
"id": "5946009943277568",
"issuingTransactionId": "6227484919988224",
"purchase": {
"acquirerId": "557045",
"amount": 10000,
"cardEnding": "1787",
"cardId": "5975559855144960",
"created": "2022-09-29T19:34:50.151607+00:00",
"description": "",
"endToEndId": "60ae1ddd-ebb0-432f-88c7-ac8014ee3c5f",
"holderName": "TONY STARK",
"id": "5101585013145600",
"issuerAmount": 10000,
"issuerCurrencyCode": "BRL",
"issuerCurrencySymbol": "R$",
"issuingTransactionIds": [
"6227484919988224"
],
"merchantAmount": 10000,
"merchantCategoryCode": "miscellaneousBusinessServices",
"merchantCategoryType": "services",
"merchantCountryCode": "BRA",
"merchantCurrencyCode": "BRL",
"merchantCurrencySymbol": "R$",
"merchantFee": 0,
"merchantId": "731138412121896",
"merchantName": "GOOGLE CLOUD PLATFORM",
"methodCode": "manual",
"purpose": "purchase",
"score": 0.9992851125568876,
"status": "approved",
"tags": [
"tony",
"stark"
],
"tax": 0,
"updated": "2022-09-29T19:34:50.302847+00:00",
"walletId": "",
"zipCode": "902101234"
},
"type": "approved"
},
"subscription": "issuing-purchase",
"workspaceId": "5506710588664374"
}
}
Curl
{
"event": {
"created": "2022-09-29T19:34:50.798935+00:00",
"id": "4673184305512448",
"log": {
"created": "2022-09-29T19:34:50.302804+00:00",
"errors": [],
"id": "5946009943277568",
"issuingTransactionId": "6227484919988224",
"purchase": {
"acquirerId": "557045",
"amount": 10000,
"cardEnding": "1787",
"cardId": "5975559855144960",
"created": "2022-09-29T19:34:50.151607+00:00",
"description": "",
"endToEndId": "60ae1ddd-ebb0-432f-88c7-ac8014ee3c5f",
"holderName": "TONY STARK",
"id": "5101585013145600",
"issuerAmount": 10000,
"issuerCurrencyCode": "BRL",
"issuerCurrencySymbol": "R$",
"issuingTransactionIds": [
"6227484919988224"
],
"merchantAmount": 10000,
"merchantCategoryCode": "miscellaneousBusinessServices",
"merchantCategoryType": "services",
"merchantCountryCode": "BRA",
"merchantCurrencyCode": "BRL",
"merchantCurrencySymbol": "R$",
"merchantFee": 0,
"merchantId": "731138412121896",
"merchantName": "GOOGLE CLOUD PLATFORM",
"methodCode": "manual",
"purpose": "purchase",
"score": 0.9992851125568876,
"status": "approved",
"tags": [
"tony",
"stark"
],
"tax": 0,
"updated": "2022-09-29T19:34:50.302847+00:00",
"walletId": "",
"zipCode": "902101234"
},
"type": "approved"
},
"subscription": "issuing-purchase",
"workspaceId": "5506710588664374"
}
}
Failed Webhook Example
4.2. Failed Webhook Example
Parameters
Python
{
"event": {
"created": "2022-09-29T19:43:22.799782+00:00",
"id": "6012690115854336",
"log": {
"created": "2022-09-29T19:43:22.244999+00:00",
"errors": [
{
"code": "concurrency",
"message": "More than one authorization was attempted at the same time on this card."
}
],
"id": "5146374676938752",
"issuingTransactionId": "",
"purchase": {
"acquirerId": "230851",
"amount": 10000,
"cardEnding": "1787",
"cardId": "5975559855144960",
"created": "2022-09-29T19:43:22.175174+00:00",
"description": "",
"endToEndId": "920b2027-9bcb-476c-a23d-33d15a2a1470",
"holderName": "TONY STARK",
"id": "5709324630360064",
"issuerAmount": 10000,
"issuerCurrencyCode": "BRL",
"issuerCurrencySymbol": "R$",
"issuingTransactionIds": [],
"merchantAmount": 10000,
"merchantCategoryCode": "miscellaneousBusinessServices",
"merchantCategoryType": "services",
"merchantCountryCode": "BRA",
"merchantCurrencyCode": "BRL",
"merchantCurrencySymbol": "R$",
"merchantFee": 0,
"merchantId": "360698645394776",
"merchantName": "GOOGLE CLOUD PLATFORM",
"methodCode": "manual",
"purpose": "purchase",
"score": 0.9996876949639208,
"status": "denied",
"tags": [
"tony",
"stark"
],
"tax": 0,
"updated": "2022-09-29T19:43:22.245043+00:00",
"walletId": "",
"zipCode": "902101234"
},
"type": "denied"
},
"subscription": "issuing-purchase",
"workspaceId": "5506710588664374"
}
}
Javascript
{
"event": {
"created": "2022-09-29T19:43:22.799782+00:00",
"id": "6012690115854336",
"log": {
"created": "2022-09-29T19:43:22.244999+00:00",
"errors": [
{
"code": "concurrency",
"message": "More than one authorization was attempted at the same time on this card."
}
],
"id": "5146374676938752",
"issuingTransactionId": "",
"purchase": {
"acquirerId": "230851",
"amount": 10000,
"cardEnding": "1787",
"cardId": "5975559855144960",
"created": "2022-09-29T19:43:22.175174+00:00",
"description": "",
"endToEndId": "920b2027-9bcb-476c-a23d-33d15a2a1470",
"holderName": "TONY STARK",
"id": "5709324630360064",
"issuerAmount": 10000,
"issuerCurrencyCode": "BRL",
"issuerCurrencySymbol": "R$",
"issuingTransactionIds": [],
"merchantAmount": 10000,
"merchantCategoryCode": "miscellaneousBusinessServices",
"merchantCategoryType": "services",
"merchantCountryCode": "BRA",
"merchantCurrencyCode": "BRL",
"merchantCurrencySymbol": "R$",
"merchantFee": 0,
"merchantId": "360698645394776",
"merchantName": "GOOGLE CLOUD PLATFORM",
"methodCode": "manual",
"purpose": "purchase",
"score": 0.9996876949639208,
"status": "denied",
"tags": [
"tony",
"stark"
],
"tax": 0,
"updated": "2022-09-29T19:43:22.245043+00:00",
"walletId": "",
"zipCode": "902101234"
},
"type": "denied"
},
"subscription": "issuing-purchase",
"workspaceId": "5506710588664374"
}
}
PHP
{
"event": {
"created": "2022-09-29T19:43:22.799782+00:00",
"id": "6012690115854336",
"log": {
"created": "2022-09-29T19:43:22.244999+00:00",
"errors": [
{
"code": "concurrency",
"message": "More than one authorization was attempted at the same time on this card."
}
],
"id": "5146374676938752",
"issuingTransactionId": "",
"purchase": {
"acquirerId": "230851",
"amount": 10000,
"cardEnding": "1787",
"cardId": "5975559855144960",
"created": "2022-09-29T19:43:22.175174+00:00",
"description": "",
"endToEndId": "920b2027-9bcb-476c-a23d-33d15a2a1470",
"holderName": "TONY STARK",
"id": "5709324630360064",
"issuerAmount": 10000,
"issuerCurrencyCode": "BRL",
"issuerCurrencySymbol": "R$",
"issuingTransactionIds": [],
"merchantAmount": 10000,
"merchantCategoryCode": "miscellaneousBusinessServices",
"merchantCategoryType": "services",
"merchantCountryCode": "BRA",
"merchantCurrencyCode": "BRL",
"merchantCurrencySymbol": "R$",
"merchantFee": 0,
"merchantId": "360698645394776",
"merchantName": "GOOGLE CLOUD PLATFORM",
"methodCode": "manual",
"purpose": "purchase",
"score": 0.9996876949639208,
"status": "denied",
"tags": [
"tony",
"stark"
],
"tax": 0,
"updated": "2022-09-29T19:43:22.245043+00:00",
"walletId": "",
"zipCode": "902101234"
},
"type": "denied"
},
"subscription": "issuing-purchase",
"workspaceId": "5506710588664374"
}
}
Java
{
"event": {
"created": "2022-09-29T19:43:22.799782+00:00",
"id": "6012690115854336",
"log": {
"created": "2022-09-29T19:43:22.244999+00:00",
"errors": [
{
"code": "concurrency",
"message": "More than one authorization was attempted at the same time on this card."
}
],
"id": "5146374676938752",
"issuingTransactionId": "",
"purchase": {
"acquirerId": "230851",
"amount": 10000,
"cardEnding": "1787",
"cardId": "5975559855144960",
"created": "2022-09-29T19:43:22.175174+00:00",
"description": "",
"endToEndId": "920b2027-9bcb-476c-a23d-33d15a2a1470",
"holderName": "TONY STARK",
"id": "5709324630360064",
"issuerAmount": 10000,
"issuerCurrencyCode": "BRL",
"issuerCurrencySymbol": "R$",
"issuingTransactionIds": [],
"merchantAmount": 10000,
"merchantCategoryCode": "miscellaneousBusinessServices",
"merchantCategoryType": "services",
"merchantCountryCode": "BRA",
"merchantCurrencyCode": "BRL",
"merchantCurrencySymbol": "R$",
"merchantFee": 0,
"merchantId": "360698645394776",
"merchantName": "GOOGLE CLOUD PLATFORM",
"methodCode": "manual",
"purpose": "purchase",
"score": 0.9996876949639208,
"status": "denied",
"tags": [
"tony",
"stark"
],
"tax": 0,
"updated": "2022-09-29T19:43:22.245043+00:00",
"walletId": "",
"zipCode": "902101234"
},
"type": "denied"
},
"subscription": "issuing-purchase",
"workspaceId": "5506710588664374"
}
}
Ruby
{
"event": {
"created": "2022-09-29T19:43:22.799782+00:00",
"id": "6012690115854336",
"log": {
"created": "2022-09-29T19:43:22.244999+00:00",
"errors": [
{
"code": "concurrency",
"message": "More than one authorization was attempted at the same time on this card."
}
],
"id": "5146374676938752",
"issuingTransactionId": "",
"purchase": {
"acquirerId": "230851",
"amount": 10000,
"cardEnding": "1787",
"cardId": "5975559855144960",
"created": "2022-09-29T19:43:22.175174+00:00",
"description": "",
"endToEndId": "920b2027-9bcb-476c-a23d-33d15a2a1470",
"holderName": "TONY STARK",
"id": "5709324630360064",
"issuerAmount": 10000,
"issuerCurrencyCode": "BRL",
"issuerCurrencySymbol": "R$",
"issuingTransactionIds": [],
"merchantAmount": 10000,
"merchantCategoryCode": "miscellaneousBusinessServices",
"merchantCategoryType": "services",
"merchantCountryCode": "BRA",
"merchantCurrencyCode": "BRL",
"merchantCurrencySymbol": "R$",
"merchantFee": 0,
"merchantId": "360698645394776",
"merchantName": "GOOGLE CLOUD PLATFORM",
"methodCode": "manual",
"purpose": "purchase",
"score": 0.9996876949639208,
"status": "denied",
"tags": [
"tony",
"stark"
],
"tax": 0,
"updated": "2022-09-29T19:43:22.245043+00:00",
"walletId": "",
"zipCode": "902101234"
},
"type": "denied"
},
"subscription": "issuing-purchase",
"workspaceId": "5506710588664374"
}
}
Elixir
{
"event": {
"created": "2022-09-29T19:43:22.799782+00:00",
"id": "6012690115854336",
"log": {
"created": "2022-09-29T19:43:22.244999+00:00",
"errors": [
{
"code": "concurrency",
"message": "More than one authorization was attempted at the same time on this card."
}
],
"id": "5146374676938752",
"issuingTransactionId": "",
"purchase": {
"acquirerId": "230851",
"amount": 10000,
"cardEnding": "1787",
"cardId": "5975559855144960",
"created": "2022-09-29T19:43:22.175174+00:00",
"description": "",
"endToEndId": "920b2027-9bcb-476c-a23d-33d15a2a1470",
"holderName": "TONY STARK",
"id": "5709324630360064",
"issuerAmount": 10000,
"issuerCurrencyCode": "BRL",
"issuerCurrencySymbol": "R$",
"issuingTransactionIds": [],
"merchantAmount": 10000,
"merchantCategoryCode": "miscellaneousBusinessServices",
"merchantCategoryType": "services",
"merchantCountryCode": "BRA",
"merchantCurrencyCode": "BRL",
"merchantCurrencySymbol": "R$",
"merchantFee": 0,
"merchantId": "360698645394776",
"merchantName": "GOOGLE CLOUD PLATFORM",
"methodCode": "manual",
"purpose": "purchase",
"score": 0.9996876949639208,
"status": "denied",
"tags": [
"tony",
"stark"
],
"tax": 0,
"updated": "2022-09-29T19:43:22.245043+00:00",
"walletId": "",
"zipCode": "902101234"
},
"type": "denied"
},
"subscription": "issuing-purchase",
"workspaceId": "5506710588664374"
}
}
C#
{
"event": {
"created": "2022-09-29T19:43:22.799782+00:00",
"id": "6012690115854336",
"log": {
"created": "2022-09-29T19:43:22.244999+00:00",
"errors": [
{
"code": "concurrency",
"message": "More than one authorization was attempted at the same time on this card."
}
],
"id": "5146374676938752",
"issuingTransactionId": "",
"purchase": {
"acquirerId": "230851",
"amount": 10000,
"cardEnding": "1787",
"cardId": "5975559855144960",
"created": "2022-09-29T19:43:22.175174+00:00",
"description": "",
"endToEndId": "920b2027-9bcb-476c-a23d-33d15a2a1470",
"holderName": "TONY STARK",
"id": "5709324630360064",
"issuerAmount": 10000,
"issuerCurrencyCode": "BRL",
"issuerCurrencySymbol": "R$",
"issuingTransactionIds": [],
"merchantAmount": 10000,
"merchantCategoryCode": "miscellaneousBusinessServices",
"merchantCategoryType": "services",
"merchantCountryCode": "BRA",
"merchantCurrencyCode": "BRL",
"merchantCurrencySymbol": "R$",
"merchantFee": 0,
"merchantId": "360698645394776",
"merchantName": "GOOGLE CLOUD PLATFORM",
"methodCode": "manual",
"purpose": "purchase",
"score": 0.9996876949639208,
"status": "denied",
"tags": [
"tony",
"stark"
],
"tax": 0,
"updated": "2022-09-29T19:43:22.245043+00:00",
"walletId": "",
"zipCode": "902101234"
},
"type": "denied"
},
"subscription": "issuing-purchase",
"workspaceId": "5506710588664374"
}
}
Go
{
"event": {
"created": "2022-09-29T19:43:22.799782+00:00",
"id": "6012690115854336",
"log": {
"created": "2022-09-29T19:43:22.244999+00:00",
"errors": [
{
"code": "concurrency",
"message": "More than one authorization was attempted at the same time on this card."
}
],
"id": "5146374676938752",
"issuingTransactionId": "",
"purchase": {
"acquirerId": "230851",
"amount": 10000,
"cardEnding": "1787",
"cardId": "5975559855144960",
"created": "2022-09-29T19:43:22.175174+00:00",
"description": "",
"endToEndId": "920b2027-9bcb-476c-a23d-33d15a2a1470",
"holderName": "TONY STARK",
"id": "5709324630360064",
"issuerAmount": 10000,
"issuerCurrencyCode": "BRL",
"issuerCurrencySymbol": "R$",
"issuingTransactionIds": [],
"merchantAmount": 10000,
"merchantCategoryCode": "miscellaneousBusinessServices",
"merchantCategoryType": "services",
"merchantCountryCode": "BRA",
"merchantCurrencyCode": "BRL",
"merchantCurrencySymbol": "R$",
"merchantFee": 0,
"merchantId": "360698645394776",
"merchantName": "GOOGLE CLOUD PLATFORM",
"methodCode": "manual",
"purpose": "purchase",
"score": 0.9996876949639208,
"status": "denied",
"tags": [
"tony",
"stark"
],
"tax": 0,
"updated": "2022-09-29T19:43:22.245043+00:00",
"walletId": "",
"zipCode": "902101234"
},
"type": "denied"
},
"subscription": "issuing-purchase",
"workspaceId": "5506710588664374"
}
}
Clojure
{
"event": {
"created": "2022-09-29T19:43:22.799782+00:00",
"id": "6012690115854336",
"log": {
"created": "2022-09-29T19:43:22.244999+00:00",
"errors": [
{
"code": "concurrency",
"message": "More than one authorization was attempted at the same time on this card."
}
],
"id": "5146374676938752",
"issuingTransactionId": "",
"purchase": {
"acquirerId": "230851",
"amount": 10000,
"cardEnding": "1787",
"cardId": "5975559855144960",
"created": "2022-09-29T19:43:22.175174+00:00",
"description": "",
"endToEndId": "920b2027-9bcb-476c-a23d-33d15a2a1470",
"holderName": "TONY STARK",
"id": "5709324630360064",
"issuerAmount": 10000,
"issuerCurrencyCode": "BRL",
"issuerCurrencySymbol": "R$",
"issuingTransactionIds": [],
"merchantAmount": 10000,
"merchantCategoryCode": "miscellaneousBusinessServices",
"merchantCategoryType": "services",
"merchantCountryCode": "BRA",
"merchantCurrencyCode": "BRL",
"merchantCurrencySymbol": "R$",
"merchantFee": 0,
"merchantId": "360698645394776",
"merchantName": "GOOGLE CLOUD PLATFORM",
"methodCode": "manual",
"purpose": "purchase",
"score": 0.9996876949639208,
"status": "denied",
"tags": [
"tony",
"stark"
],
"tax": 0,
"updated": "2022-09-29T19:43:22.245043+00:00",
"walletId": "",
"zipCode": "902101234"
},
"type": "denied"
},
"subscription": "issuing-purchase",
"workspaceId": "5506710588664374"
}
}
Curl
{
"event": {
"created": "2022-09-29T19:43:22.799782+00:00",
"id": "6012690115854336",
"log": {
"created": "2022-09-29T19:43:22.244999+00:00",
"errors": [
{
"code": "concurrency",
"message": "More than one authorization was attempted at the same time on this card."
}
],
"id": "5146374676938752",
"issuingTransactionId": "",
"purchase": {
"acquirerId": "230851",
"amount": 10000,
"cardEnding": "1787",
"cardId": "5975559855144960",
"created": "2022-09-29T19:43:22.175174+00:00",
"description": "",
"endToEndId": "920b2027-9bcb-476c-a23d-33d15a2a1470",
"holderName": "TONY STARK",
"id": "5709324630360064",
"issuerAmount": 10000,
"issuerCurrencyCode": "BRL",
"issuerCurrencySymbol": "R$",
"issuingTransactionIds": [],
"merchantAmount": 10000,
"merchantCategoryCode": "miscellaneousBusinessServices",
"merchantCategoryType": "services",
"merchantCountryCode": "BRA",
"merchantCurrencyCode": "BRL",
"merchantCurrencySymbol": "R$",
"merchantFee": 0,
"merchantId": "360698645394776",
"merchantName": "GOOGLE CLOUD PLATFORM",
"methodCode": "manual",
"purpose": "purchase",
"score": 0.9996876949639208,
"status": "denied",
"tags": [
"tony",
"stark"
],
"tax": 0,
"updated": "2022-09-29T19:43:22.245043+00:00",
"walletId": "",
"zipCode": "902101234"
},
"type": "denied"
},
"subscription": "issuing-purchase",
"workspaceId": "5506710588664374"
}
}
