can anyone please explain how to extract billing information from a Reseller's Perspective? i mean i want to get -if possible- a general billing file and also a more detailed report-let's say for each customer. Is that possible?
Thanks, Alex
Use the Customers: get method.
You need to supply customerId which is actually a customer's unique identifier or primary domain name. If successful you will get a 200 response code and a response body just like below.
{
"kind": "reseller#customer",
"customerId": string,
"customerDomain": string,
"postalAddress": {
"kind": "customers#address",
"contactName": string,
"organizationName": string,
"locality": string,
"region": string,
"postalCode": string,
"countryCode": string,
"addressLine1": string,
"addressLine2": string,
"addressLine3": string
},
"phoneNumber": string,
"alternateEmail": string,
"resourceUiUrl": string,
"customerDomainVerified": boolean
}
Related
I'm trying to place an order via Magento 2 API as a guest, following the guidance shown here:
https://devdocs.magento.com/guides/v2.4/rest/tutorials/orders/order-create-order.html
The end point I'm using is:
https://[domain]/rest/V1/guest-carts/'.$quote_id.'/payment-information
with quote_id being the ID of the quote created initially
Steps 1-6 complete successfully with relevant response being returned as expected.
But sending the following payload (literally a copy and paste from the docs) to the above endpoint:
{
"paymentMethod": {
"method": "banktransfer"
},
"billing_address": {
"email": "jdoe#example.com",
"region": "New York",
"region_id": 43,
"region_code": "NY",
"country_id": "US",
"street": [
"123 Oak Ave"
],
"postcode": "10577",
"city": "Purchase",
"telephone": "512-555-1111",
"firstname": "Jane",
"lastname": "Doe"
}
}
Results in this error message:
{"message":""%fieldName" is required. Enter and try again.","parameters":{"fieldName":"email"}}
The email address IS obviously being supplied, and am really at a loss as to what's going wrong.
For info, the API this is being sent to is a vanilla install of Magento set up with a test product for testing purposes
Does anyone have any ideas, or at least some suggestions as to how I can debug given the not very usefulness of the error message given?
You are Sending POST Request so you also have to send data in POST request in json format like :{ ""id"": {}}
And have to set Content-Type:application/json in http header.
I want to insert array of string in my product table, i am very new in this mysql. like in mongodb i do it like this to store list of photos
const productSchema = mongoose.Schema({
name : {type:String,trim : true},
preview : String,
photos : [String],
description : String,
isAccessory : Boolean,
brand : String,
price : Number
})
and this is my request body
{
"id": "1",
"name": "Men Navy Blue Solid Sweatshirt",
"preview": "https://assets.myntassets.com/h_1440,q_100,w_1080/v1/assets/images/7579188/2018/11/5/08a7b230-ee8f-46c0-a945-4e835a3c01c01541402833619-United-Colors-of-Benetton-Men-Sweatshirts-1271541402833444-1.jpg",
"photos": [
"https://assets.myntassets.com/h_1440,q_100,w_1080/v1/assets/images/7579188/2018/11/5/08a7b230-ee8f-46c0-a945-4e835a3c01c01541402833619-United-Colors-of-Benetton-Men-Sweatshirts-1271541402833444-1.jpg",
"https://assets.myntassets.com/h_1440,q_100,w_1080/v1/assets/images/7579188/2018/11/5/efc3d5b9-1bb3-4427-af53-7acae7af98951541402833591-United-Colors-of-Benetton-Men-Sweatshirts-1271541402833444-2.jpg",
"https://assets.myntassets.com/h_1440,q_100,w_1080/v1/assets/images/7579188/2018/11/5/c7e58861-3431-4189-9903-9880f5eebd181541402833566-United-Colors-of-Benetton-Men-Sweatshirts-1271541402833444-3.jpg",
"https://assets.myntassets.com/h_1440,q_100,w_1080/v1/assets/images/7579188/2018/11/5/66490b64-32de-44b4-a6e4-fe36f1c040051541402833548-United-Colors-of-Benetton-Men-Sweatshirts-1271541402833444-4.jpg",
"https://assets.myntassets.com/h_1440,q_100,w_1080/v1/assets/images/7579188/2018/11/5/957be784-7c5d-4e90-ab9f-0928015b22891541402833645-United-Colors-of-Benetton-Men-Sweatshirts-1271541402833444-5.jpg"
],
"description": "Navy solid sweatshirt with patchwork, has a round neck, long sleeves, straight hem",
"isAccessory": false,
"brand": "United Colors of Benetton",
"price": 2599
},
now how can i do this in sql like what the table design for it.
As per my understanding I can think of two possible options:
Option-1:
MySQL supports storing JSON. Store the string array in as a value against the desired key.
Option-2:
Store the string value with JSON.stringify.
For the last few hours, I have been trying to find a solution to updating/uploading videos to many different languages throw the YouTube V3 API.
I can set the defaultLanguage,
"defaultLanguage": string
I can set video title and description,
"title": string,
"description": string,
or maybe there is a way of uploading many different snippets in different languages?
"snippet": {
"publishedAt": datetime,
"channelId": string,
"title": string,
"description": string,
"thumbnails": {
(key): {
"url": string,
"width": unsigned integer,
"height": unsigned integer
}
},
I don't see a way of translating the title and descriptions.
I see that it might be possible to do with the "localized" property but, I do not know if it is even possible or if it is the best way to do it.
"localized": {
"title": string,
"description": string
},
I would like to have some suggestions since I'm so new to YouTube API and I find this would be a very easy question to answer if you knew the answer, I do not expect any code or a complex solution but just to be guided, thanks for the help.
I found the solution, localizations is what it's called.
https://developers.google.com/apis-explorer/#p/youtube/v3/youtube.videos.update
PUT https://www.googleapis.com/youtube/v3/videos?part=localizations&key={YOUR_API_KEY}
{
"id": "kE7dYgd3F8E", //https://www.youtube.com/edit?video_id=kE7dYgd3F8E
"localizations": {
"es-do": { //local codes, http://www.science.co.il/Language/Locale-codes.php
"title": "Translated title",
"description": "Translated description"
}
}
}
I am new in back end development. I have already write the API to update user info, whose request body like this -
{
"id": 26,
"email": "tom.richards#yahoo.com",
"firstName": "Tommy",
"lastName": "Richards",
"photoUrl": null,
"userAddress": [
{
"id": 8,
"type": "home",
"addressLine1": "DP Road",
"addressLine2": "Main Street",
"city": "Los Angel",
"state": "CA",
"country": "USA",
"postalCode":915890
},
{
"id": 25,
"type": "office",
"addressLine1": "Dr Red Road",
"addressLine2": null,
"city": "SA",
"state": "CA",
"country": "USA",
"postalCode":918950
}
]
}
Where should ideally validate the address type [in my case home or office] in front end[Web site or Phone] or back end [server side] or both side? Which is good approach to validate address type ? If we validate it on backend side, which will cause any performance issue ?
Note -
If the developer pass any string, the address type of like pass string will create in DB.
It's a good approach for the back end validate everything it gets from any web request, as you can't tell if its a good request coming from your web site or some other source (maybe even some malicious attack). The back-end must protect itself and validates everything it gets.
On top of it, on some (if not all) cases it's good to do some validations on the front end side too, one reason is that if you have a request that you know the back end is going to fail- save yourself the trouble and check it before you do an expensive request
Reasons
Front End Validation : Validation on the server, User has to wait for the response in case of the invalid data.
Backend Validation : To make sure that the data could not alter by the intruder.
Validate #database end : Like Mongoose provide the built in and custom validation.
As per the requirement we have to cross check the data before user profile update.
This may be a dumb question, but I am architecting a web app from scratch and looking for content to be stored in MongoDB in a JSON-LD compliant way.
My user Schema looks something like this:
{"auth": {
"local": {
"email": String,
"password": String,
},
"firebase" : {
"uid" : String
},
"facebook": {
"id" : String,
"token" : String,
"email" : String,
"name" : String
}
},
"profile_contents" : {
"id" : {
"firstname" : {"value": String},
"lastname" : {"value": String},
"email" : [String],
"dob": Date,
"gender": {type: String, enum: genderTypes}
},
"profile" : {
"displayName": String,
"img": String,
"website" : String,
"organisation": String
}
}}
Questions:
Most of the content in the id and profile objects will make its way to a restful endpoint. It makes sense for these to be mapped to schemas. But the Auth object will rarely (never?) be exposed to the API and will be used for backend operations.. should these still be mapped to a schema, if so, how?
Regardless of the answer to (1) are there scehmas suited to mapping credentials like those listed? (e.g. suppose we want to expose auth.firebase.uid at one point.. should this be part of a custom vocab or mapped to an already existing one? Schema.org didn't have anything (other than accountId - which seems to be aimed at eCommerce payment use cases).
Thanks!