Skip to main content

I am trying to callout to the Stripe charge search api to find a charge based on a metadata value.  This is the api doc https://stripe.com/docs/api/charges/search.  I used Swagger Inspector to do the callout to get the sample json response.  When I plug the response into the new http callout action I get this error message Specify at least one variable or element for your List data type and try again.

 

I am a novice when it comes to json.  I was hoping someone here could help me with my response to let me know what I need to do to make this work. 

 

Here is the sample response.  All data is test data. #Flow #Enhanced External Services #Automation

{

"object": "search_result",

"data": [

{

"id": "ch_3MPY2AAFKzBRZEPq3Lo7im0H",

"object": "charge",

"amount": 280917,

"amount_captured": 280917,

"amount_refunded": 0,

"amount_updates": [],

"application": "ca_1pvP3rYcArUkd3InUnImFI9llOiSIq6k",

"application_fee": null,

"application_fee_amount": null,

"balance_transaction": "txn_3MPY2AAFKzBRZEPq3TQ2Vg7x",

"billing_details": {

"address": {

"city": "Queens",

"country": "US",

"line1": "123 Main Street",

"line2": null,

"postal_code": "11354",

"state": "NY"

},

"email": "customer@test.com",

"name": "Test Customer",

"phone": null

},

"calculated_statement_descriptor": "CAPITAL PRIDE ALLIANCE",

"captured": true,

"created": 1673557803,

"currency": "usd",

"customer": "cus_N9rlenBRAEC6u7",

"description": "Payment for invoice(s) CPA-INV-3246",

"destination": null,

"dispute": null,

"disputed": false,

"failure_balance_transaction": null,

"failure_code": null,

"failure_message": null,

"fraud_details": {},

"invoice": null,

"livemode": true,

"metadata": {

"EmailAddress": "customer@test.com",

"Invoice number": "CPA-INV-3246",

"OrgCode": "!Zr47q",

"OrgName": "Capital Pride Alliance, Inc",

"fee": "79.17"

},

"on_behalf_of": null,

"order": null,

"outcome": {

"network_status": "approved_by_network",

"reason": null,

"risk_level": "normal",

"seller_message": "Payment complete.",

"type": "authorized"

},

"paid": true,

"payment_intent": "pi_3MPY2AAFKzBRZEPq31ncGu7D",

"payment_method": "pm_1MPY2BAFKzBRZEPqceiQCuZG",

"payment_method_details": {

"card": {

"brand": "mastercard",

"checks": {

"address_line1_check": "pass",

"address_postal_code_check": "pass",

"cvc_check": "pass"

},

"country": "US",

"exp_month": 6,

"exp_year": 2027,

"fingerprint": "L3vBPIWBEzwkifFA",

"funding": "credit",

"installments": null,

"last4": "9999",

"mandate": null,

"network": "mastercard",

"three_d_secure": null,

"wallet": null

},

"type": "card"

},

"receipt_email": "customer@test.com",

"receipt_number": "1991-1726",

"receipt_url": "https://pay.stripe.com/receipts/payment/test",

"refunded": false,

"refunds": {

"object": "list",

"data": [],

"has_more": false,

"total_count": 0,

"url": "/v1/charges/ch_3MPY2AAFKzBRZEPq3Lo7im0H/refunds"

},

"review": null,

"shipping": null,

"source": null,

"source_transfer": null,

"statement_descriptor": null,

"statement_descriptor_suffix": null,

"status": "succeeded",

"transfer_data": null,

"transfer_group": null

}

],

"has_more": false,

"next_page": null,

"url": "/v1/charges/search"

}

2 件の回答
  1. 2023年1月20日 18:16

    You're getting that error because your sample has some empty lists []. Specifically:

    "amount_updates": [],

    "data": []

     

    Empty lists aren't supported. Without it, the structure isn’t defined and we can’t parse the callout’s JSON response into Apex defined types which makes it usable within Flow.

      

    Once you clear that error you’ll also receive the following error because looks like there are 17 fields with null value:

    Something's not right with the value specified for field null. Check it and try again.

     

    Null values are currently not accepted during Beta. To resolve, replace all instances with a sample value in the format that's expected (if a number supports decimal be sure to include a decimal in the sample).

0/9000