You can use an exiting Payment Customer as customer or for the shipping address when you create or update a Smart Transaction.
Our example shows the creation of the Smart Transaction.
Request
POST /api/v2/Smart/Transactions HTTP/1.1
Host: connect-testing.secuconnect.com
Authorization: Bearer qb56tjj1bcvo9n2nj4u38k84lo
Content-Type: application/json
Accept: application/json
{
// ...
"customer"
: {
"id"
:
"PCU_2S6YDT9TG2X0H688RRN7J2EJJMMYAZ"
},
"shipping_address"
: {
"id"
:
"PCU_EA2M2F8VP2X0H6AH2N9GW4ND030AA2"
},
// ...
}
If everything is fine, the API responds with 200 OK
and the object representation:
Response
HTTP/1.1 200 OK
Content-Type: application/json
...
{
"object"
:
"smart.transactions"
,
"id"
:
"STX_23V5JPJVX2X0H68A0XQGN96DGKHSAZ"
,
// ...
"customer"
: {
"object"
:
"payment.customers"
,
"id"
:
"PCU_2S6YDT9TG2X0H688RRN7J2EJJMMYAZ"
,
"contact"
: {
"forename"
:
"Max"
,
"surname"
:
"Mustermann"
,
"name"
:
"Max Mustermann"
,
"address"
: {
"street"
:
"Musterstr."
,
"street_number"
:
"55"
,
"additional_address_data"
:
"App. 902"
,
"postal_code"
:
"09999"
,
"city"
:
"Musterstadt"
,
"country"
:
"DE"
},
"email"
:
"max94@example.com"
}
},
// ...
"shipping_address"
: {
"object"
:
"payment.customers"
,
"id"
:
"PCU_EA2M2F8VP2X0H6AH2N9GW4ND030AA2"
,
"contact"
: {
"forename"
:
"Max"
,
"surname"
:
"Mustermann"
,
"companyname"
:
"Musterfirma GmbH"
,
"name"
:
"Max Mustermann"
,
"address"
: {
"street"
:
"Musterstr."
,
"street_number"
:
"55"
,
"postal_code"
:
"09999"
,
"city"
:
"Musterstadt"
,
"country"
:
"DE"
},
"email"
:
"m.mustermann@example.com"
,
"phone"
:
"+495555555555"
}
}
}
Now you see the customer details from the Payment Customer inside the Smart Transaction.