Post carrier to Bigcommerce Shipments API - bigcommerce

When an item ships via FedEx I want the end customer to see a FedEx tracking number. How do I indicate the carrier? Do I put "FedEx" in the shipping_method field?

The shipping carrier can only be set during the initial POST and not with subsequent PUT requests. When creating a shipment and you want to denote the shipping carrier, you should send a POST request with a json body such as:
[
{
"id": 1,
"order_id": 115,
"customer_id": 0,
"order_address_id": 16,
"date_created": "Wed, 19 Dec 2012 17:17:10 +0000",
"tracking_number": "111222333444",
"shipping_method": "None",
"shipping_provider": "fedex",
"tracking_carrier": "fedex",
"comments": "A sample shipment for order 115",
"billing_address": {
"first_name": "Louise",
"last_name": "Dean",
"company": "Skiptube",
"street_1": "147 Meadow Vale Way",
"street_2": "",
"city": "Fullerton",
"state": "Rhode Island",
"zip": "74674",
"country": "United States",
"country_iso2": "US",
"phone": "7-(086)085-9448",
"email": ""
},
"shipping_address": {
"first_name": "Louise",
"last_name": "Dean",
"company": "Skiptube",
"street_1": "147 Meadow Vale Way",
"street_2": "",
"city": "Fullerton",
"state": "Rhode Island",
"zip": "74674",
"country": "United States",
"country_iso2": "US",
"phone": "7-(086)085-9448",
"email": ""
},
"items": [
{
"order_product_id": 16,
"product_id": 0,
"quantity": 1
}
]
}
]

Yes, "shipping_method" is the correct property to use for the carrier name.

Related

Microsoft Booking Appointment Graph API -Only Post Request Not working

when I trying to create Microsoft Booking Appointment through Graph API
Only Post Request Not working .
GET , PATCH , DELETE Reuqest are working fine
through postman
same post request is working find on graph explorer platform . but not on posmant with
my auth token
my post API
https://graph.microsoft.com/v1.0/solutions/bookingBusinesses/XXXXXXXXXXXXXXX.com/appointments
and body (took example from here)
excluded optional properties like servicename and customers
{
"#odata.type": "#microsoft.graph.bookingAppointment",
"customerTimeZone": "America/Chicago",
"smsNotificationsEnabled": false,
"endDateTime": {
"#odata.type": "#microsoft.graph.dateTimeTimeZone",
"dateTime": "2023-01-02T14:30:00.0000000",
"timeZone": "UTC"
},
"isLocationOnline": true,
"optOutOfCustomerEmail": false,
"anonymousJoinWebUrl": null,
"postBuffer": "PT10M",
"preBuffer": "PT5M",
"price": 10,
"priceType#odata.type": "#microsoft.graph.bookingPriceType",
"priceType": "fixedPrice",
"reminders#odata.type": "#Collection(microsoft.graph.bookingReminder)",
"reminders": [
{
"#odata.type": "#microsoft.graph.bookingReminder",
"message": "This service is tomorrow",
"offset": "P1D",
"recipients#odata.type": "#microsoft.graph.bookingReminderRecipients",
"recipients": "allAttendees"
},
{
"#odata.type": "#microsoft.graph.bookingReminder",
"message": "Please be available to enjoy your lunch service.",
"offset": "PT1H",
"recipients#odata.type": "#microsoft.graph.bookingReminderRecipients",
"recipients": "customer"
},
{
"#odata.type": "#microsoft.graph.bookingReminder",
"message": "Please check traffic for next cater.",
"offset": "PT2H",
"recipients#odata.type": "#microsoft.graph.bookingReminderRecipients",
"recipients": "staff"
}
],
"serviceId": "XXXXXXXXXXXXXXXXXXXXX",
"serviceLocation": {
"#odata.type": "#microsoft.graph.location",
"address": {
"#odata.type": "#microsoft.graph.physicalAddress",
"city": "Buffalo",
"countryOrRegion": "USA",
"postalCode": "98052",
"postOfficeBox": null,
"state": "NY",
"street": "123 First Avenue",
"type#odata.type": "#microsoft.graph.physicalAddressType",
"type": null
},
"coordinates": null,
"displayName": "Customer location",
"locationEmailAddress": null,
"locationType#odata.type": "#microsoft.graph.locationType",
"locationType": null,
"locationUri": null,
"uniqueId": null,
"uniqueIdType#odata.type": "#microsoft.graph.locationUniqueIdType",
"uniqueIdType": null
},
"serviceNotes": "Customer requires punctual service.",
"startDateTime": {
"#odata.type": "#microsoft.graph.dateTimeTimeZone",
"dateTime": "2023-01-02T14:00:00.0000000",
"timeZone": "UTC"
},
"maximumAttendeesCount": 1,
"filledAttendeesCount": 1
}

HERE Geocoding API - How to get 6 character postal code from Canada locations

When submitting get requests to HERE geocoding for Canadian locations, I am receiving a 3 character postal code instead of a 6 character code.
https://geocode.search.hereapi.com/v1/geocode?q=VICTORIA%2C+BC&limit=1&apiKey=xxxxx
Submitted Location
City = Victoria
State = BC
Postal Code Output
V8W
In this case I am expecting the 6 character code to be returned as something like V8W 2L9. Is there anyway I can express this format in the get request?
Raw Output
b'{"items":[{"title":"Victoria, BC, Canada","id":"here:cm:namedplace:21160111","resultType":"locality","localityType":"city","address":{"label":"Victoria, BC, Canada","countryCode":"CAN","countryName":"Canada","stateCode":"BC","state":"British Columbia","county":"Capital","city":"Victoria","postalCode":"V8W"},"position":{"lat":48.42855,"lng":-123.36445},"mapView":{"west":-123.39443,"south":48.40302,"east":-123.32237,"north":48.45036},"scoring":{"queryScore":1.0,"fieldScore":{"country":1.0,"state":1.0,"city":1.0}}}]}'
The address input need to be more specific. Then you will retrieve also the six digit postal codes in Canada. Here and example:
https://geocode.search.hereapi.com/v1/geocode?q=86%20Irving%20Ave,%20Ottawa&limit=1&apikey=
{
"items": [
{
"title": "86 Irving Ave, Ottawa, ON K1Y 1Z4, Canada",
"id": "here:af:streetsection:KcoGTVJ7ADcsOiFrsy.DoC:CggIBCD3-YLRAhABGgI4Ng",
"resultType": "houseNumber",
"houseNumberType": "PA",
"address": {
"label": "86 Irving Ave, Ottawa, ON K1Y 1Z4, Canada",
"countryCode": "CAN",
"countryName": "Canada",
"stateCode": "ON",
"state": "Ontario",
"county": "Ottawa",
"city": "Ottawa",
"district": "Hintonburg-Mechanicsville",
"street": "Irving Ave",
"postalCode": "K1Y 1Z4",
"houseNumber": "86"
},
"position": {
"lat": 45.40361,
"lng": -75.72205
},
"access": [
{
"lat": 45.40364,
"lng": -75.72191
}
],
"mapView": {
"west": -75.72333,
"south": 45.40271,
"east": -75.72077,
"north": 45.40451
},
"scoring": {
"queryScore": 1.0,
"fieldScore": {
"city": 1.0,
"streets": [
1.0
],
"houseNumber": 1.0
}
}
}
]
}

Get nested data c.<type>.<type> in SQL Query?

I've been searching everywhere for this seemingly simple action: I'd like to select only a certain few data type from a nested source.
The closest that I can get to the solution is this:
SELECT c.receipt_number, c.millitime, c.email, c.phone, c.shipping, c.shipping_note, c.amount_paid, i.description, i.quantity
FROM c
JOIN i IN c.line_items
WHERE c.millitime > 1627813253000
But this will create lots of duplicated data, like the receipt_number, email, etc in the example:
[
{
"receipt_number": null,
"millitime": 1627813377000,
"email": "test#gmail.com",
"phone": "000000000",
"shipping": {
"address": {
"city": "Sydney",
"country": "AU",
"line1": "Test Street",
"line2": null,
"postal_code": "3000",
"state": "VIC"
},
"name": "New Cust"
},
"shipping_note": "Please knock on door.",
"amount_paid": 104,
"description": "Curry Chicken",
"quantity": 1
},
{
"receipt_number": null,
"millitime": 1627813377000,
"email": "test#gmail.com",
"phone": "000000000",
"shipping": {
"address": {
"city": "Sydney",
"country": "AU",
"line1": "Test Street",
"line2": null,
"postal_code": "3000",
"state": "VIC"
},
"name": "New Cust"
},
"shipping_note": "Please knock on door.",
"amount_paid": 104,
"description": "Chicken Noodle",
"quantity": 8
}
]
Is there a way to create a nested result of c.line_items with just the desired data description and quantity? The final result should be similar to:
[
{
"receipt_number": null,
"millitime": 1627813377000,
"email": "test#gmail.com",
"phone": "000000000",
"shipping": {
"address": {
"city": "Sydney",
"country": "AU",
"line1": "Test Street",
"line2": null,
"postal_code": "3000",
"state": "VIC"
},
"name": "New Cust"
},
"shipping_note": "Please knock on door.",
"amount_paid": 104,
"line_items": [
{
"description": "Chicken Noodle",
"quantity": 8
},
{
"description": "Curry Chicken",
"quantity": 1
}
]
}
]
I have created the same in
You can use distinct keyword to remove duplicates from the results.
Add c.line_items to your select list and change i.description, i.quantity to c.description, c.quantity to add view under line_items.
Query:
SELECT distinct c.receipt_number, c.millitime, c.email, c.phone, c.shipping, c.shipping_note, c.amount_paid, c.line_items
FROM c
JOIN i IN c.line_items
WHERE c.millitime > 1627813253000
Result:
Reference: Azure Cosmos DB SQL query - JSON items

How to select column with json without sending column name?

I'm setting up an API with Node and postgreSQL-node (pg), and when I query for the column in my data base that contains JSON it returns an array of objects with the columns name and the json I want to access.
My current query is:
select jsondata
from breweries
The output is:
[
{
"jsondata": {
"id": 2,
"name": "Avondale Brewing Co",
"brewery_type": "micro",
"street": "201 41st St S",
"city": "Birmingham",
"state": "Alabama",
"postal_code": "35222-1932",
"country": "United States",
"longitude": "-86.774322",
"latitude": "33.524521",
"phone": "2057775456",
"website_url": "http://www.avondalebrewing.com",
"updated_at": "2018-08-23T23:19:57.825Z",
"tag_list": []
}
},
{"jsondata": {...}},
{...}
]
My expectation is to get and array with the contents inside "jsondata" without the name of the column "jsondata", but I can't find a way to access it one level in my query.
Edit:
Here is what I expect:
[
{
"id": 2,
"name": "Avondale Brewing Co",
"brewery_type": "micro",
"street": "201 41st St S",
"city": "Birmingham",
"state": "Alabama",
"postal_code": "35222-1932",
"country": "United States",
"longitude": "-86.774322",
"latitude": "33.524521",
"phone": "2057775456",
"website_url": "http://www.avondalebrewing.com",
"updated_at": "2018-08-23T23:19:57.825Z",
"tag_list": []
},
{...},
{...}
]
I'm not sure what exact output you're expecting, but you can convert the array of dictionaries to rows and then return the jsondata values as individual rows using this:
SELECT jsonb_array_elements(jsondata)->'jsondata'
FROM breweries
Is that along the lines of what you want?
SQL Fiddle

How to process payments with service fee being deducted in Visa Cybersource Payments API?

I have an app that I would like to add payment processing similar to Amazon payment processing into it where sub-merchants get paid by customers with service fee being deducted, I can see in https://developer.visa.com/capabilities/cybersource/reference#cybersource__cybs_payments_v2__v2__process_a_payment the following request body but there is no field in request body to specify a service fee:
{
"clientReferenceInformation": {
"code": "TC588171_3"
},
"processingInformation": {
"commerceIndicator": "internet"
},
"aggregatorInformation": {
"subMerchant": {
"cardAcceptorID": "1234567890",
"country": "US",
"phoneNumber": "650-432-0000",
"address1": "900 Metro Center",
"postalCode": "94404-2775",
"locality": "Foster City",
"name": "Visa Inc",
"administrativeArea": "CA",
"region": "PEN",
"email": "test#cybs.com"
},
"name": "V-Internatio",
"aggregatorID": "123456789"
},
"orderInformation": {
"billTo": {
"country": "US",
"lastName": "VDP",
"address2": "Address 2",
"address1": "201 S. Division St.",
"postalCode": "48104-2201",
"locality": "Ann Arbor",
"administrativeArea": "MI",
"firstName": "RTS",
"phoneNumber": "999999999",
"district": "MI",
"buildingNumber": "123",
"company": "Visa",
"email": "test#cybs.com"
},
"amountDetails": {
"totalAmount": "102.21",
"currency": "USD"
}
},
"paymentInformation": {
"card": {
"expirationYear": "2031",
"number": "5555555555554444",
"securityCode": "123",
"expirationMonth": "12",
"type": "002"
}
}
}
Is there a way or a workaround to get a service fee deducted?
Service fees go in the orderInformation block. Like this:
"orderInformation": {
"amountDetails": {
"totalAmount": "102.21",
"currency": "USD",
"serviceFeeAmount": "3.00"
},
There are a few prerequisites to using service fees. One of which you must be using First Data as your processor. For more details check this documentation.