I am trying to send an invoice through the sandbox using PayPal API. I can successfully send and create and invoice using sample data. But I do not want it to be Net_10. I want Due On Receipt. I can not find any documentation giving the exact way to write it. I have tried Upon_Receipt, DueUponReceipt, and On_Receipt. Want to change term_type and remove due_date.
"payment_term": {
"term_type": "NET_10",
"due_date": "2018-11-22"
},
+"name": "INVALID_REQUEST"
+"message": "Request is not well-formed, syntactically incorrect, or violates schema."
+"debug_id": "dd55a145fdb2f"
+"details": array:1 [▼
0 => {#1471 ▼
+"field": "detail/payment_term/term_type"
+"location": "body"
+"description": "Cannot construct instance of `com.paypal.invoicing.v2.model.PaymentTerm$TermType`, problem: On_Receipt at line:10, column:20" ````
Related
I want to integrate shopware in my application and I have a problem with the api.
I used dockware.io solution to get started with shopware and create a demo store. I was able to create customers and products and place orders.
But while I request the order through the API, I am not able to get lineItems of the order, it is always null. I have the same problem with the deliveries attribute. Here is a screenshot of the response to my request.
Why am I not receiving the items in the reply? Is there any other request I can make to receive them?
You need to add the lineItems association in the request body of your API request. Same for the deliveries association and so on.
{
"associations": {
"lineItems": [],
"deliveries": []
}
}
I have been using Amadeus api to design a flight booking system. Sometimes, it goes through and the flight booking works (note that i am in sandbox mode) while some times i run into errors some of which i can't explain. I can test it now and it works and in another ten minutes i test again and an error pops up. I would love to know meaning of the frequent ones i get and how to avoid them.
here is one
"errors" : [ {
"status" : 400,
"code" : 34651,
"title" : "SEGMENT SELL FAILURE",
"detail" : "Could not sell segment 1",
"source" : {
"pointer" : "/data/flightOffers[0]/itineraries[0]/segments[0]"
}
} ]
}
here is another
"errors" : [ {
"code" : 4926,
"title" : "INVALID DATA RECEIVED",
"detail" : "No fare applicable",
"status" : 400
} ]
}```
INVALID DATA RECEIVED means that some of the data in your query is false. It can be that you sent a fare that does not match your class or the flight number is incorrect etc. This is common to all our APIs, it comes from the API backend validating your query.
SEGMENT SELL FAILURE this means that you were not able to book the seat you want in the inventory of the airline. Most of the time, it comes from the flight being full. In the test environment, you can perform many bookings without restrictions (no real payment), but the inventory is a copy of the real one, so if you book many seats, the inventory will be empty and you won't be able to book anymore. It can come from a wrong fare, or flight number as well. The good practice is to price right before booking (note that in test it can still happen as many bookings are going at the same time from other users). But with this message, it is the inventory that rejects you.
I'm attempting to get a list of recent transactions/orders from the Square Connect API V2 that lists out exactly what was purchased.
I tried the suggestion posted here:
How to retrieve Square orderIds for Call to BatchRetrieveORders
and received the error "Provided merchant_id and merchant_id in authorization do not match up."
I also attempted "v2/locations/(locationID)/orders/batch-retrieve" and received the error:
{
"success": false,
"message": {
"resource_bundle_name": "com.squareup.webservice.WebserviceMessages",
"key": "there.was.a.problem.processing.this.request",
"arguments": []
},
"debug_info": ""
}
I am able to get a list of transactions, but it isn't useful to me without the item information.
I'm using a personal account with the Personal Access Token.
This looks like a well-handled error in terms of its messaging. I suspect that the error message is telling you what you need to know. From this post, a Square employee mentioned that the cause is likely that you are:
using OAuth credentials for one merchant but attempting to retrieve data for another merchant. For example, if you have OAuth tokens for merchant A with location B but try to list payments for location token X that belongs to a different merchant Y, you will get this error.
You should validate that the token you're using is correct for the merchant you're trying to retrieve data for. If you're certain it's correct, I'd reach out to Square directly as there may be an issue with this token.
I am trying to do a simple Lead create/update via the Marketo API from a web form. I am posting data to multiple sources, not just Marketo, so I have other fields that don't match any fields during the Marketo update. This throws an API error of 1006 http://developers.marketo.com/documentation/rest/error-codes/
Here is an example JSON:
{
"action": "createOrUpdate",
"lookupField": "email"
"input": [
{
"firstName": "Matthew Edward",
"campaign_id": "testingCID",
"lastName": "King",
"email": "mking#umbel.com"
"message": "",
}
]
}
Since "campaign_id" and "message" aren't fields in the Lead capture, it throws the error and won't import anything. I would rather not write a function that cleans this data JUST for the the Marketo import. It would make future web forms more scalable if we didn't have to create a "blacklist" of fields that can't be imported into Marketo.
Is there anyway to avoid this error? Thanks.
This is by design. As you mentioned, the Marketo API will return the 1006 error code if a lead field you attempt to update does not exist in Marketo.
If writing a function that excludes this data is not an option, another option would be to create custom fields in Marketo for each custom field you need to update via the API.
I using Instagram API to get user info
api = InstagramAPI(access_token=access_token)
profile = api.user(user_id="kallaucyahoocojp") # I try to put output data to profile variable here
And I get the below error:
DownloadError: Unable to fetch URL: https://api.instagram.com/v1/users/kallaucyahoocojp.json?access_token=(u'1191812153.f78cd79.d2d99595c79d4c23a7994d85ea0d412c', {u'username': u'kallaucyahoocojp', u'bio': u'\u30c4\u30a4\u30c3\u30bf\u30d5\u30a9\u30ed\u30ef\u30fc\u5897\u52a0\u30b5\u30fc\u30d3\u30b9', u'website': u'http://twitter\u30d5\u30a9\u30ed\u30ef\u30fc.jp', u'profile_picture': u'http://images.ak.instagram.com/profiles/anonymousUser.jpg', u'full_name': u'Kallauc', u'id': u'1191812153'})
Can anybody help me to fix it?
You need to pass the numeric-based user id, rather than the username. For example, instead of passing kallaucyahoocojp, you might pass 1234 if t
Here's how to get the ID if you don't have it:
Search for the instagram user id using this endpoint. In the python api:
api.user_search(q="kallaucyahoocojp", count=100)
Check the results for an exact string match on each user name while iterating through the results (calling .lower() to be sure to ignore potential case issues).
If you don't find the user in the first page of results, call to the next page using the max id returned.
Get the user id object from the returned from the matching users search result, then call your original function again with the numeric id.
A couple of very important notes:
Notice that I called the search function for users with a count of 100. You can pick any number, but contrary to other SO posts, the first user is not always the user you want in a search. The search can and will match partials, and not always according to an exact match first. How do I know? I have production instagram apps. I will qualify and say that usually the results are in the first 2-3 matches. Decide what is cheaper; repeated API calls that bring you closer to the limit, or 1 large bulk call where you are certain to get all the results.
The python Instagram API last I checked does a terrible job returning paging information. You actually get the paging URL which defeats the purpose of the python API itself to get additional pages. Your options are extract the next id parameter from the URL using urlparse or something similar, or fix the API to return the paging data as an object per the json (I've done both). What happens is the API itself is discarding part of the json and only giving you the URL which normally you don't want/need.
In your example, here's the search response:
{
"meta": {
"code": 200
},
"data": [
{
"username": "kallaucyahoocojp",
"bio": "ツイッタフォロワー増加サービス",
"website": "http://twitterフォロワー.jp",
"profile_picture": "http://images.ak.instagram.com/profiles/anonymousUser.jpg",
"full_name": "Kallauc",
"id": "1191812153"
}
]
}
Revising your call:
api = InstagramAPI(access_token=access_token)
profile = api.user(user_id="1191812153")
I should note that you may not need to call the user call if you did a search because you may simply have all the info you need. It will depend on what you are doing of course, so I am giving you the general method to use the rest of the user api.
For extracting profile info using Instagram API, userid is required.
The endpoint for extracting userID:
https://api.instagram.com/v1/users/search?q=[username]&access_token=[HERE]
The endpoint for extracting profile info:
https://api.instagram.com/v1/users/[userid]/?access_token=[HERE]
Note that before extracting information, check the login permissions for your access token.