Order
Choose the desired status like WAITING, OK, FRAUD, INVALIDDATA
Needed timestamp. If not provided, will return by default the data for last 7 days.
Order status. Some of the available options are COMPLETE, PENDING, CANCELED, REFUND
Start date in format Y-m-d. Will overwrite Newer if provided.
End date in format Y-m-d.
Decide if it will also include partner orders
The external reference number of the order. Cannot be combined with CcLastDigits (error EXTERNALREFNO_AND_CCLASTDIGITS_MUTUALLY_EXCLUSIVE).
The last 4 digits of the credit card used for payment. Exact match, exactly 4 digits (^\d{4}$). Cannot be combined with ExternalRefNo (error EXTERNALREFNO_AND_CCLASTDIGITS_MUTUALLY_EXCLUSIVE).
1234Pattern: ^\d{4}$Should test orders be included in the result Values YES - test orders are included NO - test orders are not included ONLY - only the test orders are included
Needed page
Number of results per page
Created
Bad request
GET /rest/6.0/orders/ HTTP/1.1
Host: api.2checkout.com
Accept: */*
{
"Items": [
{
"AffiliateCommission": 0,
"Affiliate": {},
"ApproveStatus": "WAITING",
"AvangateCommission": 80.39,
"BillingDetails": {
"Address1": "",
"Address2": "",
"City": "LA",
"CountryCode": "br",
"Email": "customer@2Checkout.com",
"FirstName": "Customer",
"FiscalCode": "056.027.963-98",
"LastName": "2Checkout",
"Phone": "556133127400",
"State": "Distrito Federal",
"TaxOffice": "null,",
"Zip": "70403-900"
},
"Currency": "brl",
"DeliveryDetails": {
"Address1": "",
"Address2": "",
"City": "LA",
"CountryCode": "br",
"Email": "customer@2Checkout.com",
"FirstName": "Customer",
"LastName": "2Checkout",
"Phone": "556133127400",
"State": "Distrito Federal",
"Zip": "70403-900"
},
"Discount": 0,
"Errors": {
"ORDER_ERROR": "GATEWAY_ACCEPT"
},
"ExternalReference": "REST_API_AVANGTE",
"ExtraInformation": {
"RetryFailedPaymentLink": "https://store.avancart.com/order/finish.php?id=2Xrl83GEleyOsn3tfdXcZXKBy4sdasdas"
},
"GrossDiscountedPrice": 384.45,
"GrossPrice": 384.45,
"HasShipping": false,
"Items": [
{
"Code": "my_subscription_1",
"Price": {
"AffiliateCommission": 0,
"Currency": "brl",
"Discount": 0,
"GrossDiscountedPrice": 384.45,
"GrossPrice": 384.45,
"NetDiscountedPrice": 384.45,
"NetPrice": 384.45,
"UnitAffiliateCommission": 0,
"UnitDiscount": 0,
"UnitGrossDiscountedPrice": 384.45,
"UnitGrossPrice": 384.45,
"UnitNetDiscountedPrice": 384.45,
"UnitNetPrice": 384.45,
"UnitVAT": 0,
"VAT": 0
},
"PriceOptions": [
{
"Code": "USERS",
"Options": [
"oneuser1"
],
"Required": false
}
],
"ProductDetails": {
"Name": "2Checkout Subscription",
"RenewalStatus": false
},
"Quantity": 1,
"SKU": "NewSubscriptionPurchase",
"Promotion": {
"Name": "Regular promotion",
"Code": "VXVA13JRPM",
"Description": "description",
"StartDate": "2022--11-01",
"EndDate": "2022-11-30",
"MaximumOrdersNumber": null,
"MaximumQuantity": null,
"InstantDiscount": false,
"Coupon": "",
"DiscountLabel": "20 EUR",
"Enabled": true,
"Type": "REGULAR",
"Discount": 20,
"DiscountCurrency": "EUR",
"DiscountType": "FIXED"
}
}
],
"Language": "en",
"NetDiscountedPrice": 384.45,
"NetPrice": 384.45,
"OrderDate": "2016-02-08 19:19:53",
"OrderFlow": "REGULAR",
"PODetails": null,
"OrderNo": 0,
"Origin": "API",
"PaymentDetails": {
"Currency": "brl",
"CustomerIP": "91.220.121.21",
"PaymentMethod": {
"CardType": "Visa",
"ExpirationMonth": "12",
"ExpirationYear": "29",
"FirstDigits": "4111",
"InstallmentsNumber": 2,
"LastDigits": "1111",
"RecurringEnabled": false
},
"Type": "CC"
},
"Promotions": [],
"RefNo": "1234567",
"Source": "testAPI.com",
"Status": "PENDING",
"TestOrder": false,
"VAT": 0,
"VendorApproveStatus": "OK"
},
{
"AffiliateCommission": 0,
"Affiliate": {},
"ApproveStatus": "WAITING",
"AvangateCommission": 80.39,
"BillingDetails": {
"Address1": "",
"Address2": "",
"City": "LA",
"CountryCode": "br",
"Email": "customer@2Checkout.com",
"FirstName": "Customer",
"FiscalCode": "056.027.963-98",
"LastName": "2Checkout",
"Phone": "556133127400",
"State": "Distrito Federal",
"TaxOffice": "null,",
"Zip": "70403-900"
},
"Currency": "brl",
"DeliveryDetails": {
"Address1": "",
"Address2": "",
"City": "LA",
"CountryCode": "br",
"Email": "customer@2Checkout.com",
"FirstName": "Customer",
"LastName": "2Checkout",
"Phone": "556133127400",
"State": "Distrito Federal",
"Zip": "70403-900"
},
"Discount": 0,
"Errors": null,
"ExternalReference": "REST_API_AVANGTE",
"ExtraInformation": null,
"GrossDiscountedPrice": 284.45,
"GrossPrice": 284.45,
"HasShipping": false,
"Items": [
{
"Code": "my_subscription_2",
"Price": {
"AffiliateCommission": 0,
"Currency": "brl",
"Discount": 0,
"GrossDiscountedPrice": 284.45,
"GrossPrice": 284.45,
"NetDiscountedPrice": 284.45,
"NetPrice": 284.45,
"UnitAffiliateCommission": 0,
"UnitDiscount": 0,
"UnitGrossDiscountedPrice": 284.45,
"UnitGrossPrice": 284.45,
"UnitNetDiscountedPrice": 284.45,
"UnitNetPrice": 284.45,
"UnitVAT": 0,
"VAT": 0
},
"PriceOptions": [
{
"Code": "USERS2",
"Options": [
"oneuser2"
],
"Required": false
}
],
"ProductDetails": {
"Name": "2Checkout Subscription",
"RenewalStatus": false
},
"Quantity": 2,
"SKU": "AnotherSubscriptionPurchase",
"Promotion": null
}
],
"Language": "en",
"NetDiscountedPrice": 284.45,
"NetPrice": 284.45,
"OrderDate": "2023-02-08 19:19:53",
"OrderFlow": "REGULAR",
"PODetails": {
"Status": "AWAITING_UPLOAD",
"AutoApprove": false,
"RequireDocumentUpload\"": false,
"NetPaymentTerms": "90",
"CopyPreviousDocuments": "false,",
"PdfFormUrl": "https://secure.2checkout.com/order/order_confirmation_pdf.php?e=dXOZXKB4YLcl7Ft",
"InternalPONumber": 84864848
},
"OrderNo": 0,
"Origin": "API",
"PaymentDetails": {
"Currency": "brl",
"CustomerIP": "91.220.121.21",
"PaymentMethod": {
"CardType": "Visa",
"ExpirationMonth": "12",
"ExpirationYear": "29",
"FirstDigits": "4111",
"InstallmentsNumber": 2,
"LastDigits": "1111",
"RecurringEnabled": false
},
"Type": "CC"
},
"Promotions": [],
"RefNo": "1234568",
"Source": "testAPI.com",
"Status": "PENDING",
"TestOrder": false,
"VAT": 0,
"VendorApproveStatus": "OK"
}
],
"Pagination": {
"Page": 1,
"Limit": 10,
"Count": 230
}
}Returns a paginated list of the orders belonging to a customer, across all of that customer's subscriptions. Available in API 6.0 over REST, JSON-RPC (getCustomerOrders) and SOAP (getCustomerOrders).
The customer can be identified by the internal 2Checkout customer ID (CustomerReference) or by the external customer ID set by the merchant (ExternalCustomerReference). At least one of the two is required. If both are provided, they must resolve to the same customer.
Internally, 2Checkout:
Resolves the customer from the provided identifier(s).
Gathers all subscriptions belonging to that customer.
Collects the order history of each subscription.
Removes duplicate orders (a single purchase can create several subscriptions that reference the same order).
Sorts the result by order date, most recent first.
Returns the requested page.
Each item in Items has the same shape as a single order returned by getOrder, and the Items/Pagination envelope is the same one used by searchOrders. If a dispute/chargeback exists for an order, the item additionally includes ChargebackReasonCode and ChargebackResolution.
If the customer exists but has no subscriptions (and therefore no resolvable orders), an empty Items array is returned rather than an error.
This method is available only for merchant accounts on which the API_GET_CUSTOMER_ORDERS feature flag is enabled. When the flag is off, every call returns a FORBIDDEN error.
The internal 2Checkout customer ID (IdCustomer). At least one of CustomerReference or ExternalCustomerReference must be provided.
12345The external customer ID set by the merchant. At least one of CustomerReference or ExternalCustomerReference must be provided. If both identifiers are provided, they must resolve to the same customer.
666Page number, 1-based. Default value is 1. Must be greater than or equal to 1.
1Example: 1Number of orders per page. Default value is 10. Must be between 1 and 200.
10Example: 10application/jsonExample: application/jsonPossible values: Authentication header
code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"OK
Bad request - validation error or missing required parameters
The getCustomerOrders feature is not enabled for the merchant account (API_GET_CUSTOMER_ORDERS feature flag is off)
GET /rest/6.0/orders/customer/ HTTP/1.1
Host: api.2checkout.com
Accept: application/json
X-Avangate-Authentication: code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"
{
"Items": [
{
"AffiliateCommission": 0,
"Affiliate": {},
"ApproveStatus": "WAITING",
"AvangateCommission": 80.39,
"BillingDetails": {
"Address1": "",
"Address2": "",
"City": "LA",
"CountryCode": "br",
"Email": "customer@2Checkout.com",
"FirstName": "Customer",
"FiscalCode": "056.027.963-98",
"LastName": "2Checkout",
"Phone": "556133127400",
"State": "Distrito Federal",
"TaxOffice": "null,",
"Zip": "70403-900"
},
"Currency": "brl",
"DeliveryDetails": {
"Address1": "",
"Address2": "",
"City": "LA",
"CountryCode": "br",
"Email": "customer@2Checkout.com",
"FirstName": "Customer",
"LastName": "2Checkout",
"Phone": "556133127400",
"State": "Distrito Federal",
"Zip": "70403-900"
},
"Discount": 0,
"Errors": {
"ORDER_ERROR": "GATEWAY_ACCEPT"
},
"ExternalReference": "REST_API_AVANGTE",
"ExtraInformation": {
"RetryFailedPaymentLink": "https://store.avancart.com/order/finish.php?id=2Xrl83GEleyOsn3tfdXcZXKBy4sdasdas"
},
"GrossDiscountedPrice": 384.45,
"GrossPrice": 384.45,
"HasShipping": false,
"Items": [
{
"Code": "my_subscription_1",
"Price": {
"AffiliateCommission": 0,
"Currency": "brl",
"Discount": 0,
"GrossDiscountedPrice": 384.45,
"GrossPrice": 384.45,
"NetDiscountedPrice": 384.45,
"NetPrice": 384.45,
"UnitAffiliateCommission": 0,
"UnitDiscount": 0,
"UnitGrossDiscountedPrice": 384.45,
"UnitGrossPrice": 384.45,
"UnitNetDiscountedPrice": 384.45,
"UnitNetPrice": 384.45,
"UnitVAT": 0,
"VAT": 0
},
"PriceOptions": [
{
"Code": "USERS",
"Options": [
"oneuser1"
],
"Required": false
}
],
"ProductDetails": {
"Name": "2Checkout Subscription",
"RenewalStatus": false
},
"Quantity": 1,
"SKU": "NewSubscriptionPurchase",
"Promotion": {
"Name": "Regular promotion",
"Code": "VXVA13JRPM",
"Description": "description",
"StartDate": "2022--11-01",
"EndDate": "2022-11-30",
"MaximumOrdersNumber": null,
"MaximumQuantity": null,
"InstantDiscount": false,
"Coupon": "",
"DiscountLabel": "20 EUR",
"Enabled": true,
"Type": "REGULAR",
"Discount": 20,
"DiscountCurrency": "EUR",
"DiscountType": "FIXED"
}
}
],
"Language": "en",
"NetDiscountedPrice": 384.45,
"NetPrice": 384.45,
"OrderDate": "2016-02-08 19:19:53",
"OrderFlow": "REGULAR",
"PODetails": null,
"OrderNo": 0,
"Origin": "API",
"PaymentDetails": {
"Currency": "brl",
"CustomerIP": "91.220.121.21",
"PaymentMethod": {
"CardType": "Visa",
"ExpirationMonth": "12",
"ExpirationYear": "29",
"FirstDigits": "4111",
"InstallmentsNumber": 2,
"LastDigits": "1111",
"RecurringEnabled": false
},
"Type": "CC"
},
"Promotions": [],
"RefNo": "1234567",
"Source": "testAPI.com",
"Status": "PENDING",
"TestOrder": false,
"VAT": 0,
"VendorApproveStatus": "OK"
}
],
"Pagination": {
"Page": 1,
"Limit": 10,
"Count": 1
}
}Unique code that identifies a sale
Get order reference by sale id
11582176Bad request
GET /rest/6.0/orders/0/sale/?SaleId=1 HTTP/1.1
Host: api.2checkout.com
Accept: */*
11582176Unique code that identifies an invoice
application/jsonExample: application/jsonPossible values: Authentication header
code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"Get order reference by invoice id
11582176Bad request
GET /rest/6.0/orders/0/invoice/?InvoiceId=text HTTP/1.1
Host: api.2checkout.com
Accept: application/json
X-Avangate-Authentication: code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"
11582176Reference number for approved/paid orders.
12345678application/jsonExample: application/jsonPossible values: Authentication header
code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"OK
GET /rest/6.0/orders/{OrderReference}/ HTTP/1.1
Host: api.2checkout.com
Accept: application/json
X-Avangate-Authentication: code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"
OK
{
"RefNo": "1234567",
"OrderNo": 0,
"ExternalReference": "REST_API_AVANGTE",
"ShopperRefNo": null,
"Status": "PENDING",
"ApproveStatus": "WAITING",
"VendorApproveStatus": "OK",
"MerchantCode": "MEARCHNT_CODE",
"Language": "en",
"OrderDate": "2016-02-08 19:19:53",
"FinishDate": null,
"Source": "testAPI.com",
"WSOrder": null,
"Affiliate": {
"AffiliateCode": null,
"AffiliateSource": null,
"AffiliateName": null,
"AffiliateUrl": null
},
"HasShipping": false,
"BillingDetails": {
"Address1": "",
"Address2": "",
"City": "LA",
"CountryCode": "br",
"Email": "customer@2Checkout.com",
"FirstName": "Customer",
"FiscalCode": "056.027.963-98",
"LastName": "2Checkout",
"Phone": "556133127400",
"State": "Distrito Federal",
"TaxOffice": "null,",
"Zip": "70403-900"
},
"DeliveryDetails": {
"Address1": "",
"Address2": "",
"City": "LA",
"CountryCode": "br",
"Email": "customer@2Checkout.com",
"FirstName": "Customer",
"LastName": "2Checkout",
"Phone": "556133127400",
"State": "Distrito Federal",
"Zip": "70403-900"
},
"PaymentDetails": {
"Currency": "brl",
"CustomerIP": "91.220.121.21",
"PaymentMethod": {
"CardType": "Visa",
"ExpirationMonth": "12",
"ExpirationYear": "29",
"FirstDigits": "4111",
"InstallmentsNumber": 2,
"LastDigits": "1111",
"RecurringEnabled": false
},
"Type": "CC"
},
"DeliveryInformation": {
"ShippingMethod": {
"Code": null,
"TrackingUrl": null,
"TrackingNumber": null,
"Comment": null
}
},
"CustomerDetails": "null,",
"Origin": "API",
"AvangateCommission": 80.39,
"OrderFlow": "REGULAR",
"GiftDetails": null,
"PODetails": null,
"ExtraInformation": {
"RetryFailedPaymentLink": "https://store.avancart.com/order/finish.php?id=2Xrl83GEleyOsn3tfdXcZXKBy4sdasdas"
},
"PartnerCode": null,
"PartnerMargin": null,
"ExtraMargin": null,
"ExtraMarginPercent": null,
"ExtraDiscount": null,
"ExtraDiscountPercent": null,
"LocalTime": null,
"TestOrder": false,
"FxRate": 1,
"PayoutCurrency": "USD",
"DeliveryFinalized": false,
"Errors": null,
"Items": [
{
"Code": "my_subscription_1",
"Price": {
"AffiliateCommission": 0,
"Currency": "brl",
"Discount": 0,
"GrossDiscountedPrice": 384.45,
"GrossPrice": 384.45,
"NetDiscountedPrice": 384.45,
"NetPrice": 384.45,
"UnitAffiliateCommission": 0,
"UnitDiscount": 0,
"UnitGrossDiscountedPrice": 384.45,
"UnitGrossPrice": 384.45,
"UnitNetDiscountedPrice": 384.45,
"UnitNetPrice": 384.45,
"UnitVAT": 0,
"VAT": 0
},
"PriceOptions": [
{
"Code": "USERS",
"Options": [
"oneuser1"
],
"Required": false
}
],
"ProductDetails": {
"Name": "2Checkout Subscription",
"RenewalStatus": false,
"IsDynamic": true,
"Fulfillment": "NO_DELIVERY"
},
"Quantity": 1,
"Trial": {
"Perion": 30,
"GrossPrice": 5,
"VAT": 0,
"NetPrice": 5
},
"SKU": "NewSubscriptionPurchase",
"Promotion": {
"Name": "Regular promotion",
"Code": "VXVA13JRPM",
"Description": "description",
"StartDate": "2022--11-01",
"EndDate": "2022-11-30",
"MaximumOrdersNumber": null,
"MaximumQuantity": null,
"InstantDiscount": false,
"Coupon": "",
"DiscountLabel": "20 EUR",
"Enabled": true,
"Type": "REGULAR",
"Discount": 20,
"DiscountCurrency": "EUR",
"DiscountType": "FIXED"
}
}
],
"Promotions": [],
"AdditionalFields": null,
"Currency": "brl",
"NetPrice": 384.45,
"GrossPrice": 384.45,
"NetDiscountedPrice": 384.45,
"GrossDiscountedPrice": 384.45,
"Discount": 0,
"VAT": 0,
"AffiliateCommission": 0,
"CustomParameters": null,
"Refunds": [
{
"RequestStatus": "APPROVED",
"RequestDate": "2022-07-18 20:09:37",
"RequestApprovedDate": "2022-07-18 20:09:37",
"RequestAmount": 99,
"RequestReason": "",
"Type": "PARTIAL"
},
{
"RequestStatus": "APPROVED",
"RequestDate": "2022-07-18 20:09:37",
"RequestApprovedDate": "2022-07-18 20:09:37",
"RequestAmount": 9,
"RequestReason": "",
"Type": "PARTIAL"
}
],
"ContainsRenewableProducts": null,
"RequestDeliveryData": false
}Cancel order with purchase order type
Reference number for purchase order type orders.
12345678application/jsonExample: application/jsonPossible values: Authentication header
code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"OK
Invalid data
Invalid data
DELETE /rest/6.0/orders/{OrderReference}/ HTTP/1.1
Host: api.2checkout.com
Accept: application/json
X-Avangate-Authentication: code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"
"true"Unique, system-generated order identifier.
734881310Authentication header
code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"application/jsonPossible values: OK
Invalid data
POST /rest/6.0/orders/{OrderReference}/upload HTTP/1.1
Host: api.2checkout.com
X-Avangate-Authentication: code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"
Accept: application/json
Content-Type: application/json
Content-Length: 53
{
"FileName": "text",
"ClientTime": "text",
"File": "text"
}"true"Last updated
Was this helpful?