Multiple Goods
Read about how to model multiple goods.
Single good
To include more than one line item in a transaction, you need to add a transaction line for each good. Here is an example for a single good:
"transaction": {
"currency_code": "USD",
"buyer_name": "Frank Goggins",
"billing_address": {
"street_name": "Main street",
"city": "Big City",
"country_code": "NZ"
},
"location_evidence": {
"self_declaration": {
"country_code": "NZ"
},
"by_ip_address": {
"evidence_value": "145.224.110.0"
}
},
"transaction_lines": [
{
"product_tax_code": {
"class": "VTXD10010"
},
"product_class": "D",
"description": "Acme Video Game",
"amount": "100",
"custom_id": ""
}
]
}
}
Multiple goods on multiple transaction lines
Here is an example for multiple goods with individual transaction lines for each good:
"transaction": {
"currency_code": "USD",
"buyer_name": "Frank Goggins",
"billing_address": {
"street_name": "Main street",
"city": "Big City",
"country_code": "NZ"
},
"location_evidence": {
"self_declaration": {
"country_code": "NZ"
},
"by_ip_address": {
"evidence_value": "145.224.110.0"
}
},
"transaction_lines": [
{
"product_tax_code": {
"class": "VTXD10010"
},
"product_class": "D",
"description": "Video Game 1",
"amount": "100",
"custom_id": ""
},
{
"product_tax_code": {
"class": "VTXD10010"
},
"product_class": "D",
"description": "Video Game 2",
"amount": "25",
"custom_id": ""
}
]
}
}
Quantity
You can use the quantity
field to specify more than one of the same type of good. For example:
"transaction": {
"currency_code": "USD",
"buyer_name": "Frank Goggins",
"billing_address": {
"street_name": "Main street",
"city": "Big City",
"country_code": "NZ"
},
"location_evidence": {
"self_declaration": {
"country_code": "NZ"
},
"by_ip_address": {
"evidence_value": "145.224.110.0"
}
},
"transaction_lines": [
{
"product_tax_code": {
"class": "VTXD10010"
},
"product_class": "D",
"description": "Acme Video Game",
"amount": "100",
"quantity":" 5"
"custom_id": ""
}
]
}
}
Updated about 1 month ago