Bank Payments via PayPal REST API - api

I am attempting to use the PayPal REST API to process a bank transaction using the a bank account and routing number.
Here is the ref for the api that I am using for testing: https://api.sandbox.paypal.com/v1/payments/payment
Here is my JSON:
{
"intent":"sale",
"payer":{
"payment_method":"bank",
"funding_instruments":[
{
"bank_account":{
"account_number":"01234567890123456",
"account_number_type":"BBAN",
"routing_number":"012345678",
"account_type":"Checking",
"account_name":"Test Account",
"auth_type":"WEB",
"first_name":"John",
"last_name":"Doe",
"birth_date":"1970-01-01",
"billing_address":{
"line1":"Somewhere Street",
"line2":"Suite 200",
"city":"Atlanta",
"country_code":"US",
"postal_code":"30350",
"state":"GA"
}
}
}
]
},
"transactions":[
{
"amount":{
"currency":"USD",
"total":"100"
}
}
]
}
Here is the response from the call:
"{\"name\":\"NOT_IMPLEMENTED\",\"message\":\"NOT_IMPLEMENTED\",\"information_link\":\"https://developer.paypal.com/webapps/developer/docs/api/#NOT_IMPLEMENTED\",\"debug_id\":\"53fd10d0a05c\"}"
Any guidance would be much appreciated.

It doesn't appear that "bank_account" is a valid option for funding_instruments. The docs only lists "credit_card" and "credit_card_token"
https://developer.paypal.com/docs/api/#fundinginstrument-object

Related

Attempting to subscribe to a Shopify Webhook w/AWS EventBridge produces error: "Address is an AWS ARN and includes api_client_id 'x' instead of 'y'"

I'm running this request through Postman. Some posts to the Shopify developer forum (e.g., this one) express without clear explanation that the request should be made within the Shopify app that would be subscribing to the Webhooks, but Postman seems to work, too.
In Postman . . .
Here's the endpoint:
https://{{shopifyDevelopmentStoreName}}.myshopify.com/admin/api/2022-07/graphql.json
Here's the GraphQL body:
mutation createWebhookSubscription($topic: WebhookSubscriptionTopic!, $webhookSubscription: EventBridgeWebhookSubscriptionInput!) {
eventBridgeWebhookSubscriptionCreate(
topic: $topic,
webhookSubscription: $webhookSubscription
) {
webhookSubscription {
id
}
userErrors {
message
}
}
}
Here's the payload being sent (notice the "client_id_x" value within the arn property):
{
"topic": "PRODUCTS_CREATE",
"webhookSubscription": {
"arn": "arn:aws:events:us-east-1::event-source/aws.partner/shopify.com/client_id_x/LovecraftEventBridgeSource",
"format": "JSON",
"includeFields": "id"
}
}
Here's the response I receive:
{
"data": {
"eventBridgeWebhookSubscriptionCreate": {
"webhookSubscription": null,
"userErrors": [
{
"message": "Address is invalid"
},
{
"message": "Address is an AWS ARN and includes api_client_id 'client_id_x' instead of 'client_id_y'"
}
]
}
},
"extensions": {
"cost": {
"requestedQueryCost": 10,
"actualQueryCost": 10,
"throttleStatus": {
"maximumAvailable": 1000.0,
"currentlyAvailable": 990,
"restoreRate": 50.0
}
}
}
}
What's entirely unclear is why Shopify is insisting upon validity of "client_id_y" when, in AWS, the value being displayed is undeniably 'client_id_x'. Extremely confusing. I don't even see what difference using the Shopify app would make except that it produces a client_id value that works counter to one's expectations and intuitions.
Does anyone know why the heck Shopify isn't just using the client_id value of the event bus created earlier in Amazon EventBridge?
Same happend to me and I was lucky to find a solution.
The error message is just missleading.
I replaced the API Access Token for the Shopify Rest API Request (X-Shopify-Access-Token)
with the one from the Shopify App holding the aws credentials.
admin/settings/apps/development -> app -> API credentials -> Admin API access token. (can only be seen after creation)
Then I could subscribe webhooks to the app via the Rest Interface.

Amadeus Fare Rule request

Amedeus Api call,
I'm passing "include=detailed-fare-rules" in url encoded
https://test.api.amadeus.com/v2/shopping/flight-offers/pricing?include=detailed-fare-rules&originLocationCode=ISB&destinationLocationCode=KHI&departureDate=2022-05-01&returnDate=2022-05-18&adults=1&max=5
but it return the below error.
{
"errors": [
{
"status": 404,
"title": "No routing found for this resource/method/version combination.",
"code": 700,
"source": {
"pointer": "uri"
}
}
]
}
The Flight Offers Price API supports a POST method and only the include and forceClass are allowed as query parameters. Please check the API reference of the API.
The correct way to call the API to return the fare rules is the following:
POST https://test.api.amadeus.com/v1/shopping/flight-offers/pricing?include=detailed-fare-rules
with the following body:
{
"data":{
"type":"flight-offers-pricing",
"flightOffers":[
.....
]
}
}
In the flightOffers you have to pass the flight offer returned by the Flight Offers Search API for which you are looking the fare rules.

Invalid variant ID while creating checkout for Shopify

I am trying to create checkout url using Admin API with following params.
URL: https://shopy-test11.myshopify.com/admin/api/2020-10/checkouts.json
{
"checkout": {
"line_items": [
{
"variant_id": 37033347711169,"quantity": 2
}
]
}
}
Unfortunately its returning below error which is not properly documented anywhere that I could find.
{
"errors": {
"line_items": {
"0": {
"variant_id": [
{
"code": "invalid",
"message": "is invalid",
"options": {}
}
]
}
}
}
}
I also tried Shopify-api ruby gem and got same error. There are some similar issue online, but none answers why that issue is occurring and how to fix it. This is new app under development which will create custom checkout. There's only one sales channel which is "Online Store" and is enabled for all products. Any ideas how to fix this issue? Any help is appreciated.
You seem to be mixing up concepts here. The checkout API is only associated with the Storefront API, and has nothing to do with the Admin API.
So this URL: /admin/api/2020-10/checkouts.json seems to be impossible. There is no endpoint in the admin API for checkouts, whereas, Storefront API which does have checkouts, might be your proper URL. So try that:
/api/2020-10/checkouts.json
And if you have the correct token in your header, it will likely work.

UPS Shipping REST API

I am wanting to make a dummy REST call using UPS's API to generate a test fake shipment request.
I am following the REST UPS documentation for the shipping package:
https://www.ups.com/upsdeveloperkit/downloadresource?loc=en_US
Page 116 shows an example of a client application creating a shipment and getting a successful response with a shipping label. I would like to re-create this so I have attempted to POST some fake data to the TEST URL address:
https://wwwcie.ups.com/ship/v1/shipments
I make the request (with header and body information), but I keep receiving error code 120100 (missing or invalid shipper number).
A lot of forums posts are saying it has something to do with my address not being setup on my UPS account, but I already have an address setup on my account, and I just want to make a fake request to the TEST URL endpoint.
Here is the body of request:
{
"ShipmentRequest":{
"Shipment":{ "Description":"1206 PTR", "Shipper":{
"Name":"ShipperName", "AttentionName":"AttentionName", "TaxIdentificationNumber":"TaxID", "Phone":{
"Number":"1234567890" },
"ShipperNumber":"ShipperNumber", "Address":{
"AddressLine":"AddressLine", "City":"City", "StateProvinceCode":"STD", "PostalCode":"PostalCode", "CountryCode":"EN"
} },
"ShipTo":{
"Name":"ShipToName", "AttentionName":"AttentionName", "Phone":{
"Number":"1234567890" },
"FaxNumber":"1234567999", "TaxIdentificationNumber":"456999", "Address":{
"AddressLine":"AddressLine", "City":"City", "StateProvinceCode":"STD", "PostalCode":"PostalCode", "CountryCode":"EN"
} },
"ShipFrom":{ "Name":"ShipperName", "AttentionName":"AttentionName", "Phone":{
"Number":"1234567890" },
"FaxNumber":"1234567999", "TaxIdentificationNumber":"456999", "Address":{
"AddressLine":"AddressLine", "City":"City",
"StateProvinceCode":"STD", "PostalCode":"PsotalCode", "CountryCode":"EN"
} },
"PaymentInformation":{ "ShipmentCharge":{
"Type":"01", "BillShipper":{
"AccountNumber":"AccountNumber" }
} },
"Service":{
"Code":"01", "Description":"Expedited"
},
"Package":[{ "Description":"International Goods", "Packaging":{
"Code":"02" },
"PackageWeight":{ "UnitOfMeasurement":{
"Code":"LBS" },
"Weight":"10" },
"PackageServiceOptions":"" },
{
"Description":"International Goods", "Packaging":{
"Code":"02" },
"PackageWeight":{ "UnitOfMeasurement":{
"Code":"LBS" },
"Weight":"20" },
"PackageServiceOptions":"" }]
, "ItemizedChargesRequestedIndicator":"", "RatingMethodRequestedIndicator":"", "TaxInformationIndicator":"", "ShipmentRatingOptions":{
"NegotiatedRatesIndicator":"" }
}, "LabelSpecification":{
"LabelImageFormat":{ "Code":"GIF"
} }
} }
I resolved this issue by finding the Shipper Number (Account Number) linked to the UPS developer account.

Square REST API: Error issuing refund

Every time I try to refund a card, I get the JSON pasted below. This happens after I authorize a card, then capture the charge, then want to issue a partial refund. For “tender_id” I have tried both the transaction ID and the ID I am handed during the authorization. Of course for the capture there is no tender_id or id because a successful capture returns just “{}”.
I am also using sandbox credentials. The charge was done with a nonce generated with sandbox credentials as well.
What’s wrong?
Thanks...
POST to:
https://connect.squareup.com/v2/locations/CBASEHHNorL75TjuSOAvKQLnuNYgAQ/transactions/a2905f34-c8e8-5534-7676-82e8c580e9bf/refund
With this JSON:
{
"idempotency_key":"6464dc19-1703-47c0-81f9-4f0f1361eada",
"tender_id":"291d56b3-1e73-5bff-6e8e-719fd134b83f",
"reason":”Partial refund",
"amount_money":{
"amount":4500,
"currency":"USD"
}
}
Gives this reply:
{
"errors": [
{
"category": "INVALID_REQUEST_ERROR",
"code": "NOT_FOUND",
"detail": "Location `CBASEHHNorL75TjuSOAvKQLnuNYgAQ` does not have a transaction tender with ID `291d56b3-1e73-5bff-6e8e-719fd134b83f`."
}
]
}
UPDATE: The result from the requested GET call (in the comments to the answer) is:
{
"transaction":{
"id":"a2905f34-c8e8-5534-7676-82e8c580e9bf",
"location_id":"CBASEHHNorL75TjuSOAvKQLnuNYgAQ",
"created_at":"2017-02-21T22:08:10Z",
"tenders":[
{
"id":"a18b98c7-5ac7-51c1-618c-3b95ee124c1b",
"location_id":"CBASEHHNorL75TjuSOAvKQLnuNYgAQ",
"transaction_id":"a2905f34-c8e8-5534-7676-82e8c580e9bf",
"created_at":"2017-02-21T22:08:10Z",
"note":"Online Transaction",
"amount_money":{
"amount":12500,
"currency":"USD"
},
"processing_fee_money":{
"amount":372,
"currency":"USD"
},
"type":"CARD",
"card_details":{
"status":"CAPTURED",
"card":{
"card_brand":"VISA",
"last_4":"5858"
},
"entry_method":"KEYED"
}
}
],
"reference_id":"63614ae8-539a-4339-b5c7-554bae64fbed",
"product":"EXTERNAL_API"
}
}
After you capture, have you tried listing/retrieving the transaction to get the full details, including tender ids? Could you post your response from GET /v2/locations/CBASEHHNorL75TjuSOAvKQLnuNYgAQ/transactions/a2905f34-c8e8-5534-7676-82e8c580e9bf if that doesn't work?