Chord’s headless e-commerce and data platform empower you to build bespoke, best-in-class e-commerce experiences. This is a Go SDK for the Chord API
go get github.com/speakeasy-sdks/chord-go-sdk
package main
import (
"log"
"github.com/speakeasy-sdks/chord-go-sdk"
"github.com/speakeasy-sdks/chord-go-sdk/pkg/models/shared"
"github.com/speakeasy-sdks/chord-go-sdk/pkg/models/operations"
)
func main() {
opts := []sdk.SDKOption{
sdk.WithSecurity(
shared.Security{
BearerAuth: shared.SchemeBearerAuth{
Authorization: "Bearer YOUR_BEARER_TOKEN_HERE",
},
}
),
}
s := sdk.New(opts...)
req := operations.FindWebhookAttempsRequest{
QueryParams: operations.FindWebhookAttempsQueryParams{
Q: "unde",
},
}
res, err := s.Attempts.FindWebhookAttemps(ctx, req)
if err != nil {
log.Fatal(err)
}
if res.StatusCode == http.StatusOK {
// handle response
}
The API provides two means of authentication: one is through your user's API key, while the other is through an order's guest token.
You can use your API key to access all resources in the API. The API key must be passed in the Authorization header in the following form:
Authorization: Bearer API_KEY
As an admin, you can find your API token in the admin section under Users > Your e-email > API Access (at admin/users/<user_id>/edit)
Example:
curl --header "Authorization: Bearer 1a6a9936ad150a2ee345c65331da7a3ccc2de" http://plant-staging.assembly-api.com/api/stores
For allowing guests to manage their cart and place their order, you can use the order's guest token. This token is contained in the guest_token property of the order, and it allows you to perform certain checkout-related operations on the order such as managing line items, completing the checkout flow etc.
The order token must be passed in the X-Spree-Order-Token header in the following form:
X-Spree-Order-Token: ORDER_TOKEN
If you are already providing an API key, you don't need to also provide the order token (although you may do so). More information on authentication can be found here
FindWebhookAttemps
- get all Webhook AttempsGetAPIWebhookAttemptsID
- retrieve Attempt
GetCountryByID
- Get the country by idListCountries
- Get all countries
CreateEndpoint
- create EndpointDeleteAPIWebhookEndpointsID
- Remove Endpoint
FindWebhookEndpoints
- get all Webhook EndpointsGetAPIWebhookEndpointsID
- retrieve EndpointPutAPIWebhookEndpointsID
- Update Endpoint
PostAPISolidusImporterImports
- Create Import
FindOrCreateReferralIdentifier
- Referral identifier
FindReminders
- get all Subscription Reminders
CreateRole
- create RoleFindRoles
- get all RolesGetAPIRolesID
- retrieve RolePutAPIRolesID
- Update RolePutAPIRolesIDAddUserID
- Add User to RolePutAPIRolesIDRemoveUserID
- Remove User from Role
GetStatesByID
- Get the states for one country retrieved by idListStates
- Get all states
CreateStockRequest
- Create Stock Request
GetAPIStoresStoreIDEnvironmentVariables
- get Store ConfigurationPatchAPIStoresStoreIDEnvironmentVariables
- Update Store ConfigurationPostAPIStoresStoreIDEnvironmentVariables
- Update Store Configuration
CreateSubscriptionTags
- add tags to subscriptionDeleteSubscriptionTags
- remove tags from the subscriptionGetSubscription
- Retrieve a subscriptionGetSubscriptions
- Retrieves all subscriptionsUpdateSubscriptionTags
- set the tags on the subscription
CreateTag
- create Tag
FindTags
- get all TagsGetAPITagsID
- retrieve TagPutAPITagsAddToOrderNumber
- Add Tag(s) to OrderPutAPITagsAddToOrders
- Add Tag(s) to Order(s)PutAPITagsRemoveFromOrderNumber
- Remove Tag(s) from orderPutAPITagsID
- Update TagPutAPITagsIDRemoveFromOrderNumber
- Remove Tag(s) from orderPutAPITagsIDAddToOrderNumber
- Add Tag to Order
ListWalletPaymentSource
- Get all user payment sources