For the complete documentation index, see llms.txt. This page is also available as Markdown.

Order

Search orders using a multitude of filters

get
Query parameters
ApproveStatusstring · enumOptional

Choose the desired status like WAITING, OK, FRAUD, INVALIDDATA

Possible values:
NewerstringOptional

Needed timestamp. If not provided, will return by default the data for last 7 days.

Statusstring · enumOptional

Order status. Some of the available options are COMPLETE, PENDING, CANCELED, REFUND

Possible values:
StartDatestringOptional

Start date in format Y-m-d. Will overwrite Newer if provided.

EndDatestringOptional

End date in format Y-m-d.

PartnerOrdersbooleanOptional

Decide if it will also include partner orders

ExternalRefNostringOptional

The external reference number of the order. Cannot be combined with CcLastDigits (error EXTERNALREFNO_AND_CCLASTDIGITS_MUTUALLY_EXCLUSIVE).

CcLastDigitsstring · min: 4 · max: 4Optional

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).

Example: 1234Pattern: ^\d{4}$
IncludeTestOrdersstringOptional

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

PagestringOptional

Needed page

LimitintegerOptional

Number of results per page

Responses
201

Created

application/json
get/orders/
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
  }
}

Retrieve a customer's orders

get

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:

  1. Resolves the customer from the provided identifier(s).

  2. Gathers all subscriptions belonging to that customer.

  3. Collects the order history of each subscription.

  4. Removes duplicate orders (a single purchase can create several subscriptions that reference the same order).

  5. Sorts the result by order date, most recent first.

  6. 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.

Query parameters
CustomerReferenceintegerOptional

The internal 2Checkout customer ID (IdCustomer). At least one of CustomerReference or ExternalCustomerReference must be provided.

Example: 12345
ExternalCustomerReferencestringOptional

The 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.

Example: 666
Pageinteger · min: 1Optional

Page number, 1-based. Default value is 1. Must be greater than or equal to 1.

Default: 1Example: 1
Limitinteger · min: 1 · max: 200Optional

Number of orders per page. Default value is 10. Must be between 1 and 200.

Default: 10Example: 10
Header parameters
Acceptstring · enumRequiredDefault: application/jsonExample: application/jsonPossible values:
X-Avangate-AuthenticationstringRequired

Authentication header

Example: code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"
Responses
200

OK

application/json
get/orders/customer/
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
  }
}

Get order reference by sale id

get
Query parameters
SaleIdintegerRequired

Unique code that identifies a sale

Responses
200

Get order reference by sale id

application/json
stringOptionalExample: 11582176
get/orders/0/sale/
GET /rest/6.0/orders/0/sale/?SaleId=1 HTTP/1.1
Host: api.2checkout.com
Accept: */*
11582176

Get order reference by invoice id

get
Query parameters
InvoiceIdstringRequired

Unique code that identifies an invoice

Header parameters
Acceptstring · enumRequiredDefault: application/jsonExample: application/jsonPossible values:
X-Avangate-AuthenticationstringRequired

Authentication header

Example: code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"
Responses
200

Get order reference by invoice id

application/json
stringOptionalExample: 11582176
get/orders/0/invoice/
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}"
11582176

Retrieve an order by reference

get
Path parameters
OrderReferencestringRequired

Reference number for approved/paid orders.

Example: 12345678
Header parameters
Acceptstring · enumRequiredDefault: application/jsonExample: application/jsonPossible values:
X-Avangate-AuthenticationstringRequired

Authentication header

Example: code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"
Responses
200

OK

application/json
get/orders/{OrderReference}/
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}"
200

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 a purchase order

delete

Cancel order with purchase order type

Path parameters
OrderReferencestringRequired

Reference number for purchase order type orders.

Example: 12345678
Header parameters
Acceptstring · enumRequiredDefault: application/jsonExample: application/jsonPossible values:
X-Avangate-AuthenticationstringRequired

Authentication header

Example: code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"
Responses
200

OK

application/json
delete/orders/{OrderReference}/
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"

Order form upload

post
Path parameters
OrderReferencestringRequired

Unique, system-generated order identifier.

Example: 734881310
Header parameters
X-Avangate-AuthenticationstringRequired

Authentication header

Example: code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"
Acceptstring · enumRequiredExample: application/jsonPossible values:
Body
FileNamestringOptional
ClientTimestringOptional
FilestringOptional
Responses
200

OK

application/json
post/orders/{OrderReference}/upload
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?