The information contained in ecommerce invoices may vary according to business laws in each country. It is possible, for example, that you are required to include payment method information in case a sale is made through an intermediator.
VTEX stores this data during checkout and makes it available to sellers integrated with different types of marketplaces.
It is possible to see who the marketplace is by checking the order object with the Get order API request, in the affiliateId
field, like in the example below.
_20{_20 "emailTracked": "a27499cad31f42b7a771ae34f57c8358@ct.vtex.com.br",_20 "approvedBy": null,_20 "cancelledBy": null,_20 "cancelReason": null,_20 "orderId": "v5195004lux-01",_20 "sequence": "502556",_20 "marketplaceOrderId": "880102018018-01",_20 "marketplaceServicesEndpoint": "http://oms.vtexinternal.com.br/api/oms?an=luxstore",_20 "sellerOrderId": "00-v5195004lux-01",_20 "origin": "Fulfillment",_20 "affiliateId": "ABC",_20 "salesChannel": "1",_20 "merchantName": null,_20 "status": "handling",_20 "statusDescription": "Preparando Entrega",_20 "value": 1160,_20 "creationDate": "2019-01-28T20:09:43.8999580+00:00",_20 "lastChange": "2019-02-06T20:46:11.7010747+00:00",_20…
In case of sellers using the Multilevel Omnichannel Inventory feature, the
affiliateId
field identifies the marketplace in the level directly above it. This means that if a seller on the third level receives a fulfillment order made in a marketplace in the first level, the order’saffiliateId
will refer to the second level marketplace. Payment method information can be accessed in two different ways depending on the type of marketplace.
VTEX marketplaces
VTEX clients who are sellers of other VTEX clients can access intermediator payment method data in the order object, in the userPaymentInfo.paymentMethod
array, within the invoiceData
object. See the example below.
_10..._10"invoiceData": {_10 "userPaymentInfo": {_10 "paymentMethod": [_10 "creditCardPaymentGroup"_10 ]_10 }_10}_10...
The paymentMethod
array includes strings which follow this pattern {payment-group-name}PaymentGroup
. There are dozens of possible values, depending on the payment groups used by the marketplace. These are some examples:
"creditCardPaymentGroup"
"debitCardPaymentGroup"
"instantPaymentPaymentGroup"
"promissoryPaymentGroup"
"PayPalPlusPaymentGroup"
"OneBuyPaymentGroup"
"virtualDebitEloPaymentGroup"
"foodCardPaymentGroup"
"giftCardPaymentGroup"
"debitPaymentGroup"
"PaymentHubPaymentGroup"
"PagosNetPaymentGroup"
"bankInvoicePaymentGroup"
"PagosWebPaymentGroup"
"cardPromissoryPaymentGroup"
"SamsungPayPaymentGroup"
For external sellers connected to VTEX marketplaces this data is also sent in the
invoiceData
object, in the format described above.
Natively integrated external marketplaces
VTEX provides native connectors that allow our clients to connect to external marketplaces. We store intermediator data and make it available to sellers integrating with:
- B2W
- Via Varejo
- Magazine Luiza
- Mercado Libre
- Amazon
- Centauro
- Dafiti
- Wish
In this scenario, marketplace payment method information is stored in the customData
object in the orderForm
data structure.
The following marketplaces are also natively integrated, however, their payment information is not automatically stored in the customData object.
- Carrefour
- Netshoes
Fetching external marketplace payment method data
This is an example of what you might find in the customData
object of the order object when using the Get order request:
_14{_14 ..._14 "customData": {_14 "customApps": [_14 {_14 "id": "CN-Viavarejo-Integration",_14 "fields": {_14 "marketplacePaymentMethod": "credit_card"_14 }_14 }_14 ]_14 }_14 ..._14}
The Checkout API allows integrators to create customizable fields in the shopping cart through the
customData
object. Their middleware can create extra fields in theorderForm
data structure and set the value of each of these fields when placing an order, so that this additional information can be retrieved when fetching order details with the Orders API. For orders made in marketplaces with native VTEX connectors, payment method will be available in themarketplacePaymentMethod
field. These are the possible values for this field:
"credit_card"
"debit_card"
"bank_slip"
"bank_deposit"
"pix"
"digital_wallet"
"gift_card"
"virtual_credit"
"payment_method_not_informed"