---
schema_version: "1"
id: 82a87745f65eed5a3c6d5f2b6871f754710d2af7662431b1c5339ddbde8348d0
title: Bulk
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/commerce-cloud/marketplace/references/generated-api-specs/marketplace-seller-bulk.md
canonical_url: https://developer.salesforce.com/docs/commerce/marketplace/references/marketplace-seller-bulk
source_site: developer.salesforce.com
content_type: documentation
content_hash: 9fe3bf47db2db98dfc2ade10a7977e8a3f94e5243601d997c1607ff691b51f4f
products:
  - Commerce Marketplace
  - Salesforce APIs
---
Bulk

# Bulk

The Salesforce API allows bulk operations to upload thousands of records in a batch.

In this section, we will show examples using Inventory Records, but the same logic may be used for any type of record.

The entire process may be summarized as creating a bulk job with the record-type data, uploading the data in CSV format, starting the processing of the job and periodically checking whether the job has finished and its respective result. Full API documentation can be found at: [https://developer.salesforce.com/docs/atlas.en-us.232.0.api\_asynch.meta/api\_asynch/bulk\_api\_2\_0.htm](https://developer.salesforce.com/docs/atlas.en-us.232.0.api_asynch.meta/api_asynch/bulk_api_2_0.htm).

**Version:** 1.0.0

## Servers

*   `https://login.salesforce.com`
*   `http://mydomainname.my.site.com`
*   `http://{{community-url}}`
*   `http://{{base-url}}`

## Security

*   `oauth2Auth` (http)
    *   HTTP scheme: oauth2
*   `bearerAuth` (http)
    *   HTTP scheme: bearer

## Operations

### POST Create a Job

`POST /services/data/v51.0/jobs/ingest`

Operation ID: `Create a Job`. Tags: Bulk. Security: bearerAuth.

Create a new job for data upload. Define the general data on the job, such as record type, field used as ID and operation type.

#### Request body

Media type: `application/json`. Schema: `object`.

_Example_

```
{
  "object": "Atonit_Mktplace__Inventory_Record__c",
  "externalIdFieldName": "Atonit_Mktplace__External_Id__c",
  "contentType": "CSV",
  "operation": "upsert",
  "lineEnding": "CRLF"
}
```

#### Responses

*   **200** OK
    
    Headers:
    
    *   `Date` (string)  
        Example: `Wed, 26 May 2021 13:35:28 GMT`.
    *   `Strict-Transport-Security` (string)  
        Example: `max-age=31536002; includeSubDomains`.
    *   `X-Content-Type-Options` (string)  
        Example: `nosniff`.
    *   `X-XSS-Protection` (string)  
        Example: `1; mode=block`.
    *   `X-Robots-Tag` (string)  
        Example: `none`.
    *   `Cache-Control` (string)  
        Example: `no-cache,must-revalidate,max-age=0,no-store,private`.
    *   `Sforce-Limit-Info` (string)  
        Example: `api-usage=1581/101002`.
    *   `Content-Type` (string)  
        Example: `application/json;charset=UTF-8`.
    *   `Vary` (string)  
        Example: `Accept-Encoding`.
    *   `Content-Encoding` (string)  
        Example: `gzip`.
    *   `Transfer-Encoding` (string)  
        Example: `chunked`.
    
    Media type: `application/json`. Schema: `object`.
    
    _Example_
    
    ```
    {
      "id": "7505Y00000QJI8TQAX",
      "operation": "upsert",
      "object": "Atonit_Mktplace__Inventory_Record__c",
      "createdById": "0055Y00000GrvNkQAJ",
      "createdDate": "2021-05-26T13:35:28.000+0000",
      "systemModstamp": "2021-05-26T13:35:28.000+0000",
      "state": "Open",
      "externalIdFieldName": "Atonit_Mktplace__External_Id__c",
      "concurrencyMode": "Parallel",
      "contentType": "CSV",
      "apiVersion": 51,
      "contentUrl": "services/data/v51.0/jobs/ingest/7505Y00000QJI8TQAX/batches",
      "lineEnding": "CRLF",
      "columnDelimiter": "COMMA"
    }
    ```
    

### PUT Upload Job Data

`PUT /services/data/v51.0/jobs/ingest/[jobID]/batches`

Operation ID: `Upload Job Data`. Tags: Bulk. Security: bearerAuth.

This call allows the data to be uploaded to a created job in CSV format. To call this endpoint, a jobID returned by the “Create a Job” call needs to be used. This upload may be broken down into various calls if there is a lot of data to be updated, with processing only starting when the start call is made in the job.

#### Parameters

*   `Content-Type` (header, string)
    
    _Example_
    
    ```
    text/csv
    ```
    

#### Request body

Media type: `application/json`. Schema: `object`.

Example: `Atonit_Mktplace__External_Id__c,Atonit_Mktplace__Inventory__r.Atonit_Mktplace__External_Id__c,Atonit_Mktplace__Product_Variant__r.Atonit_Mktplace__External_Id__c,Atonit_Mktplace__Quantity__c{{seller-api-prefix}}-inventory-{{seller-api-prefix}}-sku-1,{{seller-api-prefix}}-inventory,{{seller-api-prefix}}-sku-1,99{{seller-api-prefix}}-incorrect_id-{{seller-api-prefix}}-sku-1,{{seller-api-prefix}}-incorrect_id,{{seller-api-prefix}}-sku-1,99`.

#### Responses

*   **201** Created
    
    Headers:
    
    *   `Date` (string)  
        Example: `Wed, 26 May 2021 13:36:10 GMT`.
    *   `Strict-Transport-Security` (string)  
        Example: `max-age=31536002; includeSubDomains`.
    *   `X-Content-Type-Options` (string)  
        Example: `nosniff`.
    *   `X-XSS-Protection` (string)  
        Example: `1; mode=block`.
    *   `Content-Security-Policy` (string)  
        Example: `upgrade-insecure-requests` .
    *   `X-Robots-Tag` (string)  
        Example: `none`.
    *   `Cache-Control` (string)  
        Example: `no-cache,must-revalidate,max-age=0,no-store,private`.
    *   `Sforce-Limit-Info` (string)  
        Example: `api-usage=1581/101002`.
    *   `Transfer-Encoding` (string)  
        Example: `chunked`.
    
    Media type: `text/plain`. Schema: `string`.
    
    Type: `string`.
    

### GET Get Job Info

`GET /services/data/v51.0/jobs/ingest/[jobID]`

Operation ID: `Get Job Info`. Tags: Bulk. Security: bearerAuth.

This call allows the current status of a job to be checked. The state field may have the following values:

*   Open: the job has just been created.
*   UploadComplete: the job has finished and is waiting to be queued for updating.
*   InProgress: the updates are in progress.
*   Aborted: the job was cancelled manually.
*   JobComplete: the job was completed (this does not necessarily mean that no errors occurred).
*   Failed: some kind of error occurred that prevented the job from running.

After ending, the fields `numberRecordsProcessed` and `numberRecordsFailed` show how many fields were processed in total and how many of these produced an error.

#### Responses

*   **200** OK
    
    Headers:
    
    *   `Date` (string)  
        Example: `Wed, 26 May 2021 13:37:28 GMT`.
    *   `Strict-Transport-Security` (string)  
        Example: `max-age=31536002; includeSubDomains`.
    *   `X-Content-Type-Options` (string)  
        Example: `nosniff`.
    *   `X-XSS-Protection` (string)  
        Example: `1; mode=block`.
    *   `X-Robots-Tag` (string)  
        Example: `none`.
    *   `Cache-Control` (string)  
        Example: `no-cache,must-revalidate,max-age=0,no-store,private`.
    *   `Sforce-Limit-Info` (string)  
        Example: `api-usage=1582/101002`.
    *   `Content-Type` (string)  
        Example: `application/json;charset=UTF-8`.
    *   `Vary` (string)  
        Example: `Accept-Encoding`.
    *   `Content-Encoding` (string)  
        Example: `gzip`.
    *   `Transfer-Encoding` (string)  
        Example: `chunked`.
    
    Media type: `application/json`. Schema: `object`.
    
    _Example_
    
    ```
    {
      "id": "7505Y00000QJI8TQAX",
      "operation": "upsert",
      "object": "Atonit_Mktplace__Inventory_Record__c",
      "createdById": "0055Y00000GrvNkQAJ",
      "createdDate": "2021-05-26T13:35:28.000+0000",
      "systemModstamp": "2021-05-26T13:36:38.000+0000",
      "state": "JobComplete",
      "externalIdFieldName": "Atonit_Mktplace__External_Id__c",
      "concurrencyMode": "Parallel",
      "contentType": "CSV",
      "apiVersion": 51,
      "jobType": "V2Ingest",
      "lineEnding": "CRLF",
      "columnDelimiter": "COMMA",
      "numberRecordsProcessed": 2,
      "numberRecordsFailed": 1,
      "retries": 0,
      "totalProcessingTime": 97,
      "apiActiveProcessingTime": 43,
      "apexProcessingTime": 0
    }
    ```
    

### PATCH Close a Job

`PATCH /services/data/v51.0/jobs/ingest/[jobID]`

Operation ID: `Close a Job`. Tags: Bulk. Security: bearerAuth.

Finalizes the upload of the job data and flags it to start the processing. Upon making this call, Salesforce will queue to start updating the data and no more uploads of data within the job will be permitted.

#### Request body

Media type: `application/json`. Schema: `object`.

_Example_

```
{
  "state": "UploadComplete"
}
```

#### Responses

*   **200** OK
    
    Headers:
    
    *   `Date` (string)  
        Example: `Wed, 26 May 2021 13:36:36 GMT`.
    *   `Strict-Transport-Security` (string)  
        Example: `max-age=31536002; includeSubDomains`.
    *   `X-Content-Type-Options` (string)  
        Example: `nosniff`.
    *   `X-XSS-Protection` (string)  
        Example: `1; mode=block`.
    *   `X-Robots-Tag` (string)  
        Example: `none`.
    *   `Cache-Control` (string)  
        Example: `no-cache,must-revalidate,max-age=0,no-store,private`.
    *   `Sforce-Limit-Info` (string)  
        Example: `api-usage=1582/101002`.
    *   `Content-Type` (string)  
        Example: `application/json;charset=UTF-8`.
    *   `Transfer-Encoding` (string)  
        Example: `chunked`.
    
    Media type: `application/json`. Schema: `object`.
    
    _Example_
    
    ```
    {
      "id": "7505Y00000QJI8TQAX",
      "operation": "upsert",
      "object": "Atonit_Mktplace__Inventory_Record__c",
      "createdById": "0055Y00000GrvNkQAJ",
      "createdDate": "2021-05-26T13:35:28.000+0000",
      "systemModstamp": "2021-05-26T13:35:28.000+0000",
      "state": "UploadComplete",
      "externalIdFieldName": "Atonit_Mktplace__External_Id__c",
      "concurrencyMode": "Parallel",
      "contentType": "CSV",
      "apiVersion": 51
    }
    ```
    

### GET Get Job Failed Results

`GET /services/data/v51.0/jobs/ingest/[jobID]/failedResults/`

Operation ID: `Get Job Failed Results`. Tags: Bulk. Security: bearerAuth.

This call allows the reason for the error to be consulted when it was not possible to update a given field.

The response will be a CSV file and it is important to take care with its size, if there are many records with errors.

#### Responses

*   **200** OK
    
    Headers:
    
    *   `Date` (string)  
        Example: `Wed, 26 May 2021 13:38:46 GMT`.
    *   `Strict-Transport-Security` (string)  
        Example: `max-age=31536002; includeSubDomains`.
    *   `X-Content-Type-Options` (string)  
        Example: `nosniff`.
    *   `X-XSS-Protection` (string)  
        Example: `1; mode=block`.
    *   `X-Robots-Tag` (string)  
        Example: `none`.
    *   `Cache-Control` (string)  
        Example: `no-cache,must-revalidate,max-age=0,no-store,private`.
    *   `Sforce-Limit-Info` (string)  
        Example: `api-usage=1585/101002`.
    *   `Content-Type` (string)  
        Example: `text/csv`.
    *   `Vary` (string)  
        Example: `Accept-Encoding`.
    *   `Content-Encoding` (string)  
        Example: `gzip`.
    *   `Transfer-Encoding` (string)  
        Example: `chunked`.
    
    Media type: `text/plain`. Schema: `string`.
    
    Type: `string`.
    
    _Example_
    
    ```
    "sf__Id","sf__Error",Atonit_Mktplace__External_Id__c,Atonit_Mktplace__Inventory__r.Atonit_Mktplace__External_Id__c,Atonit_Mktplace__Product_Variant__r.Atonit_Mktplace__External_Id__c,Atonit_Mktplace__Quantity__c"","INVALID_FIELD:Foreign key external ID: atonit-vitta-incorrect_id not found for field Atonit_Mktplace__External_Id__c in entity Atonit_Mktplace__Inventory__c:--","atonit-vitta-incorrect_id-atonit-vitta-sku-1","atonit-vitta-incorrect_id","atonit-vitta-sku-1","99.0"
    ```