Export Order Through API In Shiphero Getting Forbidden Issue

API REQUEST

https://api-gateway.shiphero.com/v1.2/general-api/order-creation/

header

x-api-key :edited
Content-Type :- application/json
Accept encoding :- application/json

{
“token”:“edited”,
email":"k@test.com”,
“line_items”:[
{
“sku”:“43”,
“name”:“Apple Iphone”,
“price”:“500.0”,
“quantity”:“1.0”,
“id”:“125”
}
],
“total_tax”:“0.0”,
“shipping_lines”:{

  "title":"S00061",
  "price":"500.0"

},
“order_id”:“62”,
“profile”:“default”,
“shipping_address”:{

  "province":"Arkansas",
  "city":"Jonesboro",
  "first_name":"Krishna",
  "last_name":"Krishna",
  "zip":"62000",
  "province_code":"123",
  "country":"AL",
  "company":"Krishna",
  "phone":"+9098879383",
  "country_code":"AL",
  "address1":"3404  Edgewood Road"

},
“subtotal_price”:“500.0”,
“created_at”:“2020-06-18”,
“total_price”:“500.0”
}

Hi @bhautik!
I edited the token for security reasons, are you looking for the mutation to replace this request?
You should be able to find this at https://developer.shiphero.com/examples-mutation/#orderCreate
Also, as you posted on this particular thread in case it helps, there is an offer in this post that might be useful: Offering intergration help between your system and Shiphero

Let me know if there is anything else I could help you with.
Thanks in advance!
Tom

Hi @tomasw

Thanks for the quick response !

Shiphero change the api ? now onward we need to use this api
https://developer.shiphero.com/examples-mutation/#orderCreate ?

I am waiting for your reply

Thanks in Advance

Hi @bhautik
That is correct, the GraphQL Public API now will allow you to create orders using that mutation.
Let me know if there is anything else I could help you with.
Thanks again!
Tom

Hi @tomasw

We have call the api with new document here it the api request and url we are getting 403 error. we have enter dummy token for security purpose.

header
Authorization :- Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXabcVCIsImtpZCI6IlJUQXlOVU13T0Rrd09ETXhSVVZDUXpBNU5rSkVOVVUxUmtNeU1URTRNMEkzTWpnd05ERkdNdyJ9.eyJodHRwOi8vc2hpcGhlcm8tcHVibGljLWFwaS9hcHAiOnsibmFtZSI6IlNoaXBoZXJvIFB1YmxpYyBBUEkgR2F0ZXdheSIs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OtX97uQwplNn4S8_p5ixfEZjR-WoJec27MeAeEyJtSN-VayFH2wMc-04p4-QUXZmlerPKPcPZI6zrPsYeVpeHoBwRJg5xCC98KV2-Ess9BKBVOh4Ar4w1qQx2pT_OoUinKQEZSKMaeLLQ5us1f-4rttdQUuBxpHU5VrBWRWcpHKq7px87ZGdSUu8J4HPDxMkrjDt2l3iIiFltxiunNVHlxfh56wn_8YPEVFH2E_JnQVNZHXrrApufKOAX90GPmZ55tgp95T5cmPfGW4y9U3gX4CUVrYXGgd8bZs84xtkddl8eYAIpoQliDOJxML39kNVseYS4QTHmcMrUmvZeEbyA

Content-Type :- application/json

request_data :-
{“mutation” : {
“order_create” :{
“data”: {
“order_number”: “11223344”,
“shop_name”: “ExampleShop”,
“fulfillment_status”: “pending”,
“order_date”: “2019-07-29”,
“total_tax”: “29.00”,
“subtotal”: “150.00”,
“total_discounts”: “20.00”,
“total_price”: “159.00”,
“shipping_lines”: {
“title”: “UPS”,
“price”: “0.00”,
“carrier”: “UPS”,
“method”: “Ground”
},
“shipping_address”: {
“first_name”: “John”,
“last_name”: “Johnson”,
“company”: “The Johnson Co”,
“address1”: “2543 Duck St.”,
“address2”: “Apt. 2”,
“city”: “Oklahoma”,
“state”: “Oklahoma”,
“state_code”: “OK”,
“zip”: “73008”,
“country”: “US”,
“country_code”: “US”,
“email”: “john@gmail.com”,
“phone”: “5555555555”
},
“billing_address”: {
“first_name”: “John”,
“last_name”: “Johnson”,
“company”: “The Johnson Co”,
“address1”: “2543 Duck St.”,
“address2”: “Apt. 2”,
“city”: “Oklahoma”,
“state”: “OK”,
“state_code”: “OK”,
“zip”: “73008”,
“country”: “US”,
“country_code”: “US”,
“email”: “john@gmail.com”,
“phone”: “5555555555”
},
“line_items”: {
“sku”: “testSKU12345”,
“partner_line_item_id”: “282960815”,
“quantity”: 2,
“price”: “150.00”,
“product_name”: “Example Product”,
“fulfillment_status”: “pending”,
“quantity_pending_fulfillment”: “2”,
“warehouse_id”: “V2FyZWhvdYNlOjgwNzU=”
}
},
“required_ship_date”: “2020-08-07”
}
}
}

can you please tell me what was wrong in the request…

Thanks

Hello @tomasw

can you please look into the above request…

I am waiting for your response

Thanks

Hey, @bhautik! Just a heads up, but you really need to stop putting your authorization key in your posts. This is a public forum, and you’re giving anyone coming by and looking access to your account. It’s no different than posting your username and password for all to see :wink:

We have Enter the dummy authorization key.

Hi @bhautik!
I apologize for the delayed response
What IDE are you using to send the request to the Public API?

Hi
Right now we use the postman to call the api…

Hi @tomasw

We have try to call the api in altair…and we got sucessfully response…but I have an one question…we are using odoo erp and need to develope in python language so any package need to install to use GraphQL Public API or we directly use.

Thanks in advance

Thanks for confirming that @bhautik!

I believe if you use Postman for this, the content-type must be GraphQL instead of Content-Type :- application/json and for the Authorization tab you should select Bearer Token

Should look something like this:

I do suggest using one of the recommended IDEs because they will allow you to see the schema & docs easy, giving you the possibility to see which fields are available for querying.

Let me know if that doesn’t help or I could explain better.
Thanks again!
Tom

Hi @tomasw

Thanks for the quick response now I understand the thinks.

1 Like

hi @tomasw

this below think must need to pass while call create_order mutation ?

Thanks in advance

{
request_id
complexity
order {
id
order_number
shop_name
fulfillment_status
order_date
total_tax
subtotal
total_discounts
total_price
custom_invoice_url
account_id
email
profile
packing_note
required_ship_date
shipping_address {
first_name
last_name
company
address1
address2
city
state
state_code
zip
country
country_code
email
phone
}
line_items(first: 1) {
edges {
node {
id
sku
product_id
quantity
product_name
fulfillment_status
quantity_pending_fulfillment
quantity_allocated
backorder_quantity
eligible_for_return
customs_value
warehouse_id
locked_to_warehouse_id
}
}
}
}
}

Hi

How we implement in python3 we need to pass value dynamic…can you please give me one example.

Thanks in Advance

Hi @bhautik
You can see an example for the order_create Mutation at https://developer.shiphero.com/examples-mutation/#orderCreate

For using variables I found some posts about this in case it helps:


Or

Let me know if that doesn’t help
Thanks again!
Tom

Hi @tomasw

I have an one more question…We have 15000 Products…can we have use first and last both parameter in get products query ? Or can you please tell me any other way to sync all the product with my erp…because we have face the " There are not enough credit to perform operation pls try again after some time "

Thanks in Advance

Hi @tomasw

I mean can we have apply range while fire get products query…

Thanks

Hi @bhautik!
If you have many products and want to get the inventory you could use the Inventory Snapshot feature.
On the other hand, if you need product information as well you will have to use pagination and the cursors to iterate through the results until you get all the products
Let me know if that doesn’t help.
Thanks again!
Tom

Hi @tomasw

We Run Get Shipments Query Order Wise…Is It possible to multiple orders ? and one more think In Response show Complexity 1001…It’s very high…right ? how we can deduct the complexity…otherwise we got too many request error…

If we have fetch order wise shipment each shipment process we need to timeout for one minutes after that fetch another shipment It’s not really good for us.

please suggest the best way…

Thanks in Advance