right-left-largePartner Data API

Authentication

To send requests to this api, you need to generate a JWT for authorization. The authorization in the HTTP header is a JWT token using HS256 algorithm.

Please use the secret key(provided by Yofi) to generate a token. An example of token claims is shown below:

{
  "iss": "partner_id/issuer", // Your partner id provided by Yofi
  "sub": "the-service-account-with-permissions", // Provided by Yofi
  "aud": ["yofi-public-api"], // Provided by Yofi
  "exp": 1716123456,   // Expiration Time
  "iat": 1716113456,   // The time at which the JWT was issued.
  "jti": "a1b2c3d4-e5f6-7890-g1h2-i3j4k5l6m7n8", //uuid 
  "client_id": "backend-service", // Provided by Yofi
}

You also need to include the following headers in every request:

  • app_id: "the-shopify-store.myshopify.com" — The URL of Shopify store or your Yofi app ID

  • partner_id: "shopify" — The platform identifier within Yofi (currently fixed as shopify)

For partners who completed integration prior to 2026, please generate the JWT token using the payload specified herein. No additional HTTP headers are required.

{
  "iss": "partner_id", // Partner ID
  "exp": 1716123456,   // Expiration Time
  "iat": 1716113456,   // The time at which the JWT was issued.
  "aud": "Yofi",       // Audience, case-sensitive
  "sub": "the-shopify-store.myshopify.com", // Shopify shop url, without https://
  "org_id": "the organization id"
}

Get Claims

get
Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Query parameters
fields[Claim]stringOptional

The additional fields of the Claim to be returned.

Example: id,customer_id,claim_items
filterstringOptional

The RSQL filter of the Claim

supported fields:

  • created_at_epoch (Epoch timestamp)

supported operators:

  • >=
  • <=
  • >
  • <
  • ==
  • !=
  • =in=
  • =out=
Example: created_at_epoch>=1746757960
page[size]integer · min: 1Optional

Number of records to return per page

Default: 10Example: 10
page[number]integer · min: 1Optional

Page number to return

Default: 1Example: 1
sortstringOptional

Comma-separated list of fields to sort by (prefix field with - for descending order)

Example: -created_at_epoch
Responses
chevron-right
200

Successful Response

application/json
get
/ecommerce/claims/

Get Customers List

get
Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Query parameters
includestringOptional

The resources to be returned in included.

Example: customer_predictions
fields[EcommerceCustomer]stringOptional

The fields of the EcommerceCustomer to be returned.

Example: entity_id,customer_id,app_id,organization_id
fields[EcommerceCustomerPrediction]stringOptional

The fields of the EcommerceCustomerPrediction to be returned.

Example: severity,predicted_value,model_name,prediction_category,justification,prediction_title,is_result_prediction,customer_id,entity_id
filter[EcommerceCustomer]stringOptional

The RSQL filter of the EcommerceCustomer

supported fields:

  • customer_id
  • email

supported operators:

  • ==
  • !=
Example: email=='[email protected]'
page[size]integer · min: 1Optional

Number of records to return per page

Default: 10Example: 10
page[number]integer · min: 1Optional

Page number to return

Default: 1Example: 1
Responses
chevron-right
200

Successful Response

application/json
get
/ecommerce/customers/

Get Customer Details

get
Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
customer_idstringRequired

The ID of the customer

Example: 1234567890
Query parameters
includestringOptional

The resources to be returned in included.

Example: customer_predictions
fields[EcommerceCustomer]stringOptional

The fields of the EcommerceCustomer to be returned.

Example: entity_id,customer_id,app_id,organization_id
fields[EcommerceCustomerPrediction]stringOptional

The fields of the EcommerceCustomerPrediction to be returned.

Example: severity,predicted_value,model_name,prediction_category,justification,prediction_title,is_result_prediction,customer_id,entity_id
Responses
chevron-right
200

Successful Response

application/json
get
/ecommerce/customers/{customer_id}/

Get Unified Returns

get
Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Query parameters
fields[EcommerceUnifiedReturn]stringOptional

The additional fields of the EcommerceUnifiedReturn to be returned.

Example: entity_id,app_id,order_id,customer_id,state,order_name,order_created_at_epoch,order_created_at_epoch,return_created_at_epoch,meta_data,return_total,customer_first_name,customer_last_name
filter[EcommerceUnifiedReturn]stringOptional

The RSQL filter of the EcommerceUnifiedReturn

supported fields:

  • order_id
  • customer_id
  • order_number
  • order_name
  • state
  • customer_first_name
  • customer_last_name

supported operators:

  • >=
  • <=
  • >
  • <
  • ==
  • !=
  • =in=
  • =out=
Example: order_id=='test'
includestringOptional

The resources to be returned in included.

Example: customer,order,return_predictions,return_analytics,app
filter[EcommerceUnifiedReturnPrediction]stringOptional

The RSQL filter of the EcommerceUnifiedReturnPrediction

supported fields:

  • prediction_category
  • predicted_value
Example: (prediction_category==drop_off_fraud;predicted_value>0.9)
fields[EcommerceOrder]stringOptional

The additional fields of the EcommerceOrder to be returned.

Example: id,name,model_predictions
fields[EcommerceCustomer]stringOptional

The additional fields of the EcommerceCustomer to be returned.

Example: customer_id,first_name,last_name,model_predictions,email
page[size]integer · min: 1Optional

Number of records to return per page

Default: 10Example: 10
page[number]integer · min: 1Optional

Page number to return

Default: 1Example: 1
sortstringOptional

Comma-separated list of fields to sort by (prefix field with - for descending order)

Example: -order_created_at_epoch
Responses
chevron-right
200

Successful Response

application/json
get
/unified_returns/

Get Notification Events

get
Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Query parameters
fields[NotificationEvent]stringOptional

The additional fields of the NotificationEvent to be returned.

Example: id,notify_template_id,created_at
filterstringOptional

The RSQL filter of the NotificationEvent.

supported fields:

  • created_at (ISO UTC datetime)

supported operators:

  • >=
  • <=
  • >
  • <
  • ==
  • !=
  • =in=
  • =out=
Example: created_at>=2025-06-06T11:54:41Z
page[size]integer · min: 1Optional

Number of records to return per page

Default: 10Example: 10
page[number]integer · min: 1Optional

Page number to return

Default: 1Example: 1
sortstringOptional

Comma-separated list of fields to sort by (prefix field with - for descending order)

Example: -created_at
Responses
chevron-right
200

Successful Response

application/json
get
/notification_events/

Last updated

Was this helpful?