using Gr4vy;
using Gr4vy.Models.Components;
using Gr4vy.Models.Requests;
var sdk = new Gr4vySDK(
id: "example",
server: SDKConfig.Server.Sandbox,
bearerAuthSource: Auth.WithToken(privateKey),
merchantAccountId: "default"
);
ListPaymentMethodsRequest req = new ListPaymentMethodsRequest() {};
ListPaymentMethodsResponse? res = await sdk.PaymentMethods.ListAsync(req);
while(res != null)
{
// handle items
res = await res.Next!();
}{
"items": [
{
"method": "abitab",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"merchant_account_id": "<string>",
"cit_usage_count": 123,
"has_replacement": true,
"usage_count": 123,
"status": "processing",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"type": "payment-method",
"approval_url": "https://gr4vy.app/redirect/12345",
"country": "US",
"currency": "USD",
"details": {
"bin": "<string>",
"card_type": "credit",
"card_issuer_name": "<string>"
},
"expiration_date": "12/30",
"fingerprint": "a50b85c200ee0795d6fd33a5c66f37a4564f554355c5b46a756aac485dd168a4",
"label": "1234",
"last_replaced_at": "2013-07-16T19:23:00.000+00:00",
"mode": "card",
"scheme": "visa",
"additional_schemes": [
"eftpos-australia"
],
"cit_last_used_at": "2013-07-16T19:23:00.000+00:00",
"last_used_at": "2013-07-16T19:23:00.000+00:00",
"buyer": {
"merchant_account_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"type": "buyer",
"id": "fe26475d-ec3e-4884-9553-f7356683f7f9",
"display_name": "John Doe",
"external_identifier": "buyer-12345",
"billing_details": {
"first_name": "John",
"last_name": "Doe",
"email_address": "[email protected]",
"phone_number": "+1234567890",
"address": {
"city": "San Jose",
"country": "US",
"postal_code": "94560",
"state": "California",
"state_code": "US-CA",
"house_number_or_name": "10",
"line1": "Stafford Appartments",
"line2": "29th Street",
"organization": "Gr4vy"
},
"tax_id": {
"value": "<string>",
"kind": "ae.trn"
}
},
"account_number": "<string>"
},
"external_identifier": "card-12345"
}
],
"limit": 20,
"next_cursor": "ZXhhbXBsZTE",
"previous_cursor": "Xkjss7asS"
}List all stored payment method.
using Gr4vy;
using Gr4vy.Models.Components;
using Gr4vy.Models.Requests;
var sdk = new Gr4vySDK(
id: "example",
server: SDKConfig.Server.Sandbox,
bearerAuthSource: Auth.WithToken(privateKey),
merchantAccountId: "default"
);
ListPaymentMethodsRequest req = new ListPaymentMethodsRequest() {};
ListPaymentMethodsResponse? res = await sdk.PaymentMethods.ListAsync(req);
while(res != null)
{
// handle items
res = await res.Next!();
}{
"items": [
{
"method": "abitab",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"merchant_account_id": "<string>",
"cit_usage_count": 123,
"has_replacement": true,
"usage_count": 123,
"status": "processing",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"type": "payment-method",
"approval_url": "https://gr4vy.app/redirect/12345",
"country": "US",
"currency": "USD",
"details": {
"bin": "<string>",
"card_type": "credit",
"card_issuer_name": "<string>"
},
"expiration_date": "12/30",
"fingerprint": "a50b85c200ee0795d6fd33a5c66f37a4564f554355c5b46a756aac485dd168a4",
"label": "1234",
"last_replaced_at": "2013-07-16T19:23:00.000+00:00",
"mode": "card",
"scheme": "visa",
"additional_schemes": [
"eftpos-australia"
],
"cit_last_used_at": "2013-07-16T19:23:00.000+00:00",
"last_used_at": "2013-07-16T19:23:00.000+00:00",
"buyer": {
"merchant_account_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"type": "buyer",
"id": "fe26475d-ec3e-4884-9553-f7356683f7f9",
"display_name": "John Doe",
"external_identifier": "buyer-12345",
"billing_details": {
"first_name": "John",
"last_name": "Doe",
"email_address": "[email protected]",
"phone_number": "+1234567890",
"address": {
"city": "San Jose",
"country": "US",
"postal_code": "94560",
"state": "California",
"state_code": "US-CA",
"house_number_or_name": "10",
"line1": "Stafford Appartments",
"line2": "29th Street",
"organization": "Gr4vy"
},
"tax_id": {
"value": "<string>",
"kind": "ae.trn"
}
},
"account_number": "<string>"
},
"external_identifier": "card-12345"
}
],
"limit": 20,
"next_cursor": "ZXhhbXBsZTE",
"previous_cursor": "Xkjss7asS"
}payment-methods.read scope.Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
The ID of the merchant account to use for this request.
A pointer to the page of results to return.
"ZXhhbXBsZTE"
The maximum number of items that are at returned.
1 <= x <= 100The ID of the buyer to filter payment methods by.
"fe26475d-ec3e-4884-9553-f7356683f7f9"
The external identifier of the buyer to filter payment methods by.
"buyer-12345"
processing, buyer_approval_required, succeeded, failed, paused The external identifier of the payment method to filter by.
"payment-method-12345"
Successful Response
A list of items returned for this request.
Show child attributes
The type of this payment method.
abitab, affirm, afterpay, alipay, alipayhk, applepay, arcuspaynetwork, bacs, bancontact, bank, banked, bcp, becs, bitpay, blik, boleto, boost, card, cashapp, chaseorbital, clearpay, click-to-pay, dana, dcb, dlocal, ebanx, efecty, eps, everydaypay, gcash, gem, gemds, gift-card, giropay, givingblock, gocardless, googlepay, googlepay_pan_only, gopay, grabpay, ideal, kakaopay, kcp, khipu, klarna, latitude, latitudeds, laybuy, linepay, linkaja, maybankqrpay, mercadopago, multibanco, multipago, nequi, netbanking, network-token, nupay, oney_10x, oney_12x, oney_3x, oney_4x, oney_6x, ovo, oxxo, p24, pagoefectivo, payid, paymaya, paypal, paypalpaylater, payto, payvalida, picpay, pix, plaid, pse, rabbitlinepay, razorpay, rapipago, redpagos, scalapay, sepa, servipag, shopeepay, singteldash, smartpay, sofort, spei, stitch, stripedd, stripetoken, tapi, tapifintechs, thaiqr, touchngo, truemoney, trustly, trustlyeurope, upi, venmo, vipps, waave, webpay, wechat, yape, zippay The ID for the payment method.
The ID of the merchant account this buyer belongs to.
The number of times this payment method has been used in transactions for client initiated transactions.
Whether this card has a pending replacement that hasn't been applied yet.
The number of times this payment method has been used in transactions.
The state of the payment method.
processing, buyer_approval_required, succeeded, failed, paused The date and time when this payment method was first created in our system.
The date and time when this payment method was last updated in our system.
Always payment-method.
"payment-method"The optional URL that the buyer needs to be redirected to to further authorize their payment.
"https://gr4vy.app/redirect/12345"
The 2-letter ISO code of the country this payment method can be used for. If this value is null the payment method may be used in multiple countries.
"US"
The ISO-4217 currency code that this payment method can be used for. If this value is null the payment method may be used for multiple currencies.
"USD"
The expiration date for the payment method.
5"12/30"
The unique hash derived from the payment method identifier (e.g. card number).
"a50b85c200ee0795d6fd33a5c66f37a4564f554355c5b46a756aac485dd168a4"
A label for the card or the account. For a paypal payment method this is the user's email address. For a card it is the last 4 digits of the card.
320"1234"
The date and time when this card was last replaced by the account updater.
"2013-07-16T19:23:00.000+00:00"
The mode to use with this payment method.
card, redirect, applepay, googlepay, checkout-session, click-to-pay, gift-card, bank "card"
The scheme of the card. Only applies to card payments.
accel, amex, bancontact, carte-bancaire, cirrus, culiance, dankort, diners-club, discover, eftpos-australia, elo, hipercard, jcb, maestro, mastercard, mir, nyce, other, pulse, rupay, star, uatp, unionpay, visa "visa"
Additional schemes of the card besides the primary scheme. Only applies to card payment methods.
accel, amex, bancontact, carte-bancaire, cirrus, culiance, dankort, diners-club, discover, eftpos-australia, elo, hipercard, jcb, maestro, mastercard, mir, nyce, other, pulse, rupay, star, uatp, unionpay, visa ["eftpos-australia"]The timestamp when this payment method was last used in a transaction for client initiated transactions.
"2013-07-16T19:23:00.000+00:00"
The timestamp when this payment method was last used in a transaction.
"2013-07-16T19:23:00.000+00:00"
The optional buyer for which this payment method has been stored.
Show child attributes
The ID of the merchant account this buyer belongs to.
The date this buyer was created at.
The date this buyer was last updated at.
Always buyer.
"buyer"The ID for the buyer.
"fe26475d-ec3e-4884-9553-f7356683f7f9"
The display name for the buyer.
1 - 200"John Doe"
The merchant identifier for this buyer.
1 - 200"buyer-12345"
The billing name, address, email, and other fields for this buyer.
Show child attributes
The first name(s) or given name for the buyer.
1 - 255"John"
The last name, or family name, of the buyer.
1 - 255"Doe"
The phone number for the buyer which should be formatted according to the E164 number standard.
"+1234567890"
The billing address for the buyer.
Show child attributes
The city for the address.
1 - 100"San Jose"
The country for the address in ISO 3166 format.
"US"
The postal code or zip code for the address.
1 - 50"94560"
The state, county, or province for the address.
1 - 255"California"
The code of state, county, or province for the address in ISO 3166-2 format.
"US-CA"
The house number or name for the address. Not all payment services use this field but some do.
1 - 255"10"
The first line of the address.
1 - 255"Stafford Appartments"
The second line of the address.
1 - 255"29th Street"
The optional name of the company or organisation to add to the address.
1 - 255"Gr4vy"
The tax ID information associated with the billing details.
Show child attributes
The tax ID for the buyer.
1 - 50The kind of tax ID
ae.trn, au.abn, ar.dni, ar.cuil, ar.cuit, br.cnpj, br.cpf, ca.bn, ca.gst_hst, ca.pst_bc, ca.pst_mb, ca.pst_sk, ca.qst, ch.vat, cl.tin, co.itin, co.nit, es.cif, eu.vat, gb.vat, hk.br, id.nik, id.npwp, in.gst, in.pan, jp.cn, jp.rn, kr.brn, li.uid, mx.curp, mx.rfc, my.frp, my.itn, my.nric, my.sst, no.vat, nz.gst, pe.ruc, ph.tin, ru.inn, ru.kpp, sa.vat, sg.gst, sg.uen, th.id, th.vat, tw.vat, us.ein, za.vat, bo.ci, uy.rut, uy.ci The buyer account number
1 - 200The merchant reference that can be used to match the payment method against your own records.
1 - 200"card-12345"
The number of items for this page.
1 <= x <= 100The cursor pointing at the next page of items.
1 - 1000"ZXhhbXBsZTE"
The cursor pointing at the previous page of items.
1 - 1000"Xkjss7asS"
Was this page helpful?