curl "https://api.phrase.com/v2/projects/:project_id/orders" \
-u USERNAME_OR_ACCESS_TOKEN \
-X POST \
-d '{"branch":"my-feature-branch","name":"Welcome message translations","lsp":"textmaster","source_locale_id":"abcd1234abcd1234abcd1234abcd1234","target_locale_ids":["1234abcd1234abcd1234abcd1234abcd","abcd1234abcd1234abcd1234abcd1234"],"translation_type":"premium","tag":"my-awesome-feature","message":"Please make everything sound really nice :)","styleguide_id":"1234abcd1234abcd1234abcd1234abcd","category":"C021"}' \
-H 'Content-Type: application/json'phrase orders create \
--project_id <project_id> \
--data '{"branch":"my-feature-branch", "name":"Welcome message translations", "lsp":"textmaster", "source_locale_id":"abcd1234abcd1234abcd1234abcd1234", "target_locale_ids": "1234abcd1234abcd1234abcd1234abcd,abcd1234abcd1234abcd1234abcd1234", "translation_type":"premium", "tag":"my-awesome-feature", "message": "Please make everything sound really nice :)", "styleguide_id":"1234abcd1234abcd1234abcd1234abcd", "category":"C021"}' \
--access_token <token>import requests
url = "https://api.phrase.com/v2/projects/{project_id}/orders"
payload = {
"name": "Welcome message translations",
"lsp": "textmaster",
"branch": "my-feature-branch",
"source_locale_id": "abcd1234abcd1234abcd1234abcd1234",
"target_locale_ids": ["1234abcd1234abcd1234abcd1234abcd", "abcd1234abcd1234abcd1234abcd1234"],
"translation_type": "premium",
"tag": "my-awesome-feature",
"message": "Please make everything sound really nice :)",
"styleguide_id": "1234abcd1234abcd1234abcd1234abcd",
"unverify_translations_upon_delivery": None,
"include_untranslated_keys": None,
"include_unverified_translations": None,
"category": "C021",
"quality": None,
"priority": None
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Welcome message translations',
lsp: 'textmaster',
branch: 'my-feature-branch',
source_locale_id: 'abcd1234abcd1234abcd1234abcd1234',
target_locale_ids: ['1234abcd1234abcd1234abcd1234abcd', 'abcd1234abcd1234abcd1234abcd1234'],
translation_type: 'premium',
tag: 'my-awesome-feature',
message: 'Please make everything sound really nice :)',
styleguide_id: '1234abcd1234abcd1234abcd1234abcd',
unverify_translations_upon_delivery: null,
include_untranslated_keys: null,
include_unverified_translations: null,
category: 'C021',
quality: null,
priority: null
})
};
fetch('https://api.phrase.com/v2/projects/{project_id}/orders', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.phrase.com/v2/projects/{project_id}/orders",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Welcome message translations',
'lsp' => 'textmaster',
'branch' => 'my-feature-branch',
'source_locale_id' => 'abcd1234abcd1234abcd1234abcd1234',
'target_locale_ids' => [
'1234abcd1234abcd1234abcd1234abcd',
'abcd1234abcd1234abcd1234abcd1234'
],
'translation_type' => 'premium',
'tag' => 'my-awesome-feature',
'message' => 'Please make everything sound really nice :)',
'styleguide_id' => '1234abcd1234abcd1234abcd1234abcd',
'unverify_translations_upon_delivery' => null,
'include_untranslated_keys' => null,
'include_unverified_translations' => null,
'category' => 'C021',
'quality' => null,
'priority' => null
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.phrase.com/v2/projects/{project_id}/orders"
payload := strings.NewReader("{\n \"name\": \"Welcome message translations\",\n \"lsp\": \"textmaster\",\n \"branch\": \"my-feature-branch\",\n \"source_locale_id\": \"abcd1234abcd1234abcd1234abcd1234\",\n \"target_locale_ids\": [\n \"1234abcd1234abcd1234abcd1234abcd\",\n \"abcd1234abcd1234abcd1234abcd1234\"\n ],\n \"translation_type\": \"premium\",\n \"tag\": \"my-awesome-feature\",\n \"message\": \"Please make everything sound really nice :)\",\n \"styleguide_id\": \"1234abcd1234abcd1234abcd1234abcd\",\n \"unverify_translations_upon_delivery\": null,\n \"include_untranslated_keys\": null,\n \"include_unverified_translations\": null,\n \"category\": \"C021\",\n \"quality\": null,\n \"priority\": null\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.phrase.com/v2/projects/{project_id}/orders")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Welcome message translations\",\n \"lsp\": \"textmaster\",\n \"branch\": \"my-feature-branch\",\n \"source_locale_id\": \"abcd1234abcd1234abcd1234abcd1234\",\n \"target_locale_ids\": [\n \"1234abcd1234abcd1234abcd1234abcd\",\n \"abcd1234abcd1234abcd1234abcd1234\"\n ],\n \"translation_type\": \"premium\",\n \"tag\": \"my-awesome-feature\",\n \"message\": \"Please make everything sound really nice :)\",\n \"styleguide_id\": \"1234abcd1234abcd1234abcd1234abcd\",\n \"unverify_translations_upon_delivery\": null,\n \"include_untranslated_keys\": null,\n \"include_unverified_translations\": null,\n \"category\": \"C021\",\n \"quality\": null,\n \"priority\": null\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.phrase.com/v2/projects/{project_id}/orders")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Welcome message translations\",\n \"lsp\": \"textmaster\",\n \"branch\": \"my-feature-branch\",\n \"source_locale_id\": \"abcd1234abcd1234abcd1234abcd1234\",\n \"target_locale_ids\": [\n \"1234abcd1234abcd1234abcd1234abcd\",\n \"abcd1234abcd1234abcd1234abcd1234\"\n ],\n \"translation_type\": \"premium\",\n \"tag\": \"my-awesome-feature\",\n \"message\": \"Please make everything sound really nice :)\",\n \"styleguide_id\": \"1234abcd1234abcd1234abcd1234abcd\",\n \"unverify_translations_upon_delivery\": null,\n \"include_untranslated_keys\": null,\n \"include_unverified_translations\": null,\n \"category\": \"C021\",\n \"quality\": null,\n \"priority\": null\n}"
response = http.request(request)
puts response.read_body{
"id": "30AB4884",
"lsp": "gengo",
"amount_in_cents": 1152,
"currency": "usd",
"message": "Please make everything sound really nice :)",
"state": "confirmed",
"translation_type": "pro",
"progress_percent": 50,
"source_locale": {
"id": "abcd1234cdef1234abcd1234cdef1234",
"name": "en",
"code": "en-GB"
},
"target_locales": [
{
"id": "abcd1234cdef1234abcd1234cdef1234",
"name": "de",
"code": "de-DE"
},
{
"id": "abcd1234cdef1234abcd1234cdef1234",
"name": "fr",
"code": "fr-FR"
}
],
"tag_name": "latest-upload",
"styleguide": {
"id": "abcd1234cdef1234abcd1234cdef1234",
"title": "My Styleguide"
},
"unverify_translations_upon_delivery": true,
"quality": true,
"priority": true,
"created_at": "2015-01-28T09:52:53Z",
"updated_at": "2015-01-28T09:52:53Z"
}{
"message": "Validation Failed",
"errors": [
{
"resource": "Resource",
"field": "name",
"message": "can't be blank"
}
]
}Create a new order
Create a new order. Access token scope must include orders.create.
curl "https://api.phrase.com/v2/projects/:project_id/orders" \
-u USERNAME_OR_ACCESS_TOKEN \
-X POST \
-d '{"branch":"my-feature-branch","name":"Welcome message translations","lsp":"textmaster","source_locale_id":"abcd1234abcd1234abcd1234abcd1234","target_locale_ids":["1234abcd1234abcd1234abcd1234abcd","abcd1234abcd1234abcd1234abcd1234"],"translation_type":"premium","tag":"my-awesome-feature","message":"Please make everything sound really nice :)","styleguide_id":"1234abcd1234abcd1234abcd1234abcd","category":"C021"}' \
-H 'Content-Type: application/json'phrase orders create \
--project_id <project_id> \
--data '{"branch":"my-feature-branch", "name":"Welcome message translations", "lsp":"textmaster", "source_locale_id":"abcd1234abcd1234abcd1234abcd1234", "target_locale_ids": "1234abcd1234abcd1234abcd1234abcd,abcd1234abcd1234abcd1234abcd1234", "translation_type":"premium", "tag":"my-awesome-feature", "message": "Please make everything sound really nice :)", "styleguide_id":"1234abcd1234abcd1234abcd1234abcd", "category":"C021"}' \
--access_token <token>import requests
url = "https://api.phrase.com/v2/projects/{project_id}/orders"
payload = {
"name": "Welcome message translations",
"lsp": "textmaster",
"branch": "my-feature-branch",
"source_locale_id": "abcd1234abcd1234abcd1234abcd1234",
"target_locale_ids": ["1234abcd1234abcd1234abcd1234abcd", "abcd1234abcd1234abcd1234abcd1234"],
"translation_type": "premium",
"tag": "my-awesome-feature",
"message": "Please make everything sound really nice :)",
"styleguide_id": "1234abcd1234abcd1234abcd1234abcd",
"unverify_translations_upon_delivery": None,
"include_untranslated_keys": None,
"include_unverified_translations": None,
"category": "C021",
"quality": None,
"priority": None
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Welcome message translations',
lsp: 'textmaster',
branch: 'my-feature-branch',
source_locale_id: 'abcd1234abcd1234abcd1234abcd1234',
target_locale_ids: ['1234abcd1234abcd1234abcd1234abcd', 'abcd1234abcd1234abcd1234abcd1234'],
translation_type: 'premium',
tag: 'my-awesome-feature',
message: 'Please make everything sound really nice :)',
styleguide_id: '1234abcd1234abcd1234abcd1234abcd',
unverify_translations_upon_delivery: null,
include_untranslated_keys: null,
include_unverified_translations: null,
category: 'C021',
quality: null,
priority: null
})
};
fetch('https://api.phrase.com/v2/projects/{project_id}/orders', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.phrase.com/v2/projects/{project_id}/orders",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Welcome message translations',
'lsp' => 'textmaster',
'branch' => 'my-feature-branch',
'source_locale_id' => 'abcd1234abcd1234abcd1234abcd1234',
'target_locale_ids' => [
'1234abcd1234abcd1234abcd1234abcd',
'abcd1234abcd1234abcd1234abcd1234'
],
'translation_type' => 'premium',
'tag' => 'my-awesome-feature',
'message' => 'Please make everything sound really nice :)',
'styleguide_id' => '1234abcd1234abcd1234abcd1234abcd',
'unverify_translations_upon_delivery' => null,
'include_untranslated_keys' => null,
'include_unverified_translations' => null,
'category' => 'C021',
'quality' => null,
'priority' => null
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.phrase.com/v2/projects/{project_id}/orders"
payload := strings.NewReader("{\n \"name\": \"Welcome message translations\",\n \"lsp\": \"textmaster\",\n \"branch\": \"my-feature-branch\",\n \"source_locale_id\": \"abcd1234abcd1234abcd1234abcd1234\",\n \"target_locale_ids\": [\n \"1234abcd1234abcd1234abcd1234abcd\",\n \"abcd1234abcd1234abcd1234abcd1234\"\n ],\n \"translation_type\": \"premium\",\n \"tag\": \"my-awesome-feature\",\n \"message\": \"Please make everything sound really nice :)\",\n \"styleguide_id\": \"1234abcd1234abcd1234abcd1234abcd\",\n \"unverify_translations_upon_delivery\": null,\n \"include_untranslated_keys\": null,\n \"include_unverified_translations\": null,\n \"category\": \"C021\",\n \"quality\": null,\n \"priority\": null\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.phrase.com/v2/projects/{project_id}/orders")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Welcome message translations\",\n \"lsp\": \"textmaster\",\n \"branch\": \"my-feature-branch\",\n \"source_locale_id\": \"abcd1234abcd1234abcd1234abcd1234\",\n \"target_locale_ids\": [\n \"1234abcd1234abcd1234abcd1234abcd\",\n \"abcd1234abcd1234abcd1234abcd1234\"\n ],\n \"translation_type\": \"premium\",\n \"tag\": \"my-awesome-feature\",\n \"message\": \"Please make everything sound really nice :)\",\n \"styleguide_id\": \"1234abcd1234abcd1234abcd1234abcd\",\n \"unverify_translations_upon_delivery\": null,\n \"include_untranslated_keys\": null,\n \"include_unverified_translations\": null,\n \"category\": \"C021\",\n \"quality\": null,\n \"priority\": null\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.phrase.com/v2/projects/{project_id}/orders")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Welcome message translations\",\n \"lsp\": \"textmaster\",\n \"branch\": \"my-feature-branch\",\n \"source_locale_id\": \"abcd1234abcd1234abcd1234abcd1234\",\n \"target_locale_ids\": [\n \"1234abcd1234abcd1234abcd1234abcd\",\n \"abcd1234abcd1234abcd1234abcd1234\"\n ],\n \"translation_type\": \"premium\",\n \"tag\": \"my-awesome-feature\",\n \"message\": \"Please make everything sound really nice :)\",\n \"styleguide_id\": \"1234abcd1234abcd1234abcd1234abcd\",\n \"unverify_translations_upon_delivery\": null,\n \"include_untranslated_keys\": null,\n \"include_unverified_translations\": null,\n \"category\": \"C021\",\n \"quality\": null,\n \"priority\": null\n}"
response = http.request(request)
puts response.read_body{
"id": "30AB4884",
"lsp": "gengo",
"amount_in_cents": 1152,
"currency": "usd",
"message": "Please make everything sound really nice :)",
"state": "confirmed",
"translation_type": "pro",
"progress_percent": 50,
"source_locale": {
"id": "abcd1234cdef1234abcd1234cdef1234",
"name": "en",
"code": "en-GB"
},
"target_locales": [
{
"id": "abcd1234cdef1234abcd1234cdef1234",
"name": "de",
"code": "de-DE"
},
{
"id": "abcd1234cdef1234abcd1234cdef1234",
"name": "fr",
"code": "fr-FR"
}
],
"tag_name": "latest-upload",
"styleguide": {
"id": "abcd1234cdef1234abcd1234cdef1234",
"title": "My Styleguide"
},
"unverify_translations_upon_delivery": true,
"quality": true,
"priority": true,
"created_at": "2015-01-28T09:52:53Z",
"updated_at": "2015-01-28T09:52:53Z"
}{
"message": "Validation Failed",
"errors": [
{
"resource": "Resource",
"field": "name",
"message": "can't be blank"
}
]
}Authorizations
Enter your token in the format token TOKEN
Headers
Two-Factor-Authentication token (optional)
Path Parameters
Project ID
Body
the name of the order, default name is: Translation order from 'current datetime'
"Welcome message translations"
Name of the LSP that should process this order. Can be one of gengo, textmaster.
"textmaster"
specify the branch to use
"my-feature-branch"
Source locale for the order. Can be the name or id of the source locale. Preferred is id.
"abcd1234abcd1234abcd1234abcd1234"
List of target locales you want the source content translate to. Can be the name or id of the target locales. Preferred is id.
[
"1234abcd1234abcd1234abcd1234abcd",
"abcd1234abcd1234abcd1234abcd1234"
]
Name of the quality level, availability depends on the LSP. Can be one of: standard, pro (for orders processed by Gengo) and one of regular, premium, enterprise (for orders processed by TextMaster)
"premium"
Tag you want to order translations for.
"my-awesome-feature"
Message that is displayed to the translators for description.
"Please make everything sound really nice :)"
Style guide for translators to be sent with the order.
"1234abcd1234abcd1234abcd1234abcd"
Unverify translations upon delivery.
null
Order translations for keys with untranslated content in the selected target locales.
null
Order translations for keys with unverified content in the selected target locales.
null
Category to use (required for orders processed by TextMaster).
"C021"
Extra proofreading option to ensure consistency in vocabulary and style. Only available for orders processed by TextMaster.
null
Indicates whether the priority option should be ordered which decreases turnaround time by 30%. Available only for orders processed by TextMaster.
null
Response
Created
Show child attributes
Show child attributes
{
"id": "abcd1234cdef1234abcd1234cdef1234",
"name": "English",
"code": "en-GB"
}
Show child attributes
Show child attributes
Name of the tag whose keys are included in the order.
Show child attributes
Show child attributes
{
"id": "abcd1234cdef1234abcd1234cdef1234",
"title": "My Style Guide"
}
Was this page helpful?