Create a Payment Container

We create a Payment Container for the received VISA card:

Request
POST /api/v2/Payment/Containers HTTP/1.1
Host: https://connect-testing.secupay-ag.de/api/v2/Payment
Authorization: Bearer qb56tjj1bcvo9n2nj4u38k84lo
Content-Type: application/json
Accept: application/json
 
{
"customer": {
"id": "PCU_38AWDM9362X3X2673BR9WWQC5ZC6AW",
},
"type": "credit_card",
"private": {
"owner": "Max Mustermann",
"pan": "4111xxxxxxxx1111",
"expiration_date": "2022-03-31T23:59:59+00:00",
"issuer": "VISA",
// ...
}
}

If everything is fine, the API responds with 200 OK:

Response
HTTP/1.1 200 OK
Content-Type: application/json
...
 
{
"object": "payment.containers",
"id": "PCT_2TURXA2P22NSQMZTJR0RF9WGZJNAA2",
    "merchant": {
"object": "general.merchants",
"id": "MRC_WVHJQFQ4JNVYNG5B55TYK748ZCHQP8"
},
    "customer": {
"object": "payment.customers",
"id": "PCU_3M55SQZR42NSPDS8GGF4N55EZCDCAZ"
},
"type": "credit_card",
"private": {
"owner": "Max Mustermann",
"pan": "411111XXXXXX1111",
"expiration_date": "2025-12-31T22:59:59+01:00",
"issuer": "VISA"
},
"public": {
"owner": "Max Mustermann",
"pan": "411111XXXXXX1111",
"expiration_date": "2025-12-31T22:59:59+01:00",
"issuer": "VISA"
},
"created": "2020-10-29T13:25:31+01:00"
}

You cannot access the credit card data anymore. But there is enough information to offer this container the same customer for reuse, as long as the card is valid.

You need to remember the id (line 7). It is used for the next step.