Create an order

post/orders

The POST /orders call allows your platform to create a new order. Orders identify both the merchant and payer, and describe items sold, shipment date, prices, delivery details, and payment terms.

SecurityappIdAuth and appTokenAuth
Request
header Parameters
Api-Version
required
string
Example: 3.0
Content-Type
required
stringapplication/json
Example: application/json
Unique-Key
string
Request Body schema: application/json
account_id
required
string or null

Merchant's account id associated with the order.

type
required
string

Type of order. Possible values: donation, event, goods, personal, service.

Enum: Description
goods

This order contains goods.

service

This order outlines services being paid for.

… 3 more
short_description
required
string or null <= 255 characters

A short description of the order. Required if line_items are not provided.

alternate_tax_amount
integer or null

Merchant's Legal Entity ID associated with the order.

alternate_tax_id
string or null <= 255 characters

Your platform's tax ID number to use for the alternate tax amount. Required if you set alternate_tax_amount to any value. However, you may fill out this field without setting alternate_tax_amount.

object

Buyer of the order. Required if the order is not created in-line with a /payment_methods request.

currency
string

ISO 4217 currency code. Possible values include: CAD & USD. Note: as of today, currency supports a single value.

Enum: Description
USD

United States Dollar

CAD

Canadian Dollar

… 1 more
customer_reference_number
string or null <= 255 characters

The ID used to identify the order instance between a merchant and payer.

delivery_type
string or null

Describes how an order is delivered. Possible values: donation, full_prepayment, fully_delivered, none, partial_prepayment, point_of_sale, subscription.

Enum: Description
none

Indicates that the order does not contain shippable goods.

fully_delivered

Indicates that all components of an order have been delivered and received by the payer.

… 5 more
discount_amount
integer or null

Discount (if any) on order.

discount_program_name
string or null [ 1 .. 255 ] characters

The name of the discount program applied to the transaction. This allows tracking if a merchant offers multiple discount programs at once or over time.

duty_amount
integer or null

Total charges for any import or export duties included in the order.

freight_amount
integer or null

Total freight must also include grand_total_amount.

grand_total_amount
integer or null

Grand total for the entire order or credit request.

Array of objects

An array of line items. Not a top level resource.

long_description
string or null <= 2047 characters

A long description of the order.

notes
string or null <= 2047 characters

Notes field from the invoice or order.

Array of objects or null

Any rbit data your platform chooses to attach to this resource. The rbit data must be key-value pairs and can be an array of rbit objects.

reference_number
string or null <= 255 characters

A reference number your platform assigns to the order to help you identify it.

object

Address indicating where services were rendered, origin of goods, or account holder for credit card / payment bank.

object

Address indicating where services were rendered, origin of goods, or account holder for credit card / payment bank.

object

Address indicating where services were rendered, origin of goods, or account holder for credit card / payment bank.

object

Shipping status details associated with the order.

status
string or null

Status of the order. Possible values: disputed, paid, unpaid, deleted.

Enum: Description
unpaid

The order has not yet been paid.

paid

The order has been paid.

… 1 more
tax_amount
integer or null

Total tax amount applied to the transaction. Must be greater than 0 to qualify for Level 2 Interchange for Visa.

object

Terms associated with the transaction.

tip_amount
integer or null >= 0

Total Tip amount applied to the transaction. Must be greater than 0 to qualify for Level 2 Interchange for Visa.

vat_amount
integer or null

Total amount of VAT or other tax included in the order.

vat_rate
number or null

Rate of VAT or other tax for the order. The valid range is 0.01 to 0.99 (1% to 99%).

Responses
201
Response Schema: application/json
alternate_tax_amount
integer or null

Total amount of alternate tax for the order.

alternate_tax_id
string or null <= 255 characters

Your platform's tax ID number to use for the alternate tax amount. Required if you set alternate_tax_amount to any value. However, you may fill out this field without setting alternate_tax_amount.

api_version
string
object

Buyer of the order.

create_time
integer <int64> >= 0

The time (in UNIX) when the payout method was created.

currency
string or null
Enum: Description
USD

United States Dollar

CAD

Canadian Dollar

… 1 more
customer_reference_number
string or null <= 255 characters

The ID used to identify the order instance between a merchant and payer.

delivery_type
string or null

Describes how an order is delivered. Possible values: donation, full_prepayment, fully_delivered, none, partial_prepayment, point_of_sale, subscription.

Enum: Description
none

Indicates that the order does not contain shippable goods.

fully_delivered

Indicates that all components of an order have been delivered and received by the payer.

… 5 more
discount_amount
integer or null

Discount (if any) on order.

discount_program_name
string or null [ 1 .. 255 ] characters

The name of the discount program applied to the transaction. This allows tracking if a merchant offers multiple discount programs at once or over time.

duty_amount
integer or null

Total charges for any import or export duties included in the order.

freight_amount
integer or null

Total freight must also include grand_total_amount.

grand_total_amount
integer or null

Grand total for the entire order or credit request.

id
string [ 1 .. 255 ] characters

ID of the order, generated by WePay when the order is created.

Array of objects or null

An array of line items. Not a top level resource.

long_description
string or null <= 2047 characters

A long description of the order.

notes
string or null <= 2047 characters

Notes field from the invoice or order.

object

Details the owner resource and owner path.

path
string

The path of resource and resource ID.

reference_number
string or null <= 255 characters

A reference number your platform assigns to the order to help you identify it.

resource
string

Helps organize information by identifying the resource type of the object data.

Value: Description
orders
object or null

Optional address indicating where service was rendered or destination of the order.

object or null

Optional address indicating where service was rendered or destination of the order.

object or null

Optional address indicating where service was rendered or destination of the order.

object or null

Shipping status details associated with the order.

short_description
string or null <= 255 characters

A short description of the order. Required if line_items are not provided.

state
string

State of the order. Possible values: active, inactive.

Enum: Description
active

The Order contains information that is current and applicable to the associated Payment.

deleted

the Order contains information that is not current or applicable to the associated Payment and has been deleted.

status
string or null

Status of the order. Possible values: disputed, paid, unpaid, deleted.

Enum: Description
unpaid

The order has not yet been paid.

paid

The order has been paid.

… 1 more
tax_amount
integer or null

Total tax amount applied to the transaction. Must be greater than 0 to qualify for Level 2 Interchange for Visa.

object or null

Terms associated with the transaction.

tip_amount
integer or null >= 0

Total Tip amount applied to the transaction. Must be greater than 0 to qualify for Level 2 Interchange for Visa.

type
string

Type of order. Possible values: donation, event, goods, personal, service.

Enum: Description
goods

This order contains goods.

service

This order outlines services being paid for.

… 3 more
vat_amount
integer or null

Total amount of VAT or other tax included in the order.

vat_rate
number or null

Rate of VAT or other tax for the order. The valid range is 0.01 to 0.99 (1% to 99%).

400

INVALID_PARAMS

403

NOT_AUTHORIZED

500

UNEXPECTED_ERROR

Request samples
application/json
{
  • "account_id": "d7608b20-fea5-4eb5-bd30-d3f58435e78b",
  • "alternate_tax_amount": 35,
  • "alternate_tax_id": "11",
  • "buyer": {
    • "legal_entity_id": "1490656130",
    • "type": "legal_entity_id"
    },
  • "customer_reference_number": "cust# 1234",
  • "delivery_type": "point_of_sale",
  • "discount_amount": 0,
  • "duty_amount": 0,
  • "freight_amount": 0,
  • "grand_total_amount": 1000,
  • "line_items": [
    • {
      • "commodity_code": "ABC123",
      • "currency": "USD",
      • "description": "Classic Iron Anvil",
      • "discount_amount": 0,
      • "discount_indicator": null,
      • "gross_net_indicator": null,
      • "item": {
        • "account_id": "d7608b20-fea5-4eb5-bd30-d3f58435e78b",
        • "description": "Classic Iron Anvil",
        • "photos": [ ],
        • "price": 490,
        • "product_code": "XYZ321",
        • "product_details": {
          • "band": "nike"
          },
        • "product_name": "Acme Anvil - 100 Lb",
        • "reference_number": "abc_123456",
        • "shipping_options": [
          • "regular",
          • "expedited"
          ],
        • "terms": {},
        • "weight": {
          • "units": "pounds",
          • "weight": 1
          }
        },
      • "quantity": 1,
      • "tax_amount": 5,
      • "tax_rate": 1.99,
      • "tax_type_applied": "VAT",
      • "total_amount": 500,
      • "unit_of_measure": "count",
      • "unit_price": 490
      },
    • {
      • "commodity_code": "XYZ999",
      • "currency": "USD",
      • "description": "Classic Catapult",
      • "discount_amount": 0,
      • "discount_indicator": null,
      • "gross_net_indicator": null,
      • "item": {
        • "account_id": "d7608b20-fea5-4eb5-bd30-d3f58435e78b",
        • "description": "Classic Catapult",
        • "price": 490,
        • "product_code": "AAAXYZ321",
        • "product_name": "Acme Catapult",
        • "reference_number": "abc_654321",
        • "shipping_options": [
          • "regular",
          • "expedited"
          ],
        • "terms": {},
        • "weight": {
          • "units": "pounds",
          • "weight": 1
          }
        },
      • "quantity": 1,
      • "tax_amount": 5,
      • "tax_rate": 1.99,
      • "tax_type_applied": "VAT",
      • "total_amount": 500,
      • "unit_of_measure": "count",
      • "unit_price": 490
      }
    ],
  • "long_description": null,
  • "notes": "urgent order",
  • "rbits": [
    • {
      • "address": {
        • "origin_address": {
          • "city": "Sunnyvale",
          • "country": "US",
          • "line1": "20 Main Street",
          • "postal_code": "94085",
          • "region": "CA"
          }
        },
      • "receive_time": 1367958263,
      • "source": "partner_database",
      • "type": "address"
      },
    • {
      • "auto_billing": {
        • "autobill_setup_time": 1209600,
        • "payment_frequency": "monthly",
        • "payment_number": 1,
        • "setup_by": "payer",
        • "total_payments_scheduled": 5
        },
      • "receive_time": 1367958263,
      • "source": "user",
      • "type": "auto_billing"
      }
    ],
  • "reference_number": "invoice #54321",
  • "service_address": {
    • "city": "San Francisco",
    • "country": "US",
    • "line1": "123 Fake Street",
    • "postal_code": "94101",
    • "region": "CA"
    },
  • "ship_from_address": {
    • "city": "San Francisco",
    • "country": "US",
    • "line1": "123 Fake Street",
    • "postal_code": "94101",
    • "region": "CA"
    },
  • "ship_to_address": {
    • "city": "San Francisco",
    • "country": "US",
    • "line1": "123 Fake Street",
    • "postal_code": "94101",
    • "region": "CA"
    },
  • "shipping_status": {
    • "actual_delivery_time": null,
    • "carrier": "UPS",
    • "expected_delivery_time": 1490656130,
    • "shipping_time": 1390656130,
    • "tracking_number": "1Z34567890",
    },
  • "short_description": "Donation to ABC campaign",
  • "status": "paid",
  • "tax_amount": 35,
  • "type": "goods",
  • "vat_amount": 5,
  • "vat_rate": 1.99,
  • "discount_program_name": "Everything is 50% off",
  • "tip_amount": 0
}
Response samples
application/json
{
  • "alternate_tax_amount": 35,
  • "alternate_tax_id": "11",
  • "buyer": {
    • "id": "1490656130",
    • "path": "/legal_entities/1490656130",
    • "resource": "legal_entities"
    },
  • "create_time": 1390656130,
  • "customer_reference_number": "cust# 1234",
  • "delivery_type": "point_of_sale",
  • "discount_amount": 0,
  • "duty_amount": 0,
  • "freight_amount": 0,
  • "grand_total_amount": 1000,
  • "id": "f48cd8e6-e802-4500-a0f9-3ab6228c6f23",
  • "line_items": [
    • {
      • "commodity_code": "ABC123",
      • "currency": "USD",
      • "description": "Classic Iron Anvil",
      • "discount_amount": 0,
      • "discount_indicator": null,
      • "gross_net_indicator": null,
      • "item": {
        • "create_time": 1390656130,
        • "description": "Classic Iron Anvil",
        • "id": "1",
        • "owner": {
          • "id": "d7608b20-fea5-4eb5-bd30-d3f58435e78b",
          • "path": "/accounts/d7608b20-fea5-4eb5-bd30-d3f58435e78b",
          • "resource": "accounts"
          },
        • "path": "/items/f48cd8e6-e802-4500-a0f9-3ab6228c6f23",
        • "photos": [ ],
        • "price": 490,
        • "product_code": "XYZ321",
        • "product_details": {
          • "band": "nike"
          },
        • "product_name": "Acme Anvil - 100 Lb",
        • "reference_number": "abc_123456",
        • "resource": "items",
        • "shipping_options": [
          • "regular",
          • "expedited"
          ],
        • "state": "active",
        • "terms": {},
        • "weight": {
          • "units": "pounds",
          • "weight": 1
          }
        },
      • "quantity": 1,
      • "tax_amount": 5,
      • "tax_rate": 1.99,
      • "tax_type_applied": "VAT",
      • "total_amount": 500,
      • "unit_of_measure": "count",
      • "unit_price": 490
      },
    • {
      • "commodity_code": "XYZ999",
      • "currency": "USD",
      • "description": "Classic Catapult",
      • "discount_amount": 0,
      • "discount_indicator": null,
      • "gross_net_indicator": null,
      • "item": {
        • "create_time": 1390656130,
        • "description": "Classic Catapult",
        • "id": "2",
        • "owner": {
          • "id": "d7608b20-fea5-4eb5-bd30-d3f58435e78b",
          • "path": "/accounts/d7608b20-fea5-4eb5-bd30-d3f58435e78b",
          • "resource": "accounts"
          },
        • "path": "/items/f48cd8e6-e802-4500-a0f9-3ab6228c6f23",
        • "price": 490,
        • "product_code": "AAAXYZ321",
        • "product_name": "Acme Catapult",
        • "reference_number": "abc_654321",
        • "resource": "items",
        • "shipping_options": [
          • "regular",
          • "expedited"
          ],
        • "state": "active",
        • "terms": {},
        • "weight": {
          • "units": "pounds",
          • "weight": 1
          }
        },
      • "quantity": 1,
      • "tax_amount": 5,
      • "tax_rate": 1.99,
      • "tax_type_applied": "VAT",
      • "total_amount": 500,
      • "unit_of_measure": "count",
      • "unit_price": 490
      }
    ],
  • "long_description": null,
  • "notes": "urgent order",
  • "owner": {
    • "id": "d7608b20-fea5-4eb5-bd30-d3f58435e78b",
    • "path": "/accounts/d7608b20-fea5-4eb5-bd30-d3f58435e78b",
    • "resource": "accounts"
    },
  • "path": "/orders/f48cd8e6-e802-4500-a0f9-3ab6228c6f23",
  • "reference_number": "invoice #54321",
  • "resource": "orders",
  • "service_address": {
    • "city": "San Francisco",
    • "country": "US",
    • "line1": "123 Fake Street",
    • "postal_code": "94101",
    • "region": "CA"
    },
  • "ship_from_address": {
    • "city": "San Francisco",
    • "country": "US",
    • "line1": "123 Fake Street",
    • "postal_code": "94101",
    • "region": "CA"
    },
  • "ship_to_address": {
    • "city": "San Francisco",
    • "country": "US",
    • "line1": "123 Fake Street",
    • "postal_code": "94101",
    • "region": "CA"
    },
  • "shipping_status": {
    • "actual_delivery_time": null,
    • "carrier": "UPS",
    • "expected_delivery_time": 1490656130,
    • "shipping_time": 1390656130,
    • "tracking_number": "1Z34567890",
    },
  • "short_description": "Donation to ABC campaign",
  • "state": "active",
  • "status": "paid",
  • "tax_amount": 35,
  • "type": "goods",
  • "vat_amount": 5,
  • "vat_rate": 1.99,
  • "discount_program_name": "Everything is 50% off",
  • "tip_amount": 0,
  • "api_version": "3.0"
}