Level 2 and Level 3 Pricing

 
Note

Our Clear and Link integrations offer Level 2/Level 3 (L2/L3) processing for MasterCard and Visa cards issued in the US & used in card-not-present transactions.

L2/L3 processing provides card holders with better identifiable transaction information, and helps merchants reduce the number of Disputes they receive. Additionally, platforms using revenue share and/or IC+ with us will see lower processing costs for eligible transactions.

L2/L3 processing is a protocol for providing better reporting on special business-to-business (B2B) and business-to-government (B2G) cards including the Visa Purchasing Card, several different MasterCard Corporate/Purchasing cards, and a few other businesses, government, and commercial cards. These cards are intended to streamline accounting processes and improve transaction reporting for large businesses and organizations by collecting more data at the time of transaction. This additional data results in a more secure transaction, and thus qualifies for lower processing costs.

L2 data is primarily tax data related to the transaction. Business cards can only qualify for L2 rates.

L3 data includes the L2 tax data, in addition to line item details.

Platforms should consider implementing L2/L3 processing if a portion of their transactions are consistently processed with commercial cards. Typically, these cards incur high interchange costs, and utilizing L2/L3 processing can help platforms save costs in addition to providing better reporting for cardholders. Additionally, platforms will see a higher rate of L2/L3 eligibility if their merchants already tend to collect the data required for L2/L3.

L2/L3 processing moves through the following steps:

  • Platforms and/or merchants on IC+ and revenue share qualify for immediate lower transaction fees via lower interchange rates when collecting and passing L2/L3 data.
  • Platforms and/or merchants on blended rates qualify for reactive pricing adjustments based on historical savings from L2/L3 transactions.
  • All platforms and merchants will see a decrease in chargebacks for L2/L3 transactions as a result of more security upfront and better descriptors passed on to card holders.
  • L2/L3 data is reported back to Visa and Mastercard, allowing businesses to keep track of their spending and set restrictions on a company credit card.
Current L2/L3 Support
  • Cards issued by Visa or Mastercard
  • Cards issued in the US

Additional support will be added in the future and documented here.


Set Up

At a high-level, the L2/L3 process is as follows:

  1. Work with your account executive, integration team, or technical account manager to get enabled for L2/L3 processing.
  2. Identify merchants on your platform who already utilize most or all of the L2/L3 data points.
  3. Send L2/L3 data on all transactions for that merchant using Orders and Items resources.
  • For auth/cap transactions, send L2/L3 data in the initial auth (POST /payments) and update data as needed before the capture leg. Read more about this in the Capture Payments Later section below.
  • The credit networks and WePay will evaluate each transaction for L2/L3 eligibility, so it is best practice to send L2/L3 data on all your merchants' transactions.
  1. WePay and the card networks will evaluate each transaction's eligibility as they are received.
  2. Partners on IC+ pricing will receive IC+ reports which will also reflect any merchants' adjusted pricing.

Define Items
Items are structurally tied to an Account, so you have two options for creating items. You can create Items and pass them inline when creating or updating an Account. Alternatively, you can create Items by sending a POST to the Items endpoint. If you use this method, you must pass the account_id, so first create an Account.

You can also attach rBits to Items.


Create Orders

Orders are structured objects to help you pass risk information to us. Conceptually, Orders are a superset of Items, and can also contain rBits.

Orders are roughly equivalent to meta data about a checkout, like a payment receipt.

Orders are flexible - they could refer to Items in them, and some Items could just be text. Orders could also be an invoice, which can be tied to the payment, but it is not necessary to be. They are top level items.

There's an order of operations element to this - we'd like to get risk information before a payment is processed. You could also call a separate order and a separate payment after checkout, but you can also do this inline.

Note
Just as with integer parameters in POST /payments, integer-type parameters in Order and Items should be sent in their lowest denomination. This means that an amount of $10.00 should be sent as 1000.

Compile L2 Data

Begin constructing a POST /orders request with the following L2 data points:
Order ParameterVisaMasterCardDescription
customer_reference_numberoptionalrequiredPurchase order or other number used by the merchant's customer to track the order.

Note: This value cannot be empty or 0.
tax_amountrequiredrequiredAmount of sales tax assessed to the transaction.

Required for Visa Level 2 processing, the sales tax amount must be between 0.1% and 22% of the purchase price or the transaction does not qualify for the best possible interchange rate.

Required for Mastercard Level 2 processing, the sales tax amount must be between 0.1% and 30% of the purchase price or the transaction does not qualify for the best possible interchange rate.

Conditional MasterCard MCCs
If your merchant has one of the following MCCs, then tax_amount is not required for payers using a card issued by Mastercard (send 0 as the value):
  • 4111 - Transportation—Suburban and Local Commuter Passenger, including Ferries
  • 4131 - Bus Lines
  • 4215 - Courier Services—Air and Ground, Freight Forwarders
  • 4468 - Marinas, Marine Service/Supplies
  • 4784 - Bridge and Road Fees, Tolls
  • 5541 - Fuel-Inside Sales
  • 5542 - Automated Fuel Dispenser
  • 5499 - Convenience Stores, Markets, Specialty Stores
  • 5983 - Fuel Dealers
  • 7511 - Truck Stops
  • 8211 - Schools, Elementary and Secondary
  • 8220 - Colleges, Universities, Professional Schools, and Junior Colleges
  • 8398 - Organizations, Charitable and Social Service
  • 8661 - Organizations, Religious
  • 9211 - Court Costs including Alimony and Child Support
  • 9222 - Fines
  • 9311 - Tax Payments
  • 9399 - Government Services—not elsewhere classified
  • 9402 - Postal Services—Government Only

Optional fields are recommended in order to provide the best reporting for payers and for the best chances of qualifying for L2 rates on eligible cards.

If required or optional fields are not provided or incorrectly sent, the transaction will be downgraded to level 1 interchange rate for eligible cards.

L2 data is primarily about overall tax information, so L2 data is only found in the Orders resource.

Note
Store the request data for the use case that an update needs to be made. When an update is made, all information that is staying the same needs to get re-sent to prevent the value from becoming null.

Your request should look something like this:

Copy
Copied
curl -X POST \
  --url 'https://stage-api.wepay.com/orders' \
  -H 'Accept: application/json'\
  -H 'App-Id: {your-app-id}'\
  -H 'App-Token: {your-app-token}'\
  -H 'Api-Version: 3.0'\
  -H 'Content-Type: application/json' \
  --data-raw '{
	"account_id": "{merchant's-account-id}",
  	"short_description": "Order from Mrs. Berkenshire for one elite mop on Oct. 31 1999",
  	"type": "goods",
  	"customer_reference_number": "order-A78240981",
  	"tax_amount": 0
}'
Important:
account_id, short_description, and type were all included in this example because they are required parameters.

If this data is not provided or incorrectly sent, then the transaction will be downgraded to level 1 for eligible cards.

The API response will look like this, with values dependent on the values you sent in the request:

Copy
Copied
{
    "create_time": 1583371282,
    "reference_number": null,
    "short_description": "Order from Mrs. Berkenshire for one elite mop on Oct. 31 1999",
    "long_description": null,
    "type": "goods",
    "delivery_type": null,
    "buyer": null,
    "status": null,
    "customer_reference_number": "order-A78240981",
    "tax_amount": 0,
    "alternate_tax_amount": 0,
    "alternate_tax_id": null,
    "vat_amount": 0,
    "vat_rate": 0.0,
    "discount_amount": 0,
    "duty_amount": 0,
    "freight_amount": 0,
    "grand_total_amount": 0,
    "ship_to_address": null,
    "ship_from_address": null,
    "shipping_status": null,
    "service_address": null,
    "notes": null,
    "terms": null,
    "line_items": null,
    "currency": null,
    "owner": {
        "id": "{merchant's-account-id}",
        "path": "/accounts/{merchant's-account-id}",
        "resource": "accounts"
    },
    "id": "0f0a0d95-2f2c-43eb-a9d1-d8e01aa40abf",
    "path": "/orders/0f0a0d95-2f2c-43eb-a9d1-d8e01aa40abf",
    "resource": "orders",
    "state": "active",
    "api_version": "3.0"
}

To use L3 data, continue to the next section below.

If you're not sending L3 data, you'll use the Order's id to attach the L2 data to the transaction itself. Find out how in the Create an L2 or L3 Payment section.

Compile L3 Data

Begin constructing a POST /orders request with the following L3 data points:
Order ParameterVisaMasterCardDescription
customer_reference_numberoptionalrequiredPurchase order or other number used by the merchant's customer to track the order.

Note: This value cannot be empty or 0.
tax_amountoptionalrequiredAmount of sales tax assessed to the transaction.

Conditional MasterCard MCCs
If your merchant has one of the following MCCs, then tax_amount is not required for payers using a card issued by Mastercard (send 0 as the value):
  • 4111 - Transportation—Suburban and Local Commuter Passenger, including Ferries
  • 4131 - Bus Lines
  • 4215 - Courier Services—Air and Ground, Freight Forwarders
  • 4468 - Marinas, Marine Service/Supplies
  • 4784 - Bridge and Road Fees, Tolls
  • 5541 - Fuel-Inside Sales
  • 5542 - Automated Fuel Dispenser
  • 5499 - Convenience Stores, Markets, Specialty Stores
  • 5983 - Fuel Dealers
  • 7511 - Truck Stops
  • 8211 - Schools, Elementary and Secondary
  • 8220 - Colleges, Universities, Professional Schools, and Junior Colleges
  • 8398 - Organizations, Charitable and Social Service
  • 8661 - Organizations, Religious
  • 9211 - Court Costs including Alimony and Child Support
  • 9222 - Fines
  • 9311 - Tax Payments
  • 9399 - Government Services—not elsewhere classified
  • 9402 - Postal Services—Government Only
discount_amountoptionaloptionalThe total amount of discount applied to the order by the transaction by the merchant. If no discount was applied, then send 0.

Note: Cannot contain spaces or be null.
duty_amountoptionaloptionalTotal charges for any import and/or export duties included in this transaction. If no duties, then send 0.

Note: The value cannot contain spaces and cannot be null.
freight_amountoptionaloptionalTotal freight or shipping and handling charges. If no freight charges, then send 0.

Note: The value cannot contain spaces and cannot be null.
ship_to_address.postal_codeoptionaloptionalIf this field is not supplied then the ship to zip, from the ship to address record is used. If neither is supplied, the merchant location postal code is used.
ship_to_address.countryoptionaloptionalThe alpha ISO country code of the country to which the goods were shipped.
ship_from_address.postal_codeoptionaloptionalThe zip/postal code of the location from which the goods were shipped.
alternate_tax_idoptionaloptionalTax ID number for the alternate tax associated with this transaction.
alternate_tax_amountoptionaloptionalTotal amount of alternate tax associated with this transaction.
Parameter under line_items objectVisaMasterCardDescription
discount_amountoptionaloptionalAmount of discount applied to the line item. If no discount was applied, then send 0.

Note: Cannot contain spaces or be null.
commodity_coderequiredoptionalThe commodity code used to classify the item purchased.

Note: The value cannot contain spaces, or be null or 0.

Find the most recent commodity codes defined by United Nations Standard Products and Services Code here. Note that PDF downloads (towards the bottom of the page) are free to download.
descriptionrequiredrequiredText description of the item purchased.

Note: The value cannot contain spaces, or be null or 0.
item.product_codeoptionalrequiredProduct code of the item purchased. These should be defined by merchants per their requirements.

Note: The value cannot contain spaces, or be null or 0.

Click for a non-exhaustive list of example product codes for Fleet transactions that are non-fuel and occur at a fuel location:
  • 030 - Motor Oil
  • 031 - Oil Change
  • 032 - Engine Service
  • 033 - Transmission Service
  • 034 - Brake Service
  • 035 - Solvent
  • 036 - Brake Fluid
  • 037 - Miscellaneous Parts
  • 038 - Miscellaneous Labor
  • 039 - Miscellaneous Repairs
  • 040 - TBA (tire, batteries, accessories)
  • 041 - Tires
  • 042 - Batteries
  • 043 - Automotive Accessories
  • 044 - Automotive Glass
  • 045 - Car Wash
  • 046 - Towing
  • 070 - Cigarettes/Tobacco
  • 078 - Health/Beauty Aid
  • 079 - Miscellaneous Food/Grocery
  • 080 - Soda
  • 081 - Beer/Wine
  • 082 - Milk/Juice
  • 083 - Restaurant
  • 089 - Miscellaneous Beverage
  • 099 - Miscellaneous Other
  • 300 - Aviation Maintenance
  • 301 - De-icing
  • 302 - APU or Aircraft Jump Start
  • 303 - Aviation Catering
  • 304 - Tiedown or Hangar
  • 305 - Landing Fee
  • 306 - Ramp Fee
  • 307 - Call Out Fee
  • 308 - Plane Rental
  • 309 - Instruction Fee
  • 310 - Miscellaneous Aviation
  • 311 - Flight Planning/Weather Fees
  • 312 - Charter Fees
  • 313 - Ground Handling
  • 314 - Communications Fees
  • 315 - Aircraft Cleaning
  • 316 - Cargo Handling
  • 317 - Aviation Accessories
  • 350 - Boat Service
quantityrequiredrequiredThe number of a given item included in the associated Order.

Note: The value cannot contain spaces, or be null or 0.
tax_amountoptionalrequiredTax amount for this item.

Note: The value cannot contain spaces or be null. If no tax applied, send 0.
tax_rateconditionalrequiredTax rate applied to this item.

Note: The value cannot contain spaces or be null. If no tax applied, send 0.
total_amountrequiredrequiredThe amount of the item calculated as price times quantity. Price in this equation should include freight, duty, & tax.

Note: The value cannot contain spaces, or be null or 0.
unit_of_measurerequiredrequiredThe unit of measure, or unit of measure code used for this item.

Note: The value cannot contain spaces, or be null or 0.

Click to see codes for units of measurement used in international trade. The code is the acronym in capital letters (e.g. EA, ACR)
  • EA - Unknown unit of measure
  • ACR - Acre (4840 yd2)
  • AMH - Ampere-hour (3.6 kC)
  • AMP - Ampere
  • ANN - Year
  • APZ - Ounce GB, US (31.10348 g) (tr oz.)
  • ARE - Are (100 m2)
  • ASM - Alcoholic strength mass
  • ASV - Alcoholic strength by volume
  • ATM - Standard atmosphere (101325 Pa)
  • ATT - Technical atmosphere (98066.5 Pa)
  • BAR - Bar
  • BFT - Board foot
  • BG - Unknown unit of measure
  • BHP - Brake horsepower (745.7 W)
  • BHX - Hundred boxes
  • BIL - Billion Eur (trillion US)
  • BLD - Dry barrel (115.627 dm3)
  • BLL - Barrel
  • BQL - Becquerel
  • BTU - British thermal unit (1.055 Kilojoules)
  • BUA - Bushel (35.2391 dm3)
  • BUI - Bushel (36.36874 dm3)
  • BX - Unknown unit of measure
  • C - Unknown unit of measure
  • CA - Unknown unit of measure
  • CCT - Carrying capacity in metric tons
  • CD - Unknown unit of measure
  • CDL - Candela
  • CEL - Celsius degrees
  • CEN - Hundred
  • CGM - Centigram
  • CKG - Coulomb per kg
  • CLF - Hundred leaves
  • CLT - Centiliter
  • CMK - Square centimeter
  • CMT - Centimeter
  • CNP - Hundred packs
  • CNT - Cental GB (45.359237 kg)
  • COU - Coulomb
  • CS - Unknown unit of measure
  • CTM - Metric carat (200 Mg = 2.10-4 kg)
  • CUR - Curie
  • CWA - Hundredweight US (45.3592 kg)
  • D - Unknown unit of measure
  • DAA - Decare
  • DAD - Ten days
  • DAY - Day
  • DEC - Decade (10 years)
  • DLT - Deciliter
  • DMK - Square decimeter
  • DMQ - Cubic decimeter
  • DMT - Decimeter
  • DPC - Dozen pieces
  • DPT - Displacement tonnage
  • DRA - Dram US (3.887935 g)
  • DRI - Dram GB (1.771745 g)
  • DRL - Dozen rolls
  • DRM - Drachm gm (3.887935 g)
  • DTH - Hectokilogram
  • DTN - Centner / Quintal, metric (100 kg) (decitonne)
  • DWT - Pennyweight GB, US (1.555174 g)
  • DZ - Unknown unit of measure
  • DZN - Dozen
  • DZP - Dozen packs
  • DZR - Dozen pairs
  • EA - Unknown unit of measure
  • EAC - Each
  • FAH - Fahrenheit degrees
  • FAR - Farad
  • FOT - Foot (.3048 m)
  • FT - Unknown unit of measure
  • FTK - Square foot
  • FTQ - Cubic foot
  • G - Unknown unit of measure
  • GAL - Unknown unit of measure
  • GBQ - Gigabequerel
  • GFI - Gram of fissile isotopes
  • GGR - Great gross (12 gross)
  • GIA - Gill (11.8294 cm3)
  • GII - Gill (0.142065 dm3)
  • GLD - Dry gallon (4.404884 dm3)
  • GLI - Gallon (4.546092 dm3)
  • GLL - Liquid gallon (3.78541 dm3)
  • GRM - Gram
  • GRN - Grain GB, US (64.798910 mg)
  • GRO - Gross
  • GRT - Gross (Register) ton
  • GWH - Gigawatt-hour (1 Million kWh
  • HAR - Hectare
  • HBA - Hectobar
  • HGM - Hectogram
  • HIU - Hundred international units
  • HLT - Hectoliter
  • HMQ - Million cubic meters
  • HMT - Hectometer
  • HPA - Hectoliter of pure alcohol
  • HTZ - Hertz
  • HUR - Hour
  • INH - Inch (25.4 mm)
  • INK - Square inch
  • INQ - Cubic inch
  • ITM - Item
  • JOU - Joule
  • KBA - Kilobar
  • KEL - Kelvin
  • KGM - Kilogram
  • KGS - Kilogram per second
  • KHZ - Kilohertz
  • KJO - Kilojoule
  • KMH - Kilometer per hour
  • KMK - Square kilometer
  • KMQ - Kilogram per cubic meter
  • KMT - Kilometer
  • KNI - Kilogram of nitrogen
  • KNS - Kilogram of named substance
  • KNT - Knot (1 nautical mile per hour)
  • KPA - Kilopascal
  • KPH - Kilogram of caustic potash (kilogram of potassium hydroxide)
  • KPO - Kilogram of potassium oxide
  • KPP - Kilogram of phosphoric anhydride (kilogram of phosphoric pentoxide)
  • KSD - Kilogram of substance 90% dry
  • KSH - Kilogram of caustic soda
  • KTN - Kilotonne
  • KUR - Kilogram of uranium
  • KVA - Kilovolt-ampere
  • KVR - Kilovar
  • KVT - Kilovolt
  • KWH - Kilowatt-hour
  • KWT - Kilowatt
  • LBR - Pound GB, US (0.45359237 kg)
  • LBS - Unknown unit of measure
  • LBT - Troy pound, US (373.242 g)
  • LEF - Leaf
  • LPA - Liter of pure alcohol
  • LTN - Long ton GB, US (1.0160469 T)
  • LTR - Liter (1 dm3)
  • LUM - Lumen
  • LUX - Lux
  • MAL - Megaliter
  • MAM - Megameter
  • MAW - Megawatt
  • MBE - Thousand standard brick equivalent
  • MBF - Thousand board-feet (2.36 m3)
  • MBR - Millibar
  • MCU - Millicurie
  • MGM - Milligram
  • MHZ - Megahertz
  • MIK - Square mile
  • MIL - Thousand
  • MIN - Minute
  • MIO - Million
  • MIU - Million international units
  • MLD - Billion US (milliard)
  • MLT - Milliliter
  • MMK - Square millimeter
  • MMQ - Cubic millimeter
  • MMT - Millimeter
  • MON - Month
  • MPA - Megapascal
  • MQH - Cubic meter per hour
  • MQS - Cubic meter per second
  • MSK - Meter per second squared
  • MTK - Square meter
  • MTQ - Cubic meter
  • MTR - Meter
  • MTS - Meter per second
  • MVA - Megavolt-ampere (1000 kva)
  • MWH - Megawatt-hour (1000 kWh)
  • NAR - Number of articles
  • NBB - Number of bobbins
  • NCL - Number of cells
  • NEW - Newton
  • NIU - Number of international units
  • NMB - Number
  • NMI - Nautical mile (1852 m)
  • NMP - Number of packs
  • NMR - Number of pairs
  • NPL - Number of parcels
  • NPT - Number of parts
  • NRL - Number of rolls
  • NTT - Net (register) ton
  • OHM - Ohm
  • ONZ - Ounce GB, US (28.349523 g)
  • OZA - Fluid ounce (29.5735 cm3)
  • OZI - Fluid ounce (28.413 cm3)
  • PAL - Pascal
  • PCB - Piece
  • PCE - Unknown unit of measure
  • PER - Unknown unit of measure
  • PGL - Proof gallon
  • PK - Unknown unit of measure
  • PTD - Dry pint (0.55061 dm3)
  • PTI - Pint (0.568262 dm3)
  • PTL - Liquid pint (0.473176 dm3)
  • QAN - Quarter (of a year)
  • QTD - Dry quart (1.101221 dm3)
  • QTI - Quart (1.136523 dm3)
  • QTL - Liquid quart (0.946353 dm3)
  • QTR - Quarter, GB (12.700586 kg)
  • RL - Unknown unit of measure
  • RM - Unknown unit of measure
  • RPM - Revolution per minute
  • RPS - Revolution per second
  • SAN - Half year (6 months)
  • SCO - Score
  • SCR - Scruple GB, US (1.295982 g)
  • SEC - Second
  • SET - Set
  • SHT - Shipping ton
  • SIE - Siemens
  • SMI - (Statute) mile (1609.344 m)
  • SST - Short Standard (7200 matches)
  • ST - Unknown unit of measure
  • STI - Stone GB (6.350293 kg)
  • STN - Short ton GB, US (0.90718474 T)
  • TAH - Thousand ampere-hour
  • TNE - Metric ton (1000 kg) (tonne (1000 kg)
  • TPR - Ten pairs
  • TQD - Thousand cubic meters per day
  • TRL - Trillion EUR
  • TSD - Tonne of substance 90% dry
  • TSH - Ton of steam per hour
  • VLT - Volt
  • WCD - Cord (3.63 m3)
  • WEB - Weber
  • WEE - Week
  • WHR - Watt-hour
  • WSD - Standard
  • WTT - Watt
  • YDK - Square yard
  • YDQ - Cubic yard
  • YRD - Yard (0.9144 m)
unit_priceoptionaloptionalThe cost of a single unit without any tax, freight, or duties.

Note: The value cannot contain spaces, or be null or 0.
gross_net_indicatoroptionaloptionalIndicates whether tax amount is included in item amount.

Valid values:
Y - item amount includes tax amount
N - item amount does not include tax amount
discount_indicatoroptionaloptionalIndicates whether the amount is discounted.

Valid values:
Y - amount is discounted
N - amount is not discounted
tax_type_appliedoptionaloptionalType of Tax being applied.

Optional fields are recommended in order to provide the best reporting for payers, and for the best chances of qualifying for L3 rates on eligible cards.

If required and optional fields are not provided or incorrectly sent, the transaction will be downgraded to level 2 or level 1 interchange rate for eligible cards.

Note
Store the request data for the use case that an update needs to be made. When an update is made, all information that is staying the same needs to get sent again to prevent the value from becoming null.
Here is what your POST /orders request should look like for an L3 transaction:
Copy
Copied
curl -X POST \
  --url 'https://stage-api.wepay.com/orders' \
  -H 'Accept: application/json'\
  -H 'App-Id: {your-app-id}'\
  -H 'App-Token: {your-app-token}'\
  -H 'Api-Version: 3.0'\
  -H 'Content-Type: application/json' \
  --data-raw '{
	"account_id": "{merchant's-account-id}",
	"short_description": "Order from Mrs. Berkenshire for one elite mop on Oct. 31 1999.",
	"type": "goods",
	"customer_reference_number": "order-A78240981",
	"tax_amount": 0,
	"discount_amount": 0,
	"duty_amount": 0,
	"freight_amount": 1000,
	"alternate_tax_id": "EIN",
	"alternate_tax_amount": 0,
	"ship_to_address": {
		"country": "US",
		"postal_code": "90210"
	},
	"ship_from_address": {
		"country": "US",
		"postal_code": "94101"
	},
	"line_items": [
		{
		"currency": "USD",
		"quantity": 2,
		"commodity_code": "25101803",
		"discount_amount": 0,
		"description": "Elite mop with green handle and white mop head.",
		"tax_amount": 0,
		"tax_rate": 0,
		"total_amount": 2000,
		"unit_of_measure": "ITM",
		"gross_net_indicator": "Y",
		"discount_indicator": "N",
		"tax_type_applied": "state sales tax",
		"unit_price": 2000,
		"item": {
			"account_id": "{merchant's-account-id}",
			"product_code": "E-M1",
			"product_name": "Elite Basic Mop"
		}
	}
	]
}'
Important:
account_id, short_description, type, line_items.currency, line_items.item.account_id, & line_items.item.product_name were included in this example because they are required parameters for the API request, as opposed to L3 processing.

The API response could look like this, with values being dependent on the values you sent in the request:

Copy
Copied
{
    "create_time": 1583364540,
    "reference_number": null,
    "short_description": "Order from Mrs. Berkenshire for one elite mop on Oct. 31 1999.",
    "long_description": null,
    "type": "goods",
    "delivery_type": null,
    "buyer": null,
    "status": null,
    "customer_reference_number": "order-A78240981",
    "tax_amount": 0,
    "alternate_tax_amount": 0,
    "alternate_tax_id": "EIN",
    "vat_amount": 0,
    "vat_rate": 0.0,
    "discount_amount": 0,
    "duty_amount": 0,
    "freight_amount": 1000,
    "grand_total_amount": 0,
    "ship_to_address": {
        "country": "US",
        "postal_code": "90210"
    },
    "ship_from_address": {
        "country": "US",
        "postal_code": "94101"
    },
    "shipping_status": null,
    "service_address": null,
    "notes": null,
    "terms": null,
    "line_items": [
        {
            "item": {
                "create_time": 1583364540,
                "reference_number": null,
                "photos": null,
                "product_code": "E-M1",
                "product_name": "Elite Basic Mop",
                "description": null,
                "shipping_options": null,
                "product_details": null,
                "price": 0,
                "currency": "USD",
                "terms": null,
                "uri": null,
                "weight": null,
                "owner": {
                    "id": "{merchant's-account-id}",
                    "path": "/accounts/{merchant's-account-id}",
                    "resource": "accounts"
                },
                "id": "d44a32ce-b4c3-4cc1-a1e8-12876860c302",
                "path": "/items/d44a32ce-b4c3-4cc1-a1e8-12876860c302",
                "resource": "items",
                "state": "active"
            },
            "currency": "USD",
            "quantity": 2,
            "tax_rate": 0,
            "tax_amount": 0,
            "unit_price": 2000,
            "description": "Elite mop with green handle and white mop head.",
            "total_amount": 2000,
            "commodity_code": "25101803",
            "discount_amount": 0,
            "unit_of_measure": "ITM",
            "tax_type_applied": "state sales tax",
            "discount_indicator": "N",
            "gross_net_indicator": "Y"
        }
    ],
    "currency": null,
    "owner": {
        "id": "{merchant's-account-id}",
        "path": "/accounts/{merchnt's-account-id}",
        "resource": "accounts"
    },
    "id": "0f0a0d95-2f2c-43eb-a9d1-d8e01aa40abf",
    "path": "/orders/0f0a0d95-2f2c-43eb-a9d1-d8e01aa40abf",
    "resource": "orders",
    "state": "active",
    "api_version": "3.0"
}
Store any Item ids in association with the Order id. Next, you'll use the Oder's id to attach the L2/L3 data to the transaction itself.

Create an L2 or L3 Payment

Once you have an Order ID with the final transaction information, send a POST /payments request with that Order ID, like so:
Copy
Copied
curl -X POST \
  --url 'https://stage-api.wepay.com/payments' \
  -H 'Accept: application/json'\
  -H 'App-Id: {your-app-id}'\
  -H 'App-Token: {your-app-token}'\
  -H 'Api-Version: 3.0'\
  -H 'Content-Type: application/json'\
  -H 'Unique-Key: Unique-Key0' \
  --data-raw '{
  "account_id": "{merchant's-account-id}",
  "amount": "5000",
  "fee_amount": 800,
  "auto_capture": true,
  "currency": "USD",
  "fee_amount": "{app's-fees}",
  "order_id": "0f0a0d95-2f2c-43eb-a9d1-d8e01aa40abf",
  "payment_method": {
    "type": "payment_method_id",
    "payment_method_id": "{previously-tokenized-payment-method}"
  },
  "initiated_by": "customer"
}'

Once the Payment has L2/L3 data, WePay and the card networks will determine the transaction's eligibility for L2/L3 pricing. Note that card networks will ultimately have the final say in a transaction's L2/L3 eligibility.

Partners using revenue share and/or IC+ with us will see processing cost reductions in their WePay account.


Create Inline Orders on Payments

Use the POST/ payments when you are creating a payment. Note, you cannot have both an order_id and order in the same POST/ payments request, doing this will return a 400 error.
Copy
Copied
curl -X POST \
  --url 'https://stage-api.wepay.com/payments' \
  -H 'Accept: application/json'\
  -H 'App-Id: {your-app-id}'\
  -H 'App-Token: {your-app-token}'\
  -H 'Api-Version: 3.0'\
  -H 'Content-Type: application/json'\
  -H 'Unique-Key: Unique-Key' \
  --data-raw '{
  "account_id": "{merchant's-account-id}",
  "amount": "5000",
  "fee_amount": 800,
  "auto_capture": true,
  "currency": "USD",
  "fee_amount": "{app's-fees}",
  "order": {
        "type": "goods",
        "short_description": "short_description6"
  	},
  "payment_method": {
    "type": "payment_method_id",
    "payment_method_id": "{previously-tokenized-payment-method}"
  },
  "initiated_by": "customer"
}'
The response will return an order_id to use for resource lookup later on the GET/ Orders endpoint.

Capture Payments Later

If a transaction is being completed with Manual or Partial capture, your process for sending L2/L3 data will go as follows:
  1. Create the API Order with information known
  2. Create the API Payment with the Order id
  3. If any information in the Order changes, call POST /orders/{id}; if any information in the Item changes, call POST /items/{id}
  4. Once the final capture information for the Payment is known, verify that the related Order and Items reflect accurate information
  5. Send the POST /payments/{id}/capture request
Note
It is not recommended to use Deferred capture with L2/L3 processing. While this flow is possible, it is imperative that any changes in capture information are reflected in the Order and Items before the designated capture_at time.
Your POST /payments request will be the same as above, with the exception of the auto_capture parameter.

For the sake of example, let's assume that the final transaction amount has changed due to a decrease in the shipping cost and a request from the purchaser reduce the item quantity from 2 to 1 due to an accidental duplicate purchase.

As mentioned in above sections, you should have the data from the initial POST /orders request. Work from that data, and apply updates where needed. Following the example, you'll need to update the freight_amount and line_items.item.quantity parameters like so:
Copy
Copied
curl -X POST \
  --url 'https://stage-api.wepay.com/orders/0f0a0d95-2f2c-43eb-a9d1-d8e01aa40abf' \
  -H 'Accept: application/json'\
  -H 'App-Id: {your-app-id}'\
  -H 'App-Token: {your-app-token}'\
  -H 'Api-Version: 3.0'\
  -H 'Content-Type: application/json' \
  --data-raw '{
	"account_id": "{merchant's-account-id}",
	"short_description": "Order from Mrs. Berkenshire for one elite mop on Oct. 31 1999.",
	"type": "goods",
	"customer_reference_number": "order-A78240981",
	"tax_amount": 0,
	"discount_amount": 0,
	"duty_amount": 0,
	"freight_amount": 750,
	"alternate_tax_id": "EIN",
	"alternate_tax_amount": 0,
	"ship_to_address": {
		"country": "US",
		"postal_code": "90210"
	},
	"ship_from_address": {
		"country": "US",
		"postal_code": "94101"
	},
	"line_items": [
		{
		"currency": "USD",
		"quantity": 1,
		"commodity_code": "25101803",
		"discount_amount": 0,
		"description": "Elite mop with green handle and white mop head.",
		"tax_amount": 0,
		"tax_rate": 0,
		"total_amount": 2000,
		"unit_of_measure": "ITM",
		"gross_net_indicator": "Y",
		"discount_indicator": "N",
		"tax_type_applied": "state sales tax",
		"unit_price": 2000,
		"item": {
			"account_id": "{merchant's-account-id}",
			"product_code": "E-M1",
			"product_name": "Elite Basic Mop"
		}
	}
	]
}'

Note that a new Item will be created, and the new Item ID will be the one associated with the Order. For best practice, delete the old Item like so:

Copy
Copied
curl -X DELETE \
  --url 'https://stage-api.wepay.com/items/d44a32ce-b4c3-4cc1-a1e8-12876860c302' \
  -H 'Accept: application/json'\
  -H 'App-Id: {your-app-id}'\
  -H 'App-Token: {your-app-token}'\
  -H 'Api-Version: 3.0'
Once the updates have been applied to the Order and Item(s), the POST /payments/{id}/capture request will look like this:
Copy
Copied
curl -X POST \
  --url 'https://stage-api.wepay.com/payments/{id}/capture' \
  -H 'Accept: application/json'\
  -H 'App-Id: {your-app-id}'\
  -H 'App-Token: {your-app-token}'\
  -H 'Api-Version: 3.0'\
  -H 'Content-Type: application/json' \
  --data-raw '{
  "amounts": {
    "amount": 2750,
    "currency": "USD",
    "fee_amount": 400
  }
}'
Be sure to re-calculate your fees if the amounts.amount value is changing from the original value, and that fee_amount cannot exceed 20% of the total amount.

Once the Payment has L2/L3 data and is captured, WePay and the card networks will determine the transaction's eligibility for L2/L3 pricing. Note that card networks will ultimately have the final say in a transaction's L2/L3 eligibility.

Partners using revenue share and/or IC+ with us will see processing cost reductions in their WePay account.