Chủ Nhật, 16 tháng 8, 2020

Shipping API

 The Shipping API provides shipping information for physical good orders by receipt or time parameters.

URL

URL: https://api.clickbank.com/rest/1.3/shipping2

Methods

This section provides details about the methods available within the Shipping API, including required keys and roles, output types, and supported and required parameters.

The following methods are covered in this section:

GET  /1.3/shipping2/schema

Returns the XML Schema for order ship data results.

Required Keys and Roles

  • None

Return Type

XML schema for Order Ship Data

Supported Output Types

  • application/xml

GET  /1.3/shipping2/count

This method returns a count of physical goods orders matching the shipping criteria. 

If you want information on all orders, including non-physical orders, use the Orders API.

Request Parameters

NameRequiredDescription
daysNo

Return orders within the last n days, where n is the specified parameter value. The default value is 30.

The startDate and endDate parameters override the days parameter.

endDateNo

Return results ending with the specified date. The date range is inclusive. The date format is yyyy-mm-dd.

The startDate and endDate parameters override the days parameter.

receiptNo

Search the physical good order by receipt. If you specify this parameter, all other parameters are ignored.

startDateNo

Return results beginning with the specified date. The date range is inclusive. The date format is yyyy-mm-dd.

The startDate and endDate parameters override the days parameter.

statusNo

Returns orders with the specified status. Valid values are:

  • shipped
  • notshipped
  • all

Required Keys and Roles

  • Developer Key
  • Clerk Key
    • API Order Read Role

Return Type

Order Ship Data

Supported Output Types

  • application/xml
  • application/json

GET  /1.3/shipping2/list

This method returns a list of physical goods orders matching the shipping criteria.

Only the first 100 orders will be returned. This method supports pagination, so if the second page of the next 100 items is required a request header 'Page' with value 2 will return them. 

This method returns a status code of 200 if all the orders have been obtained, or a status code of 206 [Partial Return] if there are more results available.

If you want information on all orders, including non-physical orders, use the Orders API.

Head Parameters

NameRequiredDescription
pageNoReturn the specified page of results. The default is page 1.

Request Parameters

NameRequiredDescription
daysNo

Return orders within the last n days, where n is the specified parameter value. The default value is 30.

The startDate and endDate parameters override the days parameter.

endDateNo

Return results ending with the specified date. The date range is inclusive. The date format is yyyy-mm-dd.

The startDate and endDate parameters override the days parameter.

receiptNo

Search the physical good order by receipt. If you specify this parameter, all other parameters are ignored.

startDateNo

Return results beginning with the specified date. The date range is inclusive. The date format is yyyy-mm-dd.

The startDate and endDate parameters override the days parameter.

statusNo

Returns orders with the specified status. Valid values are:

  • shipped
  • notshipped
  • all

Required Keys and Roles

  • Developer Key
  • Clerk Key
    • API Order Read Role

Return Type

Order Ship Data

Supported Output Types

  • application/xml
  • application/json

Return Types

This section details the return types used by the Shipping API.

The following return types are covered in this section:

Order Ship Data

Order Ship Data returns use the following format, with orders sorted by order date:

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" version="1.0">
<xs:element name="orderShipData" type="orderShipData"/>
<xs:complexType name="orderShipData">
<xs:sequence>
<xs:element name="receipt" type="xs:string" nillable="true" minOccurs="0"/>
<xs:element name="firstName" type="xs:string" nillable="true" minOccurs="0"/>
<xs:element name="lastName" type="xs:string" nillable="true" minOccurs="0"/>
<xs:element name="email" type="xs:string" nillable="true" minOccurs="0"/>
<xs:element name="address1" type="xs:string" nillable="true" minOccurs="0"/>
<xs:element name="address2" type="xs:string" nillable="true" minOccurs="0"/>
<xs:element name="city" type="xs:string" nillable="true" minOccurs="0"/>
<xs:element name="state" type="xs:string" nillable="true" minOccurs="0"/>
<xs:element name="country" type="xs:string" nillable="true" minOccurs="0"/>
<xs:element name="postalCode" type="xs:string" nillable="true" minOccurs="0"/>
<xs:element name="transactionTime" type="xs:dateTime" nillable="true" minOccurs="0"/>
<xs:element name="isTestTransaction" type="xs:boolean" nillable="true" minOccurs="0"/>
<xs:element name="fullName" type="xs:string" nillable="true" minOccurs="0"/>
<xs:element name="vendor" type="xs:string" nillable="true" minOccurs="0"/>
<xs:element name="vendorVariables" type="vendorVariableElementArray" nillable="true" minOccurs="0"/>
<xs:element name="lineItemShipData" type="orderShipLineItemData" nillable="true" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="vendorVariableElement">
<xs:sequence>
<xs:element name="name" type="xs:string" minOccurs="0"/>
<xs:element name="value" type="xs:string" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="orderShipLineItemData">
<xs:sequence>
<xs:element name="itemNo" type="xs:string" nillable="true" minOccurs="0"/>
<xs:element name="productTitle" type="xs:string" nillable="true" minOccurs="0"/>
<xs:element name="customerAmount" type="xs:decimal" nillable="true" minOccurs="0"/>
<xs:element name="accountAmount" type="xs:decimal" nillable="true" minOccurs="0"/>
<xs:element name="quantity" type="xs:int" nillable="true" minOccurs="0"/>
<xs:element name="shippingMethod" type="xs:string" nillable="true" minOccurs="0"/>
<xs:element name="isRefundPending" type="xs:boolean" nillable="true" minOccurs="0"/>
<xs:element name="hasBeenRefunded" type="xs:boolean" nillable="true" minOccurs="0"/>
<xs:element name="hasBeenChargebacked" type="xs:boolean" nillable="true" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="vendorVariableElementArray" final="#all">
<xs:sequence>
<xs:element name="item" type="vendorVariableElement" minOccurs="0" maxOccurs="unbounded" nillable="true"/>
</xs:sequence>
</xs:complexType>
</xs:schema>

Usage Information

For additional information about using the Shipping API, see the ClickBank APIs article.

Related Articles

  • Ship Notice API – This article explains how to create shipping notifications using an API.

Không có nhận xét nào: