Inbound B2C Customer Confirmation

Customers

customersPost

Updates a B2C customer.

Updates a B2C customer and publishes an event that confirms the creation of the B2C customer in the target SAP backend system.


/Customers

Usage and SDK Samples

curl -X POST\
 -H "Authorization: Basic [[basicHash]]"\
-H "Accept: application/json"\
-H "Content-Type: application/json"\
"https://localhost:9002/odata2webservices/InboundB2CCustomerConfirmation/Customers"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.CustomersApi;

import java.io.File;
import java.util.*;

public class CustomersApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();
        // Configure HTTP basic authorization: basicAuthentication
        HttpBasicAuth basicAuthentication = (HttpBasicAuth) defaultClient.getAuthentication("basicAuthentication");
        basicAuthentication.setUsername("YOUR USERNAME");
        basicAuthentication.setPassword("YOUR PASSWORD");

        CustomersApi apiInstance = new CustomersApi();
        Customers_body body = ; // Customers_body | 
        String prePersistHook = prePersistHook_example; // String | Inbound persistence hook for B2C customer creation confirmation.
        String accept = accept_example; // String | Accept header specifying the Media Type the API should respond with.
        String contentType = contentType_example; // String | Content-Type header specifying the Media Type the request body is formatted in.
        try {
            Wrapper result = apiInstance.customersPost(body, prePersistHook, accept, contentType);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling CustomersApi#customersPost");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.CustomersApi;

public class CustomersApiExample {

    public static void main(String[] args) {
        CustomersApi apiInstance = new CustomersApi();
        Customers_body body = ; // Customers_body | 
        String prePersistHook = prePersistHook_example; // String | Inbound persistence hook for B2C customer creation confirmation.
        String accept = accept_example; // String | Accept header specifying the Media Type the API should respond with.
        String contentType = contentType_example; // String | Content-Type header specifying the Media Type the request body is formatted in.
        try {
            Wrapper result = apiInstance.customersPost(body, prePersistHook, accept, contentType);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling CustomersApi#customersPost");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];
// Configure HTTP basic authorization (authentication scheme: basicAuthentication)
[apiConfig setUsername:@"YOUR_USERNAME"];
[apiConfig setPassword:@"YOUR_PASSWORD"];
Customers_body *body = ; // 
String *prePersistHook = prePersistHook_example; // Inbound persistence hook for B2C customer creation confirmation.
String *accept = accept_example; // Accept header specifying the Media Type the API should respond with. (optional)
String *contentType = contentType_example; // Content-Type header specifying the Media Type the request body is formatted in. (optional)

CustomersApi *apiInstance = [[CustomersApi alloc] init];

// Updates a B2C customer.
[apiInstance customersPostWith:body
    prePersistHook:prePersistHook
    accept:accept
    contentType:contentType
              completionHandler: ^(Wrapper output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var InboundB2CCustomerConfirmation = require('inbound_b2_c_customer_confirmation');
var defaultClient = InboundB2CCustomerConfirmation.ApiClient.instance;
// Configure HTTP basic authorization: basicAuthentication
var basicAuthentication = defaultClient.authentications['basicAuthentication'];
basicAuthentication.username = 'YOUR USERNAME'
basicAuthentication.password = 'YOUR PASSWORD'

var api = new InboundB2CCustomerConfirmation.CustomersApi()
var body = ; // {{Customers_body}} 
var prePersistHook = prePersistHook_example; // {{String}} Inbound persistence hook for B2C customer creation confirmation.
var opts = { 
  'accept': accept_example // {{String}} Accept header specifying the Media Type the API should respond with.
  'contentType': contentType_example // {{String}} Content-Type header specifying the Media Type the request body is formatted in.
};
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.customersPost(bodyprePersistHook, opts, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class customersPostExample
    {
        public void main()
        {
            // Configure HTTP basic authorization: basicAuthentication
            Configuration.Default.Username = "YOUR_USERNAME";
            Configuration.Default.Password = "YOUR_PASSWORD";

            var apiInstance = new CustomersApi();
            var body = new Customers_body(); // Customers_body | 
            var prePersistHook = prePersistHook_example;  // String | Inbound persistence hook for B2C customer creation confirmation.
            var accept = accept_example;  // String | Accept header specifying the Media Type the API should respond with. (optional) 
            var contentType = contentType_example;  // String | Content-Type header specifying the Media Type the request body is formatted in. (optional) 

            try
            {
                // Updates a B2C customer.
                Wrapper result = apiInstance.customersPost(body, prePersistHook, accept, contentType);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling CustomersApi.customersPost: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure HTTP basic authorization: basicAuthentication
Swagger\Client\Configuration::getDefaultConfiguration()->setUsername('YOUR_USERNAME');
Swagger\Client\Configuration::getDefaultConfiguration()->setPassword('YOUR_PASSWORD');

$api_instance = new Swagger\Client\ApiCustomersApi();
$body = ; // Customers_body | 
$prePersistHook = prePersistHook_example; // String | Inbound persistence hook for B2C customer creation confirmation.
$accept = accept_example; // String | Accept header specifying the Media Type the API should respond with.
$contentType = contentType_example; // String | Content-Type header specifying the Media Type the request body is formatted in.

try {
    $result = $api_instance->customersPost($body, $prePersistHook, $accept, $contentType);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CustomersApi->customersPost: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::CustomersApi;
# Configure HTTP basic authorization: basicAuthentication
$WWW::SwaggerClient::Configuration::username = 'YOUR_USERNAME';
$WWW::SwaggerClient::Configuration::password = 'YOUR_PASSWORD';

my $api_instance = WWW::SwaggerClient::CustomersApi->new();
my $body = WWW::SwaggerClient::Object::Customers_body->new(); # Customers_body | 
my $prePersistHook = prePersistHook_example; # String | Inbound persistence hook for B2C customer creation confirmation.
my $accept = accept_example; # String | Accept header specifying the Media Type the API should respond with.
my $contentType = contentType_example; # String | Content-Type header specifying the Media Type the request body is formatted in.

eval { 
    my $result = $api_instance->customersPost(body => $body, prePersistHook => $prePersistHook, accept => $accept, contentType => $contentType);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling CustomersApi->customersPost: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint
# Configure HTTP basic authorization: basicAuthentication
swagger_client.configuration.username = 'YOUR_USERNAME'
swagger_client.configuration.password = 'YOUR_PASSWORD'

# create an instance of the API class
api_instance = swagger_client.CustomersApi()
body =  # Customers_body | 
prePersistHook = prePersistHook_example # String | Inbound persistence hook for B2C customer creation confirmation.
accept = accept_example # String | Accept header specifying the Media Type the API should respond with. (optional)
contentType = contentType_example # String | Content-Type header specifying the Media Type the request body is formatted in. (optional)

try: 
    # Updates a B2C customer.
    api_response = api_instance.customers_post(body, prePersistHook, accept=accept, contentType=contentType)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling CustomersApi->customersPost: %s\n" % e)

Parameters

Header parameters
Name Description
Accept
String
Accept header specifying the Media Type the API should respond with.
Content-Type
String
Content-Type header specifying the Media Type the request body is formatted in.
Pre-Persist-Hook*
String
Inbound persistence hook for B2C customer creation confirmation.
Required
Body parameters
Name Description
body *

Responses

Status: 201 - Success response with the updates Customers as part of the master data integrating with SAP backends.

Status: 400 - invalid_metadata_error_content and additional error responses that may occur when sending a POST request in an attempt to create a new Item.

Status: 401 - Unauthorized exception responses

Status: 403 - Forbidden exception responses

Status: 404 - Not Found exception responses for POST operations.

Status: 415 - Provided Media-Type is not supported