UPDATE Order
Important notes:
- Conditions for a successful update
- The store the order is linked with must be active
- The order type must be "quote"
- The order status is not one of the following: Canceled, Refunded, Active Installment, Partially Refunded, or Captured
- It is preferable to provide the order.updatedDt as it was provided in the GET Order request to avoid accidentally overwriting an order that has already been updated.
- Optional body parameters will update when populated.
Update Order
Updates an orders fields based on the provided request body.
POST
https://test-api.featherpay.io/api/v1/orders/{orderId}/update
Path Parameters
- orderIdstringrequiredDescription
Header Parameters
- X-FP-OriginstringDescription
Body Parameters
- idStringrequiredDescription
- posOrderIdstringDescription
- totalInvoicedIntegerDescription
- totalPayNowAmountIntegerDescription
- customerEmailstringDescription
- customerFirstNamestringDescription
- customerLastNamestringDescription
- customerMiddleNamestringDescription
- customerPrefixstringDescription
- customerSuffixstringDescription
- shippingAddressObjectDescription
- billingAddressObjectDescription
- patientIdstringDescription
- externalPatientIdstringDescription
- originstringDescription
- enablePaymentPlanForPatientBooleanDescription
- patientNotestringDescription
curl
curl --location --globoff 'https://test-api.featherpay.io/api/v1/orders/{orderId}/update/{orderId}' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{"id":"String","posOrderId":"string","totalInvoiced":"Integer","totalPayNowAmount":"Integer","customerEmail":"string","customerFirstName":"string","customerLastName":"string","customerMiddleName":"string","customerPrefix":"string","customerSuffix":"string","shippingAddress":"Object","billingAddress":"Object","patientId":"string","externalPatientId":"string","origin":"string","enablePaymentPlanForPatient":"Boolean","patientNote":"string"}'nodejs
var request = require('request');
var options = {
'method': 'POST',
'url': 'https://test-api.featherpay.io/api/v1/orders/{orderId}/update/{orderId}',
'headers': {
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"id": "String",
"posOrderId": "string",
"totalInvoiced": "Integer",
"totalPayNowAmount": "Integer",
"customerEmail": "string",
"customerFirstName": "string",
"customerLastName": "string",
"customerMiddleName": "string",
"customerPrefix": "string",
"customerSuffix": "string",
"shippingAddress": "Object",
"billingAddress": "Object",
"patientId": "string",
"externalPatientId": "string",
"origin": "string",
"enablePaymentPlanForPatient": "Boolean",
"patientNote": "string"
})
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
javascript
var myHeaders = new Headers();
myHeaders.append("Accept", "application/json");
myHeaders.append("Content-Type", "application/json");
var raw = JSON.stringify({
"id": "String",
"posOrderId": "string",
"totalInvoiced": "Integer",
"totalPayNowAmount": "Integer",
"customerEmail": "string",
"customerFirstName": "string",
"customerLastName": "string",
"customerMiddleName": "string",
"customerPrefix": "string",
"customerSuffix": "string",
"shippingAddress": "Object",
"billingAddress": "Object",
"patientId": "string",
"externalPatientId": "string",
"origin": "string",
"enablePaymentPlanForPatient": "Boolean",
"patientNote": "string"
});
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: raw,
redirect: 'follow'
};
fetch("https://test-api.featherpay.io/api/v1/orders/{orderId}/update/{orderId}", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));python
import requests
import json
url = "https://test-api.featherpay.io/api/v1/orders/{orderId}/update/{orderId}"
payload = json.dumps({
"id": "String",
"posOrderId": "string",
"totalInvoiced": "Integer",
"totalPayNowAmount": "Integer",
"customerEmail": "string",
"customerFirstName": "string",
"customerLastName": "string",
"customerMiddleName": "string",
"customerPrefix": "string",
"customerSuffix": "string",
"shippingAddress": "Object",
"billingAddress": "Object",
"patientId": "string",
"externalPatientId": "string",
"origin": "string",
"enablePaymentPlanForPatient": "Boolean",
"patientNote": "string"
})
headers = {
'Accept': 'application/json',
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
ruby
require "uri"
require "json"
require "net/http"
url = URI("https://test-api.featherpay.io/api/v1/orders/{orderId}/update/{orderId}")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Accept"] = "application/json"
request["Content-Type"] = "application/json"
request.body = JSON.dump({
"id": "String",
"posOrderId": "string",
"totalInvoiced": "Integer",
"totalPayNowAmount": "Integer",
"customerEmail": "string",
"customerFirstName": "string",
"customerLastName": "string",
"customerMiddleName": "string",
"customerPrefix": "string",
"customerSuffix": "string",
"shippingAddress": "Object",
"billingAddress": "Object",
"patientId": "string",
"externalPatientId": "string",
"origin": "string",
"enablePaymentPlanForPatient": "Boolean",
"patientNote": "string"
})
response = https.request(request)
puts response.read_body
200
{
"id": "01EY8ZZ7Z91DWZZQFQ2YN4W620",
"createdDt": "2021-02-11T15:51:50.419321",
"updatedDt": "2021-02-11T15:54:33.641135",
"createdBy": "[email protected]",
"updatedBy": "[email protected]",
"orderType": "order",
"posOrderId": "100010",
"storeId": "01E8F3ZZDJ186BZFZEN3V8Z44W",
"orderKey": "1EQ3VEABTK8WPVR4689V715VHE",
"status": "Captured",
"totalAuthorized": 500000,
"totalCanceled": 0,
"totalInvoiced": 500000,
"totalPaid": 500000,
"totalRefunded": 0,
"totalDue": 0,
"totalPayNowAmount": 450000,
"customerEmail": "[email protected]",
"customerFirstName": "Jane",
"customerLastName": "Smith",
"onBehalfOf": "[email protected]",
"currencyCode": "usd",
"orderCreatedDt": "2021-02-11T15:54:33.280216",
"multipay": true,
"enablePaymentPlanForPatient": true,
"shippingAddress": {
"id": "01EY8XQFXX2G2ZZ3QZ3FV3AYAN",
"createdDt": "2021-02-11T15:51:50.424476",
"updatedDt": "2021-02-11T15:54:33.643819",
"createdBy": "[email protected]",
"updatedBy": "[email protected]",
"orderId": "01EY8ZZ7Z91DWZZQFQ2YN4W620",
"firstName": "Jane",
"lastName": "Smith",
"line1": "543 Winton Terrace Northeast",
"line2": "",
"city": "Atlanta",
"stateProvince": "GA",
"postcode": "30308-2826",
"countryCode": "US",
"email": "[email protected]",
"telephone": "(404) 555-1212",
"sameAsBilling": false
},
"orderPayments": [
{
"type": "AuthorizeNetOrderPayment",
"id": "01EY8ZSZTV1KK7XZBKA2H0TJSN",
"createdDt": "2021-02-11T15:54:27.041165",
"updatedDt": "2021-02-11T15:54:33.647715",
"createdBy": "[email protected]",
"updatedBy": "[email protected]",
"orderId": "01EY8ZZ7Z91DWZZQFQ2YN4W620",
"chargeAmount": 400000,
"amountRefunded": 0,
"amountCanceled": 0,
"amountPaid": 400000,
"amountAuthorized": 400000,
"estimatedFee": 0,
"fee": 0,
"status": "Captured",
"paymentId": "60162324415",
"paymentType": "AuthorizeNet",
"paymentMethod": "Credit / Debit Card",
"paymentMethodStatus": "This transaction has been approved.",
"billingAddress": {
"id": "01EY8WSZVZW3CCZZZTNR7GDXQX",
"createdDt": "2021-02-11T15:54:27.053415",
"updatedDt": "2021-02-11T15:54:33.649552",
"createdBy": "[email protected]",
"updatedBy": "[email protected]",
"orderPaymentId": "01EY8ZSZTV1KK7XZBKA2H0TJSN",
"firstName": "Jane",
"lastName": "Smith",
"line1": "543 Winton Terrace Northeast",
"line2": "",
"city": "Atlanta",
"stateProvince": "GA",
"postcode": "30308-2826",
"countryCode": "US",
"email": "[email protected]",
"telephone": "(404) 555-1212",
"sameAsBilling": true
},
"paymentTransactions": [
{
"type": "AuthorizeNetTransaction",
"id": "01EY8ZVFBW9MY6FXYFEAFNNBT2",
"createdDt": "2021-02-11T15:54:33.653113",
"updatedDt": "2021-02-11T15:54:33.653113",
"createdBy": "[email protected]",
"updatedBy": "[email protected]",
"orderPaymentId": "01EY8ZSZTV1KK7XZBKA2H0TJSN",
"txnId": "60162324415",
"txnType": "Credit / Debit Card",
"txnSource": "Captured",
"avsResult": "P",
"cvvResult": "",
"cavvResult": "",
"accountNumber": "XXXX1111",
"accountType": "Visa"
},
{
"type": "AuthorizeNetTransaction",
"id": "01EY8YYNYEGA6YZWQCMGA3AJB7",
"createdDt": "2021-02-11T15:54:33.291645",
"updatedDt": "2021-02-11T15:54:33.65142",
"createdBy": "[email protected]",
"updatedBy": "[email protected]",
"orderPaymentId": "01EY8ZSZTV1KK7XZBKA2H0TJSN",
"txnId": "60162324415",
"txnType": "Credit / Debit Card",
"txnSource": "Authorized",
"avsResult": "Y",
"cvvResult": "P",
"cavvResult": "2",
"accountNumber": "XXXX1111",
"accountType": "Visa"
}
],
"opaqueDescriptor": "COMMON.ACCEPT.INAPP.PAYMENT",
"opaqueValue": "eyJjb2RlIjoiNTBfMl8wNjAwMDUyODc0OUEzM0I0NzJGMzZEMTFDOUIwOUZGQjVGMThEMURGODUwRDBGNTBBQ0IwMDAzNDg3NTAxQkI3MDg0MkNFOTFBMDU5NjFEN0M0OEUzMDI3OTQ2QzE4OTUzMjQ5OUVFIiwidG9rZW4iOiI5NjEzMDU4ODY2Nzc2MTY0NjA0NjAxIiwidiI6IjEuMSJ9",
"cardLastFour": "1111",
"totalPendingRefund": 0,
"paymentSubType": "Credit / Debit Card",
"accountType": "Visa"
},
{
"type": "AuthorizeNetOrderPayment",
"id": "01EY8XRZZZ7JPYQWZFANX0N5CM",
"createdDt": "2021-02-11T15:53:45.315317",
"updatedDt": "2021-02-11T15:54:33.656288",
"createdBy": "[email protected]",
"updatedBy": "[email protected]",
"orderId": "01EY8ZZ7Z91DWZZQFQ2YN4W620",
"chargeAmount": 100000,
"amountRefunded": 0,
"amountCanceled": 0,
"amountPaid": 100000,
"amountAuthorized": 100000,
"estimatedFee": 0,
"fee": 0,
"status": "Captured",
"paymentId": "60162324416",
"paymentType": "AuthorizeNet",
"paymentMethod": "Credit / Debit Card",
"paymentMethodStatus": "This transaction has been approved.",
"billingAddress": {
"id": "01EY8WYQKND38FTEDMFWH1B6NP",
"createdDt": "2021-02-11T15:53:45.319214",
"updatedDt": "2021-02-11T15:54:33.65811",
"createdBy": "[email protected]",
"updatedBy": "[email protected]",
"orderPaymentId": "01EY8XRZZZ7JPYQWZFANX0N5CM",
"firstName": "Jane",
"lastName": "Smith",
"line1": "543 Winton Terrace Northeast",
"line2": "",
"city": "Atlanta",
"stateProvince": "GA",
"postcode": "30308-2826",
"countryCode": "US",
"email": "[email protected]",
"telephone": "(404) 555-1212",
"sameAsBilling": true
},
"paymentTransactions": [
{
"type": "AuthorizeNetTransaction",
"id": "01EY8WZFBZ30C36PZZPVN1ZBQM",
"createdDt": "2021-02-11T15:54:33.661935",
"updatedDt": "2021-02-11T15:54:33.661935",
"createdBy": "[email protected]",
"updatedBy": "[email protected]",
"orderPaymentId": "01EY8XRZZZ7JPYQWZFANX0N5CM",
"txnId": "60162324416",
"txnType": "Credit / Debit Card",
"txnSource": "Captured",
"avsResult": "P",
"cvvResult": "",
"cavvResult": "",
"accountNumber": "XXXX4242",
"accountType": "Visa"
},
{
"type": "AuthorizeNetTransaction",
"id": "01EY8XTXZNG7K9SQZCMAXANTV9",
"createdDt": "2021-02-11T15:54:33.300203",
"updatedDt": "2021-02-11T15:54:33.660049",
"createdBy": "[email protected]",
"updatedBy": "[email protected]",
"orderPaymentId": "01EY8XRZZZ7JPYQWZFANX0N5CM",
"txnId": "60162324416",
"txnType": "Credit / Debit Card",
"txnSource": "Authorized",
"avsResult": "Y",
"cvvResult": "P",
"cavvResult": "2",
"accountNumber": "XXXX4242",
"accountType": "Visa"
}
],
"opaqueDescriptor": "COMMON.ACCEPT.INAPP.PAYMENT",
"opaqueValue": "eyJjb2RlIjoiNTBfMl8wNjAwMDUyQ0M5NUI3QjkxODk1QTQ5RkNCNTJBODIxOTJBMTZGMTc5MjQxQTZCMERGQ0ZCMkNGQ0E0NTEwOERBQzZCQTg3NEJEODU1Mjc3OTk1QzgyNkIxRjk2NjFGNThGMTlCQTI3IiwidG9rZW4iOiI5NjEzMDU4ODI1MTQ4MTY0MzA0NjAxIiwidiI6IjEuMSJ9",
"cardLastFour": "4242",
"totalPendingRefund": 0,
"paymentSubType": "Credit / Debit Card",
"accountType": "Visa"
}
],
"orderItems": [
{
"id": "01EY8XNZXY0HW5STZ5DM9HCPE2",
"createdDt": "2021-02-11T15:51:50.427756",
"updatedDt": "2021-02-11T15:54:33.663241",
"createdBy": "[email protected]",
"updatedBy": "[email protected]",
"orderId": "01EY8ZZ7Z91DWZZQFQ2YN4W620",
"quantity": 1,
"unitPrice": 500000,
"name": "Medical Procedure",
"sku": "MP101"
}
],
"fraudCases": [],
"totalFee": 0
}412
{
"subErrors": [],
"status": "precondition_failed",
"message": "Cannot update an order that's already in Order type"
}