@@ -49,6 +49,10 @@ is as easy as sending a text message to your client!
49
49
- [ CorporateBalance] ( #get-your-corporatebalance ) : View your corporate balance
50
50
- [ CorporateTransactions] ( #query-corporatetransactions ) : View the transactions that have affected your corporate balance
51
51
- [ CorporateEnums] ( #corporate-enums ) : Query enums related to the corporate purchases, such as merchant categories, countries and card purchase methods
52
+ - [ MerchantCard] ( #query-merchantcards ) : Stores information about approved purchase cards for reuse
53
+ - [ MerchantSession] ( #create-a-merchantsession ) : Manages a session to create a purchase with a new card
54
+ - [ MerchantPurchase] ( #create-a-merchantpurchase ) : Allows a merchant to charge their customers using debit or credit cards
55
+ - [ MerchantInstallment] ( #query-merchantinstallments ) : Tracks the lifecycle of purchase installments
52
56
- [ Split] ( #query-splits ) : Split received Invoice payments between different receivers
53
57
- [ SplitReceiver] ( #create-splitreceivers ) : Receiver of an Invoice split
54
58
- [ Webhooks] ( #create-a-webhook-subscription ) : Configure your webhook endpoints and subscriptions
@@ -2333,6 +2337,210 @@ log = starkbank.splitreceiver.log.get("5155165527080960")
2333
2337
print (log)
2334
2338
```
2335
2339
2340
+ ## Query MerchantCards
2341
+
2342
+ Get a list of merchant cards in chunks of at most 100. If you need smaller chunks, use the limit parameter.
2343
+
2344
+ ``` python
2345
+ import starkbank
2346
+
2347
+ merchant_cards = starkbank.merchantcard.query(limit = 3 )
2348
+ for merchant_card in merchant_cards:
2349
+ print (merchant_card)
2350
+ ```
2351
+
2352
+ ## Get a MerchantCard
2353
+
2354
+ Retrieve detailed information about a specific card by its id.
2355
+
2356
+ ``` python
2357
+ import starkbank
2358
+
2359
+ merchantcard = starkbank.merchantcard.get(' 5950134772826112' )
2360
+ print (merchantcard)
2361
+ ```
2362
+
2363
+ ## Create a MerchantSession
2364
+
2365
+ The Merchant Session allows you to create a session prior to a purchase.
2366
+ Sessions are essential for defining the parameters of a purchase, including funding type, expiration, 3DS, and more.
2367
+
2368
+ ``` python
2369
+ import starkbank
2370
+
2371
+ merchant_session = starkbank.merchantsession.create({
2372
+ " allowedFundingTypes" : [
2373
+ " debit" ,
2374
+ " credit"
2375
+ ],
2376
+ " allowedInstallments" : [
2377
+ {
2378
+ " totalAmount" : 0 ,
2379
+ " count" : 1
2380
+ },
2381
+ {
2382
+ " totalAmount" : 12000 ,
2383
+ " count" : 2
2384
+ },
2385
+ {
2386
+ " totalAmount" : 18000 ,
2387
+ " count" : 12
2388
+ }
2389
+ ],
2390
+ " expiration" : 3600 ,
2391
+ " challengeMode" : " disabled" ,
2392
+ " tags" : [
2393
+ " your-tags"
2394
+ ]
2395
+ })
2396
+
2397
+ print (merchant_session)
2398
+ ```
2399
+
2400
+ You can create a MerchantPurchase through a MerchantSession by passing its UUID.
2401
+ ** Note** : This method must be implemented in your front-end to ensure that sensitive card data does not pass through the back-end of the integration.
2402
+
2403
+ ## Create a MerchantSession Purchase
2404
+
2405
+ This route can be used to create a Merchant Purchase directly from the payer's client application.
2406
+ The UUID of a Merchant Session that was previously created by the merchant is necessary to access this route.
2407
+
2408
+ ``` python
2409
+ import starkbank
2410
+
2411
+ merchant_session_purchase = starkbank.merchantsession.purchase(
2412
+ uuid = " 0bb894a2697d41d99fe02cad2c00c9bc" ,
2413
+ amount = 18000 ,
2414
+ installment_count = 12 ,
2415
+ card_expiration = " 2035-01" ,
2416
+ card_number = " 5448280000000007" ,
2417
+ card_security_code = " 123" ,
2418
+ holder_name = " Margaery Tyrell" ,
2419
+
2420
+ holder_phone = " 11998663456" ,
2421
+ funding_type = " credit" ,
2422
+ billing_country_code = " BRA" ,
2423
+ billing_city = " São Paulo" ,
2424
+ billing_state_code = " SP" ,
2425
+ billing_street_line1 = " Rua do Jardim de cima, 123" ,
2426
+ billing_street_line2 = " 1 andar" ,
2427
+ billing_zip_code = " 11111-111" ,
2428
+ metadata = {
2429
+ " extraData" : " extraData" ,
2430
+ " language" : " pt-BR" ,
2431
+ " timezoneOffset" : 3 ,
2432
+ " userAgent" : " Mozilla" ,
2433
+ " userIp" : " 255.255.255.255"
2434
+ }
2435
+ )
2436
+
2437
+ print (merchant_session_purchase)
2438
+ ```
2439
+
2440
+ ## Query MerchantSessions
2441
+
2442
+ Get a list of merchant sessions in chunks of at most 100. If you need smaller chunks, use the limit parameter.
2443
+
2444
+ ``` python
2445
+ import starkbank
2446
+
2447
+ merchant_sessions = starkbank.merchantsession.query(limit = 3 )
2448
+ for merchant_session in merchant_sessions:
2449
+ print (merchant_session)
2450
+ ```
2451
+
2452
+ ## Get a MerchantSession
2453
+
2454
+ Retrieve detailed information about a specific session by its id.
2455
+
2456
+ ``` python
2457
+ import starkbank
2458
+
2459
+ merchant_session = starkbank.merchantsession.get(' 5950134772826112' )
2460
+ print (merchant_session)
2461
+ ```
2462
+
2463
+ ## Create a MerchantPurchase
2464
+
2465
+ The Merchant Purchase resource can be used to charge customers with credit or debit cards.
2466
+ If a card hasn't been used before, a Merchant Session Purchase must be created and approved with that specific card before it can be used directly in a Merchant Purchase.
2467
+
2468
+ ``` python
2469
+ import starkbank
2470
+
2471
+ merchant_purchase = starkbank.merchantpurchase.create(
2472
+ starkbank.MerchantPurchase(
2473
+ amount = 10000 ,
2474
+ installment_count = 5 ,
2475
+ card_id = " 6295415968235520" ,
2476
+ funding_type = " credit" ,
2477
+ challenge_mode = " disabled" ,
2478
+ billing_city = " Sao Paulo" ,
2479
+ billing_country_code = " BRA" ,
2480
+ billing_state_code = " SP" ,
2481
+ billing_street_line_1 = " Rua Casterly Rock, 2000" ,
2482
+ billing_street_line_2 = " 1 andar" ,
2483
+ billing_zip_code = " 11111-111" ,
2484
+
2485
+ holder_phone = " 11985923451" ,
2486
+ metadata = {
2487
+ " userAgent" : " userAgent" ,
2488
+ " userIp" : " 255.255.255.255" ,
2489
+ " language" : " pt-BR" ,
2490
+ " timezoneOffset" : 3 ,
2491
+ " extraData" : " extraData"
2492
+ },
2493
+ tags = [" teste" ]
2494
+ )
2495
+ )
2496
+ ```
2497
+
2498
+ ## Query MerchantPurchases
2499
+
2500
+ Get a list of merchant purchases in chunks of at most 100. If you need smaller chunks, use the limit parameter.
2501
+
2502
+ ``` python
2503
+ import starkbank
2504
+
2505
+ merchant_purchases = starkbank.merchantpurchase.query(limit = 3 )
2506
+ for merchant_purchase in merchant_purchases:
2507
+ print (merchant_purchase)
2508
+ ```
2509
+
2510
+ ## Get a MerchantPurchase
2511
+
2512
+ Retrieve detailed information about a specific purchase by its id.
2513
+
2514
+ ``` python
2515
+ import starkbank
2516
+
2517
+ merchant_purchase = starkbank.merchantpurchase.get(' 5950134772826112' )
2518
+ print (merchant_purchase)
2519
+ ```
2520
+
2521
+ ## Query MerchantInstallments
2522
+
2523
+ Get a list of merchant installments in chunks of at most 100. If you need smaller chunks, use the limit parameter.
2524
+
2525
+ ``` python
2526
+ import starkbank
2527
+
2528
+ merchant_installments = starkbank.merchantinstallment.query(limit = 3 )
2529
+ for merchant_installment in merchant_installments:
2530
+ print (merchant_installment)
2531
+ ```
2532
+
2533
+ ## Get a MerchantInstallment
2534
+
2535
+ Retrieve detailed information about a specific installment by its id.
2536
+
2537
+ ``` python
2538
+ import starkbank
2539
+
2540
+ merchant_installment = starkbank.merchantinstallment.get(' 5950134772826112' )
2541
+ print (merchant_installment)
2542
+ ```
2543
+
2336
2544
## Create a webhook subscription
2337
2545
2338
2546
To create a webhook subscription and be notified whenever an event occurs, run:
0 commit comments